Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the following tables, identify a relation scheme for each table and create

ID: 3763924 • Letter: G

Question

Given the following tables, identify a relation scheme for each table and create all of them in Microsoft SQL Server. (30 points) Student Table SID NAME YEAR MAJOR GPA 1111 Smith Senior CS 3.51 2222 Jones Freshman IT 4.00 3333 Jacks Junior CS 2.75 4444 Johns Senior CS 3.12 Course Table COURSEID CNAME CREDITS 1111 Reading 1 2222 Counting 1 3333 Drawing 3 4444 Swimming 3 5555 Physics 3 6666 Database 3 7777 Hacking 3 8888 Emailing 3 9999 Internship 1 Enrollment Table SID COURSE1 COURSE2 COURSE3 COURSE4 1111 9999 null null null 2222 1111 2222 3333 4444 3333 6666 7777 8888 null 4444 8888 9999 null null

Explanation / Answer

STUDENT TABLE:

create table Student3(SID INTEGER(10),NAME CHAR(20),YEAR char(10),MAJOR CHAR(10),GPA DECIMAL(8,1));

INSERT INTO Student3 values(1111,"Smith","Senior","CS",3.51);

INSERT INTO Student3 values(2222,"Jones","Freshman","IT",4.00);

INSERT INTO Student3 values(3333,"Jacks","Junior","CS",2.74);

INSERT INTO Student3 values(4444,"Johns","Senior","CS",3.12);

        

select * from Student3

COURSE TABLE:

create table COURSE(COURSEID INTEGER(10),CNAME CHAR(20),CREDITS INTEGER(10));

INSERT INTO COURSE values(1111,"Reading",1);

INSERT INTO COURSE values(2222,"Counting",1);

INSERT INTO COURSE values(3333,"Drawing",3);

INSERT INTO COURSE values(4444,"Swimming",3);

INSERT INTO COURSE values(5555,"Physics",3);

INSERT INTO COURSE values(6666,"Database",3);

INSERT INTO COURSE values(7777,"Hacking",3);

INSERT INTO COURSE values(8888,"Emailing",3);

INSERT INTO COURSE values(9999,"Internship",1);

select * from COURSE

ENROLLMENT TABLE:

create table ENROLLMENT(COURSE1 INTEGER(10),COURSE2 INTEGER(10),COURSE3 INTEGER(10),COURSE4 INTEGER(10));
INSERT INTO ENROLLMENT values(1111,9999,NULL,NULL);
INSERT INTO ENROLLMENT values(NULL,2222,1111,2222);
INSERT INTO ENROLLMENT values(3333,4444,3333,6666);
INSERT INTO ENROLLMENT values(7777,8888,NULL,4444);
INSERT INTO ENROLLMENT values(8888,9999,NULL,NULL);
select * from ENROLLMENT

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote