• MySQL学习的表单定义


    mysql> select database();
    +-------------+
    | database()  |
    +-------------+
    | myemployees |
    +-------------+
    1 row in set (0.00 sec)
    
    
    mysql> show tables;
    +-----------------------+
    | Tables_in_myemployees |
    +-----------------------+
    | departments           |
    | employees             |
    | job_grades            |
    | jobs                  |
    | locations             |
    +-----------------------+
    5 rows in set (0.00 sec)
    
    mysql> desc departments;
    +-----------------+------------+------+-----+---------+----------------+
    | Field           | Type       | Null | Key | Default | Extra          |
    +-----------------+------------+------+-----+---------+----------------+
    | department_id   | int(4)     | NO   | PRI | NULL    | auto_increment |
    | department_name | varchar(3) | YES  |     | NULL    |                |
    | manager_id      | int(6)     | YES  |     | NULL    |                |
    | location_id     | int(4)     | YES  | MUL | NULL    |                |
    +-----------------+------------+------+-----+---------+----------------+
    4 rows in set (0.00 sec)
    
    mysql> desc employees;
    +----------------+--------------+------+-----+---------+----------------+
    | Field          | Type         | Null | Key | Default | Extra          |
    +----------------+--------------+------+-----+---------+----------------+
    | employee_id    | int(6)       | NO   | PRI | NULL    | auto_increment |
    | first_name     | varchar(20)  | YES  |     | NULL    |                |
    | last_name      | varchar(25)  | YES  |     | NULL    |                |
    | email          | varchar(25)  | YES  |     | NULL    |                |
    | phone_number   | varchar(20)  | YES  |     | NULL    |                |
    | job_id         | varchar(10)  | YES  | MUL | NULL    |                |
    | salary         | double(10,2) | YES  |     | NULL    |                |
    | commission_pct | double(4,2)  | YES  |     | NULL    |                |
    | manager_id     | int(6)       | YES  |     | NULL    |                |
    | department_id  | int(4)       | YES  | MUL | NULL    |                |
    | hiredate       | datetime     | YES  |     | NULL    |                |
    +----------------+--------------+------+-----+---------+----------------+
    11 rows in set (0.00 sec)
    
    mysql> desc job_grades;
    +-------------+------------+------+-----+---------+-------+
    | Field       | Type       | Null | Key | Default | Extra |
    +-------------+------------+------+-----+---------+-------+
    | grade_level | varchar(3) | YES  |     | NULL    |       |
    | lowest_sal  | int(11)    | YES  |     | NULL    |       |
    | highest_sal | int(11)    | YES  |     | NULL    |       |
    +-------------+------------+------+-----+---------+-------+
    3 rows in set (0.00 sec)
    
    mysql> desc jobs;
    +------------+-------------+------+-----+---------+-------+
    | Field      | Type        | Null | Key | Default | Extra |
    +------------+-------------+------+-----+---------+-------+
    | job_id     | varchar(10) | NO   | PRI | NULL    |       |
    | job_title  | varchar(35) | YES  |     | NULL    |       |
    | min_salary | int(6)      | YES  |     | NULL    |       |
    | max_salary | int(6)      | YES  |     | NULL    |       |
    +------------+-------------+------+-----+---------+-------+
    4 rows in set (0.00 sec)
    
    mysql> desc locations;
    +----------------+-------------+------+-----+---------+----------------+
    | Field          | Type        | Null | Key | Default | Extra          |
    +----------------+-------------+------+-----+---------+----------------+
    | location_id    | int(11)     | NO   | PRI | NULL    | auto_increment |
    | street_address | varchar(40) | YES  |     | NULL    |                |
    | postal_code    | varchar(12) | YES  |     | NULL    |                |
    | city           | varchar(30) | YES  |     | NULL    |                |
    | state_province | varchar(25) | YES  |     | NULL    |                |
    | country_id     | varchar(2)  | YES  |     | NULL    |                |
    +----------------+-------------+------+-----+---------+----------------+
    6 rows in set (0.00 sec)
    mysql> select database();
    +------------+
    | database() |
    +------------+
    | girls      |
    +------------+
    1 row in set (0.00 sec)
    
    mysql> show tables;
    +-----------------+
    | Tables_in_girls |
    +-----------------+
    | admin           |
    | beauty          |
    | boys            |
    +-----------------+
    3 rows in set (0.00 sec)
    
    mysql> desc admin;
    +----------+-------------+------+-----+---------+----------------+
    | Field    | Type        | Null | Key | Default | Extra          |
    +----------+-------------+------+-----+---------+----------------+
    | id       | int(11)     | NO   | PRI | NULL    | auto_increment |
    | username | varchar(10) | NO   |     | NULL    |                |
    | password | varchar(10) | NO   |     | NULL    |                |
    +----------+-------------+------+-----+---------+----------------+
    3 rows in set (0.00 sec)
    
    mysql> desc beauty;
    +--------------+-------------+------+-----+---------------------+----------------+
    | Field        | Type        | Null | Key | Default             | Extra          |
    +--------------+-------------+------+-----+---------------------+----------------+
    | id           | int(11)     | NO   | PRI | NULL                | auto_increment |
    | name         | varchar(50) | NO   |     | NULL                |                |
    | sex          | char(1)     | YES  |     | 女                  |                |
    | borndate     | datetime    | YES  |     | 1987-01-01 00:00:00 |                |
    | phone        | varchar(11) | NO   |     | NULL                |                |
    | photo        | blob        | YES  |     | NULL                |                |
    | boyfriend_id | int(11)     | YES  |     | NULL                |                |
    +--------------+-------------+------+-----+---------------------+----------------+
    7 rows in set (0.00 sec)
    
    mysql> desc boys;
    +---------+-------------+------+-----+---------+----------------+
    | Field   | Type        | Null | Key | Default | Extra          |
    +---------+-------------+------+-----+---------+----------------+
    | id      | int(11)     | NO   | PRI | NULL    | auto_increment |
    | boyName | varchar(20) | YES  |     | NULL    |                |
    | userCP  | int(11)     | YES  |     | NULL    |                |
    +---------+-------------+------+-----+---------+----------------+
    3 rows in set (0.00 sec)
  • 相关阅读:
    java url 获取文件_[转]从URL获取文件保存到本地的JAVA代码,url 请求设置http请求头
    解决Mybatis中出现的Invalid bound statement (not found)问题
    使用多线程往LIST添加数据 线程安全list
    spring BeanUtils 工具实现对象之间的copy 属性复制,属性拷贝
    idea 打开Service窗口一个管理所有服务的地方
    java实现大文件下载(http方式)
    Java @Override注解写与不写的区别
    Linux下C++共享内存
    Linux配置开机自启
    Linux中zsh出现 zsh: corrupt history file /XXX/.zsh_history解决办法
  • 原文地址:https://www.cnblogs.com/BetterThanEver_Victor/p/8760736.html
Copyright © 2020-2023  润新知