当前位置:网站首页>图书管理数据库系统设计
图书管理数据库系统设计
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
边栏推荐
- Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项
- Kubernetes入门到精通-KtConnect(全称Kubernetes Toolkit Connect)是一款基于Kubernetes环境用于提高本地测试联调效率的小工具。
- 山大网安靶场实验平台项目-个人记录(五)
- How to uninstall easyton
- Wechat applet part of the mobile phone Preview PDF did not respond
- openlayers draw矩形
- Openharmony open source developer growth plan, looking for new open source forces that change the world!
- Openlayers 5.0 two centering methods
- JS controls the file type and size when uploading files
- openlayers 5.0 离散聚合点
猜你喜欢

arcMap 发布切片服务

Intuitive understanding of the essence of two-dimensional rotation

Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)

Oracle configuration st_ geometry

MySQL syntax collation (4)

Reflection on the performance of some OpenGL operations in the past

山大网安靶场实验平台项目—个人记录(四)

Oracle配置st_geometry

山大网安靶场实验平台项目-个人记录(五)

MySQL syntax collation (5) -- functions, stored procedures and triggers
随机推荐
Main differences between go and PHP
高效的串口循环Buffer接收处理思路及代码2
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
The platinum library cannot search the debug process records of some projection devices
Openlayers 5.0 discrete aggregation points
【h264】libvlc 老版本的 hevc h264 解析,帧率设定
openlayers 5.0 两种居中方式
How to use go code to compile Pb generated by proto file with protoc Compiler Go file
ArcMap publishing slicing service
视频理解-Video Understanding
Build intelligent garbage classification applet based on Zero
Steps to build a deep learning environment GPU
SQL Server database in clause and exists clause conversion
FFT物理意义: 1024点FFT就是1024个实数,实际进入fft的输入是1024个复数(虚部为0),输出也是1024个复数,有效的数据是前512个复数
openlayers 5.0 热力图
深度分析数据恢复原理——那些数据可以恢复那些不可以数据恢复软件
Translation of audio signal processing and coding: Preface
Strange passion
ESP8266-入门第一篇
openlayers draw矩形