Mysql学习笔记(001)-常见命令

常见命令

 1 SHOW DATABASES;
 2 
 3 /*
 4 use test;
 5 create database myemployees;
 6 use myemployees;
 7 create table employees (
 8     employee_id int(6) primary key not null, #员工编号
 9     first_name varchar(20), #名
10     last_name varchar(25),    #姓
11     email varchar(25),    #邮箱
12     phone_num varchar(20),    #电话号码
13     job_id varchar(10),    #工种编号
14     salary double(10,2),    #月薪
15     commission_pet double(4,2),#奖金率
16     manager_id int(6),    #上级领导编号
17     department_id int(4),    #部门编号
18     hiredate datetime    #入职日期
19 )
20 */
21 /*
22 create table departments (
23     department_id int(4) primary key not null,#部门编号
24     department_name varchar(3),    #部门名称
25     manager_id int(6),        #部门领导的员工编号
26     location_id int(4)        #位置编号
27 )
28 */
29 /*
30 create table locations (
31     location_id int(11) primary key not null, #位置编号
32     street_address varchar(40),    #街道
33     postal_code varchar(12),    #邮编
34     city varchar(30),        #城市
35     state_province varchar(25),    #州/省
36     country_id varchar(2)        #国家编号
37 )
38 */
39 
40 CREATE TABLE jobs(
41     job_id VARCHAR(10) PRIMARY KEY NOT NULL, #工作编号
42     job_title VARCHAR(35),        #工作名称
43     min_salary INT(6),        #最低工资
44     max_salary INT(6)        #最高工资
45 )

小结:

猜你喜欢

转载自www.cnblogs.com/landerhu/p/12084316.html