Demo entry 6470385

sql

   

Submitted by anonymous on May 28, 2017 at 18:37
Language: SQL. Code size: 822 Bytes.

use STUD;
Create table dep (
	depid varchar(8) primary key,
    depname varchar(20) Not null) charset=utf8;
    
Create table teacher (
	tid varchar(8) primary key,
    tname varchar(8) Not null,
    title varchar(10),
    depid varchar(20)) charset=utf8;
    
Create table student (
	sid varchar(11) primary key,
    sname varchar(8) Not null,
    sex char Not null,
    depid varchar(20),
    birthd Date,
    semail varchar(20),
    homeaddr varchar(40)) charset=utf8;
    
Create table course (
	cid varchar(8) primary key,
    cname varchar(30) Not null,
    cid_pre varchar(8),
    credits numeric(3,1) Not null) charset=utf8;
    
Create table sc ( 
	cid varchar(8) Not null,
	sid varchar(11) Not null,
    tid varchar(8) Not null,
    score integer,
    primary key(cid, sid));
    

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).