SQL数据库十四种案例介绍
时间:2022-05-30 13:41:46|栏目:MySQL|点击: 次
数据表
/* Navicat SQLite Data Transfer Source Server : school Source Server Version : 30808 Source Host : :0 Target Server Type : SQLite Target Server Version : 30808 File Encoding : 65001 Date: 2021-12-23 16:06:04 */ PRAGMA foreign_keys = OFF; -- ---------------------------- -- Table structure for Course -- ---------------------------- DROP TABLE IF EXISTS "main"."Course"; CREATE TABLE Course( courseid integer primary key autoincrement, courseme varchar(32), teacherid int ); -- ---------------------------- -- Records of Course -- ---------------------------- INSERT INTO "main"."Course" VALUES (3001, '语文', 1001); INSERT INTO "main"."Course" VALUES (3002, '数学', 1002); -- ---------------------------- -- Table structure for Mark -- ---------------------------- DROP TABLE IF EXISTS "main"."Mark"; CREATE TABLE Mark( userid integer, courseid integer not null, score int default 0 ); -- ---------------------------- -- Records of Mark -- ---------------------------- INSERT INTO "main"."Mark" VALUES (2001, 3001, 89); INSERT INTO "main"."Mark" VALUES (2001, 3002, 90); INSERT INTO "main"."Mark" VALUES (2002, 3001, 66); INSERT INTO "main"."Mark" VALUES (2003, 3002, 85); -- ---------------------------- -- Table structure for sqlite_sequence -- ---------------------------- DROP TABLE IF EXISTS "main"."sqlite_sequence"; CREATE TABLE sqlite_sequence(name,seq); -- ---------------------------- -- Records of sqlite_sequence -- ---------------------------- INSERT INTO "main"."sqlite_sequence" VALUES ('Teacher', 1002); INSERT INTO "main"."sqlite_sequence" VALUES ('Student', 2002); INSERT INTO "main"."sqlite_sequence" VALUES ('Course', 3002); -- ---------------------------- -- Table structure for Student -- ---------------------------- DROP TABLE IF EXISTS "main"."Student"; CREATE TABLE Student( userid integer primary key autoincrement, username varchar(32), userage int, usersex varchar(32) ); -- ---------------------------- -- Records of Student -- ---------------------------- INSERT INTO "main"."Student" VALUES (2001, '小明', 18, '男'); INSERT INTO "main"."Student" VALUES (2002, '小红', 18, '女'); -- ---------------------------- -- Table structure for Teacher -- ---------------------------- DROP TABLE IF EXISTS "main"."Teacher"; CREATE TABLE Teacher( teacherid integer primary key autoincrement, teachername varchar(32) ); -- ---------------------------- -- Records of Teacher -- ---------------------------- INSERT INTO "main"."Teacher" VALUES (1001, '张三'); INSERT INTO "main"."Teacher" VALUES (1002, '李四');
您可能感兴趣的文章
- 05-31MySQL中的 inner join 和 left join的区别解析(小结果集驱动大结果集)
- 05-31MySQL索引失效十种场景与优化方案
- 05-31MYSQL 高级文本查询之regexp_like和REGEXP详解
- 05-31MySQL获取binlog的开始时间和结束时间(最新方法)
- 05-31MySQL索引查询的具体使用
- 05-31基于MySQL和Redis扣减库存的实践
- 05-31关于MySQL的存储过程与存储函数
- 05-31MySQL实战文章(非常全的基础入门类教程)
- 05-31MySQL Flink Watermark实现事件时间处理的关键技术
- 05-31MySQL Flink实时流处理的核心技术之窗口机制
阅读排行
推荐教程
- 05-30Navicat for MySQL 11注册码激活码汇总
- 05-27Mysql误删数据快速恢复
- 05-31VS2022连接数据库MySQL并进行基本的表的操作指南
- 05-30解决seata不能使用mysql8版本的问题方法
- 05-30MYSQL字符集设置的方法详解(终端的字符集)
- 05-30解决MySQL启动报错:ERROR 2003 (HY000): Can't con
- 05-30关于Mysql-connector-java驱动版本问题总结
- 11-22mac下安装mysql忘记密码的修改方法
- 05-30MySQL中的隐藏列的具体查看
- 11-22mysql exists与not exists实例详解