Course Solutions Uncategorized (Solved) : Create Table Student Id Varchar 5 Name Varchar 20 Null Deptname Varchar 20 Totcred Numeric Q28095579 . . . .

(Solved) : Create Table Student Id Varchar 5 Name Varchar 20 Null Deptname Varchar 20 Totcred Numeric Q28095579 . . . .

 

create table student

(ID varchar(5),

name varchar(20) not null,

dept_name varchar(20),

tot_cred numeric(3,0) check (tot_cred >= 0),

primary key (ID),

foreign key (dept_name) references department

on delete set null

);

create table takes

(ID varchar(5),

course_id varchar(8),

sec_id varchar(8),

semester varchar(6),

year numeric(4,0),

grade varchar(2),

primary key (ID, course_id, sec_id, semester, year),

foreign key (course_id,sec_id, semester, year) referencessection

on delete cascade,

foreign key (ID) references student

on delete cascade

);

SQL

Which student (by ID) has received the most grades of “A” or”A-“?
— Give a single output line with the student’s ID, name, and thecount.

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post