sql修仙吧 关注:4贴子:81
  • 0回复贴,共1

Orcle刷题日志2017/11/27

取消只看楼主收藏回复

create user sonic121 identified by 121;
grant connect,resource to sonic121;
create table categorys(
categoryID number(10,2),
categoryName Varchar2(50) NOT NULL enable,
PRIMARY KEY(categoryID)
);
create table publishers(
PubCode Char(4),
PubName Char(50) NOT NULL enable,
Phone Char(50),
Address Varchar2(100),
PRIMARY KEY(PubCode),
UNIQUE(PubName)
);
create table titles(
TitleCode Char(6),
TitleName Varchar2(80) NOT NULL enable,
Author Char(8) NOT NULL enable,
CategoryID number,
PubCode Char(4),
Price number,
PubDate Date,
PRIMARY KEY(TitleCode),
FOREIGN KEY (CategoryID) REFERENCES categorys(CategoryID),
FOREIGN KEY (PubCode) REFERENCES publishers(PubCode),
CHECK (Price>0)
);


IP属地:广东1楼2017-11-27 09:24回复