当前位置:网站首页>图书管理数据库系统设计
图书管理数据库系统设计
2022-04-23 19:28:00 【x 心 动】
第1关:数据库表设计 - 图书表
#请在此添加实现代码
########## Begin ##########
#在library_db库中创建books表
use library_db;
create table books(
bookId int(11) primary key not null,
bookName varchar(255) not null,
publicationDate datetime not null,
publisher varchar(255) not null,
bookrackId int(11) not null,
roomId int(11) not null
);
########## End ##########
第2关:数据库表设计 - 读者表
#请在此添加实现代码
########## Begin ##########
#在library_db库中创建reader表
use library_db;
create table reader(
borrowBookId int(11) primary key,
name varchar(20) not null,
age int(11) not null,
sex varchar(2) not null,
address varchar(255) not null
);
########## End ##########
第3关:数据库表设计 - 关联表
#请在此添加实现代码
########## Begin ##########
#在library_db库中创建bookrack表
use library_db;
create table bookrack(
bookrackId int(11) primary key,
roomId int(11) not null,
constraint FK_bookrack_bookrackId foreign key(bookrackId) references books(bookrackId),
constraint FK_bookrack_roomId foreign key(roomId) references books(roomId)
);
#在library_db库中创建borrow表
create table borrow(
borrowBookId int(11) primary key,
bookId int(11) not null,
borrowDate datetime not null,
returnDate datetime not null,
constraint FK_borrow_borrowBookId foreign key(borrowBookId) references reader(borrowBookId),
constraint FK_borrow_bookId foreign key(bookId) references books(bookId)
);
########## End ##########
版权声明
本文为[x 心 动]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_45623072/article/details/124149177
边栏推荐
- HTTP cache - HTTP authoritative guide Chapter VII
- RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
- 深度学习环境搭建步骤—gpu
- Virtual machine performance monitoring and fault handling tools
- 命令-sudo
- A simple (redisson based) distributed synchronization tool class encapsulation
- 数据分析学习目录
- Redis core technology and practice 1 - start with building a simple key value database simplekv
- JS controls the file type and size when uploading files
- Zero cost, zero foundation, build profitable film and television applet
猜你喜欢
MySQL lock
Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
NiO related Basics
ArcMap publishing slicing service
Pdf reference learning notes
Oracle配置st_geometry
Virtual machine performance monitoring and fault handling tools
Grafana 分享带可变参数的链接
山大网安靶场实验平台项目-个人记录(五)
ESP8266-入门第一篇
随机推荐
[report] Microsoft: application of deep learning methods in speech enhancement
arcgis js api dojoConfig配置
【h264】libvlc 老版本的 hevc h264 解析,帧率设定
openlayers draw矩形
openlayers 5.0 离散聚合点
The difference between underline and dot of golang import package
Prefer composition to inheritance
Class loading process of JVM
C6748 软件仿真和硬件测试 ---附详细FFT硬件测量时间
精简CUDA教程——CUDA Driver API
js获取本机ip地址
【webrtc】Add x264 encoder for CEF/Chromium
Wechat applet part of the mobile phone Preview PDF did not respond
Common SQL commands
SQL Server database in clause and exists clause conversion
ArcMap publishing slicing service
Speculation on the way to realize the smooth drag preview of video editing software
Matlab 2019 installation of deep learning toolbox model for googlenet network
Audio signal processing and coding - 2.5.3 the discrete cosine transform
openlayers 5.0 热力图