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

MySQL Can somebody show me how to solve this problem in MySQL? 1 . Given the que

ID: 3754044 • Letter: M

Question

MySQL

Can somebody show me how to solve this problem in MySQL?

1. Given the query, "The course names which are taken by the students living at Whitney,"

a. Write a SQL statement.

b. Define a view for "the students living at Whitney," and rephrase (a) by using the view.

c. Show how the systems catalog stores the view definition.

Sorry, here is the table schema

CNAME 21 Computer Science 17 Chemist 15 PhysicS 12 Mathematics l 13 Mathematics III RESULT CNO CNO STUDENT SNO SNAME ADDRESS SEX SCORE 31 L. Gatlin Holcomb F 11 N. Park Whitney M 22 S. Conner: Holcomb F 24 D. Davissc E. Quad M 19 1. Blake Holcomb M 4 T. Smith Cambridg F SNO 2 2 2 2 2 2 31 14 2 63 4 Histo 3 Geography 2 Biology 72 1 N. J. Sloan Whitney F 14 D. E. Knutl Whitney M 6 J. Brown Whitney 2 M. Robert Cambridg M 14 33 U. Smith Cambridg F 14 37 2 13 13 13 13 97 72 11 NULL 14 61 52 63

Explanation / Answer

a.

Select CNAME from COURSE inner join RESULT on COURSE.CNO = RESULT.CNO inner join STUDENT on RESULT.SNO = STUDENT.SNO where ADDRESS = 'Whitney';

b.

Create view CourseOfStudentOfWhitney as Select CNAME from COURSE inner join RESULT on COURSE.CNO = RESULT.CNO inner join STUDENT on RESULT.SNO = STUDENT.SNO where ADDRESS = 'Whitney';

c.

Select * from CourseOfStudentOfWhitney;

Do ask if any doubt. Please upvote.