数据库 Departments,Salary,Employess三个表的数据;
select * from Departments;
select * from Salary;
select * from Employess;
drop table Salary;
drop table Departments;
---创建表
CREATE TABLE Employess(
EmployeeID CHAR(6) NOT NULL PRIMARY KEY,
Name char(8) NOT NULL,
Sex Number(1) NOT NULL,
Birthday date NOT NULL,
Address char(20) NULL,
Zip char(6) NULL,
PhoneNumber char(12) NULL,
DepartmentID char(3) not null,
constraint fk_Employess foreign key (DepartmentID) references Departments(DepartmentID) );
---修改表Employess中Name项
alter table Employess
modify(Name char(10));
create table Departments(
DepartmentID char(3) not null primary key,
DepartmentName char(20) not null,
Note varchar2(100) null
);
create table Salary(
EmployeeID char(6) not null primary key,
InCome number(8,2) not null