xsbook.sql
来自「有读者和图书信息的添加查询,借还书等,先建立数据库和ODBC数据源」· SQL 代码 · 共 110 行
SQL
110 行
create database zhozhiyonxsbook
on
(name='zhozhiyonxsbook_data',
filename='C:\Program Files\Microsoft SQL Server\MSSQL\Data\zhozhiyonxsbook_data.mdf',
size=10mb,
maxsize=unlimited,
filegrowth=10%)
log on
(name='zhozhiyonxsbook_log',
filename='C:\Program Files\Microsoft SQL Server\MSSQL\Data\zhozhiyonxsbook_log.ldf',
size=5mb,
maxsize=unlimited,
filegrowth=1mb)
go
use zhozhiyonxsbook
create table zzyxs
( 借书证号 char(8) not null primary key,
姓名 char(8) not null,
专业名 char(12) not null,
性别 bit not null ,
出生时间 datetime not null,
借书量 int check(借书量>=0 and 借书量<=15) null default 0,
照片 image null,
filelen bigint null)
go
create table zzybook
(ISBN char(16) not null primary key,
书名 char(26) not null,
作者 char(8) not null,
出版社 char(20) not null,
价格 float(8) check(价格>0) not null ,
复本量 int check(复本量>=0) null,
库存量 int check(库存量>=0) null)
go
create table zzyjy
(借书证号 char(8) not null ,
ISBN char(16) not null,
索书号 char(10)not null primary key ,
借书日期 datetime not null)
go
create table zzyjyls
(借书证号 char(8) not null ,
ISBN char(16) not null,
索书号 char(10) not null primary key,
借书日期 datetime not null,
还书日期 datetime not null)
go
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?