SQL练习( 一)

创建数据库:create database Teach;

创建数据表:

学生表create table student (sn INT, name VARCHAR(20), age INT, sex CHAR(2));

课程表create table course(cn int,name varchar(20),tn int);

成绩表create table sc(sn int,cn int,score int);

教师表create table teacher(tn int,name varchar(20));

添加数据:

学生表insert into student values(1,"sa",19,"m");

课程表insert into course values(3,"ca",1);

成绩表insert into sc values(6,2,88);

教师表insert into teacher values(1,"ta");

推荐阅读更多精彩内容