1 Star 0 Fork 0

huhuiyu/teach_sql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
crud_link.sql 2.79 KB
一键复制 编辑 原始数据 按行查看 历史
huhuiyu 提交于 2024-05-07 11:15 . 关联表crud
-- 关联表的增删改查 ==================================================================================
-- 软件分类 ==================================================================================
drop table if exists tb_software_type;
create table tb_software_type
(
stid integer auto_increment primary key not null comment '主键',
tname varchar(50) unique not null comment '分类名称',
intro varchar(255) not null comment '分类简介'
)comment '软件分类信息表';
select * from tb_software_type;
-- 软件信息 ==================================================================================
drop table if exists tb_software;
create table tb_software
(
sid integer auto_increment primary key not null comment '主键',
stid integer not null comment '所属分类',
sname varchar(50) not null comment '软件名称',
intro varchar(255) not null comment '软件简介',
vendor varchar(50) not null comment '软件厂商'
)comment '软件信息表';
select * from tb_software;
-- 游戏发行商 ==================================================================================
drop table if exists tb_game_publisher;
create table tb_game_publisher
(
gpid integer auto_increment primary key not null comment '主键',
publisher varchar(50) unique not null comment '发行商名称',
intro varchar(255) not null comment '发行商简介',
created datetime not null comment '发行商创建时间'
)comment '游戏发行商信息表';
select * from tb_game_publisher;
-- 游戏 ==================================================================================
drop table if exists tb_game;
create table tb_game
(
gid integer auto_increment primary key not null comment '主键',
publisher integer not null comment '发行商',
gname varchar(50) not null comment '游戏名称',
intro varchar(255) not null comment '游戏简介',
created datetime not null comment '游戏发布时间'
)comment '游戏信息表';
select * from tb_game;
-- 电影 ==================================================================================
drop table if exists tb_movie;
create table tb_movie
(
mid integer auto_increment primary key not null comment '主键',
title varchar(50) not null comment '电影名称',
intro varchar(255) not null comment '电影简介'
)comment '电影信息表';
select * from tb_movie;
-- 电影排片 ==================================================================================
drop table if exists tb_movie_scheduling;
create table tb_movie_scheduling
(
msid integer auto_increment primary key not null comment '主键',
mid integer not null comment '电影编号',
hall varchar(50) not null comment '排片大厅名称',
start_time datetime not null comment '放映时间'
)comment '电影排片信息表';
select * from tb_movie_scheduling;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huhuiyu/teach_sql.git
git@gitee.com:huhuiyu/teach_sql.git
huhuiyu
teach_sql
teach_sql
master

搜索帮助