create table employee(
employee_id integer not null,
employee_name varchar(100) not null,
salary integer not null,
department_id char(4) not null,
primary key(Employee_id)
);
insert INTO employee values(‘1’,‘Joe’,‘70000’,‘1’);
insert into employee values(‘2’,‘Henry’,‘80000’,‘2’);
insert into employee values(‘3’,‘Sam’,‘60000’,‘2’);
insert into employee values(‘4’,‘Max’,‘50000’,‘1’);
SELECT * FROM employee;
create table department(
department_id char(4) not null,
department_name varchar(100) not null,
primary key(department_id)
);
insert into department values(‘1’,‘IT’);
insert into department values(‘2’,‘Sales’);
SELECT * FROM department;
前面建表的。
后面GROUP BY没会,这几天回去看看补一下。