Question & Answer: Consider the following database and answer the questions below. a) Write the SQL statement the displays the names of the students who hav…..

2 Consider the following database and answer the questions below. SPORT COURSE 700-COMP2031 A. 7007 |COMP2061 At 7007 COMP302 A+ 1313 1313 5050 Basketbal Structures 007 COMP442 1313 COMP203 + 1313 COMP302 B+ 5050 COMP203 C 1313 COMP442 Oatabase Systems 1313 7007 007 Write the SOL statement the displays the names of the students who have enrolled in the Database Systems course a) b) Write the SQL statement that displays a list of the students whose names start with S c) Write the SQL statement that displays the Student ID, Student Name, Course ID, and Grade for students that passed at least one course with a grade better than B+ (i.e. A-, A, and A+) Write the SQL statement that displays the total number of credit hours for the courses enrolled in by the student with ID 1313. d)

Consider the following database and answer the questions below. a) Write the SQL statement the displays the names of the students who have enrolled in the Database Systems course b) Write the SQL statement that displays a list of the students whose names start with ‘S’ c) Write the SQL statement that displays the Student ID, Student Name, Course ID, and Grade for students that passed at least one course with a grade better than B+ (i.e. A-, A, and A+) d) Write the SQL statement that displays the total number of credit hours for the courses enrolled in by the student with ID 1313.

Expert Answer

 

Hi,

Please find below the queries for the question-

Ans a) SELECT ST_NAME FROM STUDENT S JOIN
ENROLLMENT E ON S.ST_ID=E.ST_ID
JOIN COURSE C
ON E.COURSE_ID=C.COURSE_ID
AND COURSE_TITLE=’Database Systems’;

Ans b) SELECT ST_NAME FROM STUDENT WHERE SUBSTR(ST_NAME,1,1)=’S’;

Ans c) SELECT S.ST_ID, ST_NAME,C.COURSE_ID,E.GRADE
FROM STUDENT S JOIN
ENROLLMENT E ON S.ST_ID=E.ST_ID
JOIN COURSE C
ON E.COURSE_ID=C.COURSE_ID
AND E.GRADE IN(‘A-‘,’A’,’A+’);

Ans d) SELECT S.ST_ID, SUM(CREDIT_HR) AS TOTAL_CREDIT_HOURS
FROM STUDENT S JOIN
ENROLLMENT E ON S.ST_ID=E.ST_ID
JOIN COURSE C
ON E.COURSE_ID=C.COURSE_ID
AND S.ST_ID=’1313′

Still stressed from student homework?
Get quality assistance from academic writers!