insert into student(no,name
, sex,birthday, class)values(101,"李军",'男','1976-02-20',95033);
insert into student(no,name
, sex,birthday, class)values(109,"王芳",'女','1975-02-10',95031);
insert into student(no,name
, sex,birthday, class)values(103,"陆军",'男','1974-06-03',95031);
selectfrom student;-- 查询所有数据
create table course(
cno varchar,
name
varchar(20),
no int(10)
);
show tables;
insert into course(cno,name
,no)values("3-105","计算机导论",825);
insert into course(cno,name
,no)values("3-245","操作系统",804);
insert into course(cno,name
,no)values("6-166","数字电路",856);
insert into course(cno,name
,no)values("9-888","高等数学",831)
);
selectfrom course;
CREATE DATABASE school;-- 创建数据库
use school-- 使用数据库
-- 创建表格
CREATE TABLE score(
sno varchar(20),
cno varchar(20),
degree decimal(4,1)
);
show tables;-- 显示表格
insert into score(sno,cno,degree)values("103","3-245",86);
insert into score(sno,cno,degree)values("105","3-245",75);
insert into score(sno,cno,degree)values("109","3-245",68);
insert into score(sno,cno,degree)values("103","3-105",92);
insert into score(sno,cno,degree)values("105","3-105",88);
insert into score(sno,cno,degree)values("109","3-105",76);
insert into score(sno,cno,degree)values("101","3-105",64);
insert into score(sno,cno,degree)values("107","3-105",91);
insert into score(sno,cno,degree)values("108","3-105",78);
insert into score(sno,cno,degree)values("101","6-166",85);
insert into score(sno,cno,degree)values("107","6-166",79);
insert into score(sno,cno,degree)values("108","6-166",81);
select*from score;
CREATE DATABASE school;-- 创建数据库
use school-- 使用数据库
-- 创建表格
CREATE TABLE teacher(
tno varchar(20),
tname varchar(20),
tsex varchar(20),
tbirthday datetime,
trof varchar(20),
depart varchar(20)
);
show tables;
insert into teacher(tno,tname,tsex,tbirthday,trof,depart)values(804,"李诚",'男',"1958-12-02","副教授","计算机系");
insert into teacher(tno,tname,tsex,tbirthday,trof,depart)values(856,"张旭",'男',"1969-03-12","讲师","电子工程系");
insert into teacher(tno,tname,tsex,tbirthday,trof,depart)values(825,"王萍",'女',"1972-05-05","助教","计算机系");
insert into teacher(tno,tname,tsex,tbirthday,trof,depart)values(831,"刘冰",'女',"1977-08-14","助教","电子工程系");
select*from teacher;