2023 Database used in the Assignment You will be using the following tables in the exam drop | Assignment Collections

Computer Science 2023 A+ Answers

2023 Database used in the Assignment You will be using the following tables in the exam drop | Assignment Collections

Database used in the Assignment:

You will be using the following tables in the exam.

 

drop table grades;

drop table student;

drop table teacher;

drop table class;

 

create table student(

sid integer,  — student ID

sname varchar(50), — student name

primary key (sid));

 

create table teacher(

tid integer, — teacher ID

tname varchar(50),  —- teacher name

primary key (tid));

 

create table class(

cid integer, — class ID

cname varchar(50),— class name

year integer, — year of class

semester varchar(10), — fall or spring

credit integer, — number of credit

tid integer, — teacher id

primary key (cid),

foreign key (tid) references teacher(tid));

 

create table grades(

sid integer, — student ID

cid integer, — product ID

grade integer, — grade: 4.0:A, 3: B, 2: C, 1:D, 0:F

primary key (sid, cid),

foreign key (sid) references student(sid),

foreign key (cid) references class(cid));

 

insert into student values (1, ‘John’);

insert into student values (2, ‘Alice’);

insert into student values (3, ‘Bob’);

insert into student values (4, ‘Cathy’);

insert into student values (5, ‘Jeff’);

 

insert into teacher values (1, ‘Dr. Chen’);

insert into teacher values (2, ‘Dr. Smith’);

 

insert into class values(1,’IS 633′, 2015, ‘fall’, 3,1);

insert into class values(2,’IS 633′, 2014, ‘fall’, 3,1);

insert into class values(3,’IS 603′, 2015, ‘fall’, 3,2);

insert into class values(4,’IS 603′, 2015, ‘spring’, 3,2);

insert into grades values(1,1,4);

insert into grades values(2,1,3);

insert into grades values(4,1,2);

 

insert into grades values(3,2,3);

insert into grades values(5,2,4);

 

insert into grades values(1,3,4);

insert into grades values(5,3,3);

 

insert into grades values(2,4,3);

insert into grades values(3,4,2);

insert into grades values(4,4,4);

 

 

Problem 1: Please write ONE SQL statement to implement each of the following tasks.
[40 points, 5 points for each task]

 

Task 1: Return names of classes offered in fall 2015.

 

Task 2: Return names of classes taught by Dr. Chen in fall 2015.

Task 3: Return the total number of courses offered in spring 2015.

Task 4: Return the number of courses taught by each teacher in the year 2015. Please return tid in the result.

Task 5: Return the tid of teachers who have taught at least 2 courses in 2015.

Task 6: Return the names of students who is taking IS 633 in fall 2015.

Task 7: Return the number of students enrolled in each class. Please include class name, semester, and year in the result.

 

Task 8: Return the classes with at least 3 students enrolled. Please include name of class, semester, and year in the result.

Problem 2: [15 points] Please write a PL/SQL program to compute the sum of even numbers 2, 4, 6, 8, …, 100.

Problem 3: [20 points] Please write an anonymous PL/SQL program to print out the grade of John in IS 633. Please use implicit cursor and handle exception. You will lose 10 points if you do not use anonymous PL/SQL program. You also cannot hard code student ID and class ID (i.e., your program should work regardless of the rows in the database).

 

 

Pblem 4: [25 points] Please write an anonymous PL/SQL program to print out the GPA of John. You will lose 15 points if you do not use anonymous PL/SQL program. You also cannot hard code student ID (i.e., your program should work regardless of the rows in the database).

 

Hint: GPA = sum of (grade of John in each class * credit of that class) / sum of credit of classes taken by John

 

 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational