```sql
/* SQLyog Community v13.1.6 (64 bit) MySQL - 8.0.32 : Database - studb ********************************************************************* *//*!40101 SET NAMES utf8 */;
/!40101 SET SQL_MODE=''/;
/!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 /;
/!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 /;
/!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' /;
/!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 /;
CREATE DATABASE /!32312 IF NOT EXISTS/studb
/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci / /!80016 DEFAULT ENCRYPTION='N' */;USE
studb
;/*Table structure for table
course
*/DROP TABLE IF EXISTS
course
;CREATE TABLE
course
(
课程编号
char(4) NOT NULL,
课程名称
varchar(50) DEFAULT NULL,
学分
int DEFAULT NULL,
PRIMARY KEY (课程编号
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;/*Data for the table
course
*/insert into
course
(课程编号
,课程名称
,学分
) values
('0001','程序设计方法学',2),
('0002','C语言程序设计',2),
('0003','数据库原理急应用',2),
('0004','大学英语',4),
('0005','高扥数学',4),
('0006','操作系统',2),
('0007','数据结构',3),
('0008','软件工程',3);/*Table structure for table
grade
*/DROP TABLE IF EXISTS
grade
;CREATE TABLE
grade
(
学号
char(4) NOT NULL,
课程编号
char(4) NOT NULL,
分数
int DEFAULT NULL,
PRIMARY KEY (学号
,课程编号
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;/*Data for the table
grade
*/insert into
grade
(学号
,课程编号
,分数
) values
('0001','0001',80),
('0001','0002',91),
('0001','0003',88),
('0001','0004',85),
('0001','0005',77),
('0001','0006',73),
('0001','0007',68),
('0001','0008',80),
('0002','0001',79),
('0002','0002',73),
('0002','0003',84),
('0002','0004',92),
('0002','0005',81),
('0002','0006',82),
('0002','0007',75),
('0002','0008',85);/*Table structure for table
student
*/DROP TABLE IF EXISTS
student
;CREATE TABLE
student
(
学号
char(4) NOT NULL,
姓名
char(8) NOT NULL,
行不
char(2) DEFAULT NULL,
年龄
int DEFAULT NULL,
家庭住址
varchar(50) DEFAULT NULL,
备注
varchar(50) DEFAULT NULL,
PRIMARY KEY (学号
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;/*Data for the table
student
*/insert into
student
(学号
,姓名
,行不
,年龄
,家庭住址
,备注
) values
('0001','张三','男',20,'冬粉路11号',NULL),
('0002','李四','男',20,'八一路33号',NULL),
('0003','完美','女',19,'解放路76号',NULL),
('0004','流动','男',19,'太白路76号',NULL),
('0005','孙涛','男',20,'解放路27号',NULL),
('0006','生猛','男',18,'烟台路27号',NULL),
('0007','天灵','女',19,'科技路18号',NULL);/*!40101 SET SQL_MODE=@OLD_SQL_MODE /;
/!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS /;
/!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS /;
/!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
```
标签:SET,0001,0002,DEFAULT,数据库,SQL,NULL,实验课 From: https://www.cnblogs.com/SaberZHT/p/17326175.html