欢迎来到IDC91站长网!
解决服务器各种技术问题,加微信uecomzsr

MySQL

当前位置: IDC91 > 数据库 > MySQL

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, '李四');

上一篇:MySQL导入与导出备份详解

栏    目:MySQL

下一篇:MySQL实现显示百分比显示和前百分之几的方法

本文标题:SQL数据库十四种案例介绍

本文地址:https://idc91.com/shujuku/3083.html

广告投放 | 联系我们 | 免责申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

Copyright © 2023 IDC91.COM 版权所有晋ICP备17006296号