创建以下数据表(表格中内容不要有中文)
用户名(职工号/学号) ID | 密码 Pwd | 职位(教师/学生)Job | 联系方式Tel |
---|---|---|---|
1001 | 默认密码:123456 | teacher | 111111 |
1002 | 123456 | teacher | 222222 |
10003 | 123456 | student | 333333 |
10004 | 123456 | student | 444444 |
10005 | 123456 | studnet | 555555 |
学号ID | 姓名Name | 性别Sex | 年龄Age | 入学日期StudyDate | 专业Major | 班级Class | 家庭地址Address | 联系方式Tel |
---|---|---|---|---|---|---|---|---|
10003 | bob | boy | 19 | 2019 | AI | 1902 | yantai | 333333 |
10004 | pop | girl | 20 | 2020 | NET | 2001 | weifang | 444444 |
10005 | smith | girl | 21 | 2021 | DL | 2101 | jinan | 555555 |
学号ID | 姓名Name | 专业Major | 班级Class | 数学Math | Java | MySQL |
---|---|---|---|---|---|---|
10003 | bob | AI | 1902 | 66 | 77 | 88 |
10004 | pop | NET | 2001 | 77 | 88 | 99 |
10005 | smith | DL | 2101 | 88 | 77 | 66 |
创建Student数据库
Create database StudentDB;
使用数据库
Use StudentDB;
创建登录信息表Login_info
Create table Login_info(ID varchar(10) primary key,
Pwd varchar(10) default 123456,
Job varchar(10) not null,
Tel varchar(11) not null);
插入数据
Insert into Login_info(ID,Job,Tel)
values(“1001”,”teacher”,”111111”),(“1002”,”teacher”,”222222”),(“10003”,”student”,”333333”),(“10004”,”student”,”444444”),(“10005”,”student”,”555555”);
创建学生信息表Student_info
Create table Student_info(ID varchar(10) primary key,
Name varchar(10) not null,
Sex varchar(10) not null,
Age int not null,
StudyDate Date not null,
Major varchar(10) not null,
Class int not null,
Address varchar(15),
Tel varchar(11) not null);
插入数据
Insert into Student_info Values(”10003”,”bob”,”boy”,19,20190901,”AI”,1902,”yantai”,”333333”),(“10004”,”pop”,”girl”,20,”20200901”,”NET”,2001,”weifang”,”444444”),(“10005”,”smith”,”girl”,21,”20210901”,”DL”,2101,”jinan”,”555555”);
创建学生成绩表Student_score
Create table Student_score(ID varchar(10) primary key,
Name varchar(10) not null,
Major varchar(10) not null,
Class int not null,
Math varchar(10) not null,
Java varchar(10) not null,
MySQL varchar(10) not null);
插入数据
Insert into Student_score
Values(“10003”,”bob”,”AI”,1902,”66”,”77”,”88”),(“10004”,”pop”,”NET”,2001,”77”,”88”,”99”),(“10005”,”smith”,”DL”,2101,”88”,”77”,”66”);
根据表格内容自行对数据库中表格内容进行插入;
代码下载