createtable student
(
rollno varchar2(4) primarykeyconstraint chk_rollno check(rollno like'r%'),
name varchar2(30) notnull,
class varchar2(10),
birthdate date
);
createtable course
(
courseno varchar2(4) primarykeyconstraint chk_courseno check(courseno like'c%'),
coursename varchar2(50),
max_marks number(3) constraint chk_max_marks check(max_marks>0),
pass_marks number(3),
constraint chk_pass_marks check(pass_marks>0 and pass_marks<max_marks)
);
createtable sc
(
rollno varchar2(4),
courseno varchar2(4),
marks number(3) constraint chk_marks check(marks>0),
primarykey(rollno,courseno),
foreignkey(rollno) references student(rollno),
foreignkey(courseno) references course(courseno)
);