Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE Dep
- (Deptno NUMBER(2) PRIMARY KEY,
- Dname VARCHAR2(30) UNIQUE CHECK (Dname = UPPER(Dname)) NOT NULL);
- CREATE TABLE Etudiant
- (Stdno NUMBER(8) PRIMARY KEY,
- Sname VARCHAR2(30),
- Deptno NUMBER(2),
- CONSTRAINT fk_dep FOREIGN KEY (Deptno)
- REFERENCES Dep(Deptno));
- CREATE TABLE cours
- (coursno NUMBER(3) PRIMARY KEY ,
- cname VARCHAR2(20) ,
- cmax NUMBER(2) ,
- deptno NUMBER(2) ,
- CONSTRAINT fk_cours foreign KEY (deptno)
- references dep(deptno));
- CREATE TABLE Inscription
- (Stdno NUMBER(8) references Etudiant(Stdno),
- coursno NUMBER(3) references cours(coursno),
- grade NUMBER(2),
- CONSTRAINT pk_inscri PRIMARY KEY (Stdno, coursno));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement