?? 設備管理系統.sql
字號:
--創建設備信息表
create table device_info_tab
(device_code varchar2(24) not null ,
device_name varchar(24) not null,
description varchar(1000) null,
oper_date date not null,
buyer varchar2(24) null,
lend_status integer null
check(lend_status in(0,1)),
lend_id integer null);
--添加設備編號主鍵
alter table device_info_tab
add(primary key(device_code));
--創建設備借出信息表
create table device_lend_info_tab
(lend_id integer not null,
device_code varchar2(24) not null,
borrower varchar(24) not null,
borrow_date date null,
return_date date null
);
--添加借出id主鍵
alter table device_lend_info_tab
add (primary key (lend_id));
--添加設備編號外鍵
alter table device_lend_info_tab
add(foreign key(device_code) references device_info_tab);
--創建可以遞增的序列號供lend_id使用
create sequence seq_lend_id increment by 1 start with 1
nomaxvalue nominvalue nocycle;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -