Common commands
. 1 SHOW DATABASES; 2 . 3 / * . 4 use Test; . 5 Create Database MyEmployees; . 6 use MyEmployees; . 7 Create Table the Employees ( . 8 the employee_id int (. 6) Primary Key Not null, # employee number . 9 FIRST_NAME VARCHAR (20 is), # Name 10 last_name varchar (25), # name . 11 In email VARCHAR (25), mailbox # 12 is phone_num VARCHAR (20 is), the telephone number # 13 is the job_id VARCHAR (10), types of ID # 14 the salary Double (10,2), salary # 15 commission_pet double (4,2), # bonus rate of 16 manager_id int (6), # superiors number . 17 DEPARTMENT_ID int (. 4), # department number 18 is HireDate datetime # entry date . 19 ) 20 is * / 21 is / * 22 is Create Table Departments ( 23 is DEPARTMENT_ID int (. 4) Primary Key Not null, # department number 24 DEPARTMENT_NAME VARCHAR (. 3), # department name 25 manager_id int (6), # department heads employee number 26 location_id int (4) # position number 27 ) 28 * / 29 / * 30 the Create the Table locations ( 31 location_id int (11) Primary Key not null, # position numbers 32 a street_address VARCHAR (40), street # 33 postal_code varchar (12), # Zip 34 is City VARCHAR (30), # City 35 State_Province VARCHAR (25), # State / Province 36 the country_id VARCHAR (2) # State No. 37 [ ) 38 is * / 39 40 the CREATE TABLE Jobs ( 41 is the job_id VARCHAR ( 10 ) PRIMARY KEY the NOT NULL , job number # 42 JOB_TITLE VARCHAR ( 35 ), the working name # 43 min_salary INT ( 6 ), the minimum wage # 44 MAX_SALARY INT ( 6 ) # maximum wage 45 )
summary: