1 Star 0 Fork 0

huhuiyu/teach_sql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
crud.sql 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
huhuiyu 提交于 2024-05-07 11:05 . 单表crud脚本
-- 基本的增删改查
-- 新闻信息表
drop table if exists tb_news;
create table tb_news (
nid int primary key auto_increment comment '编号',
title varchar(255) not null default '' comment '标题',
content text not null comment '内容',
source varchar(255) not null default '' comment '来源',
hits int not null default 0 comment '点击量',
publish_time datetime not null default now() comment '发布时间'
) comment '新闻信息表';
select *
from tb_news;
-- 公告牌信息表 ====================================================================================
drop table if exists tb_billboard;
create table tb_billboard (
bid integer auto_increment primary key not null comment '主键',
username varchar(50) not null comment '公告发布人',
title varchar(255) not null comment '公告标题',
content varchar(4096) not null comment '公告内容',
top_index integer not null default 1000000 comment '置顶索引值',
lastupdate datetime default now() not null comment '公告发布时间'
) comment '公告牌信息表';
select *
from tb_billboard;
-- 足球俱乐部信息表 ====================================================================================
drop table if exists tb_football_club;
-- 足球俱乐部信息表 ====================================================================================
drop table if exists tb_football_club;
create table tb_football_club (
fcid integer auto_increment primary key not null comment '主键',
fcname varchar(50) unique not null comment '球队名称',
league varchar(50) not null comment '所属联赛',
info text not null comment '球队简介',
champions integer not null comment '联赛冠军数量',
cups integer not null comment '杯赛冠军数量',
fans integer not null comment '粉丝数(万)',
goals integer not null comment '进球数记录',
gname varchar(50) not null comment '进球数记录保持者',
created datetime not null comment '俱乐部创建时间'
) comment '足球俱乐部信息表';
select *
from tb_football_club;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huhuiyu/teach_sql.git
git@gitee.com:huhuiyu/teach_sql.git
huhuiyu
teach_sql
teach_sql
master

搜索帮助