zoukankan      html  css  js  c++  java
  • 数据库建表

    学生表

    Student(Sno,Sname,Sage,Ssex)学生表
    Sno:学号
    Sname:学生姓名
    Sage:学生年龄
    Ssex:学生性别

     create table Student
    (
     Sno INT not null PRIMARY key,
     Sname VARCHAR(20) not null,
     Sage VARCHAR(20) not null,
     Ssex VARCHAR(20) not null
    );

    课程表

    Course(Cno,Cname,Tno)课程表
    Cno:课程编号
    Cname:课程名称
    Tno:教师编号

     create table Course(
     Cno VARCHAR(20) not null PRIMARY key,
     Cname VARCHAR(20) not null,
     Tno VARCHAR(20) not null,
     foreign key(Tno) references Teacher(Tno) on delete cascade on update cascade
    ); 

    成绩表

    SC(Sno,Cno,score)成绩表
    Sno:学号
    Cno:课程编号
    score:成绩

    create table SC(
    Sno int not null,
    Cno VARCHAR(20) not null,
    score VARCHAR(10) not null,
    foreign key(Sno) references Student(Sno) on delete cascade on update cascade,
    foreign key(Cno) references Course(Cno) on delete cascade on update cascade
    );

    教师表

    Teacher(Tno,Tname)教师表
    Tno:教师编号:
    Tname:教师名字

     create table Teacher(
     Tno VARCHAR(20) not null PRIMARY key,
     Tname VARCHAR(20) not null
    );  
  • 相关阅读:
    SSM:Spring整合SpringMVC框架
    SSM:搭建整合环境
    SpringMVC:常用注解
    SpringMVC的入门案例
    base64
    windows设置exe开机自启动
    Python-wmi模块
    Base64String转为图片并保存
    java给图片添加水印图片
    uni-app中封装axios请求
  • 原文地址:https://www.cnblogs.com/fulucky/p/8126116.html
Copyright © 2011-2022 走看看