Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 4 SQL (24 points, 8 points each) The following three tables contain the information of students, departments, and studentdepartment relationships. The primary key of

image text in transcribedimage text in transcribed

Problem 4 SQL (24 points, 8 points each) The following three tables contain the information of students, departments, and studentdepartment relationships. The primary key of each table is underlined. For each query, write the output and provide a brief description of the query. (1) SELECT s.sname, d.dname, sd.startdate FROM Student s, Student_Department sd, Department d WHERE s.sid = sd.sid and d.did = sd.did (2) SELECT did, dname FROM Department WHERE did NOT IN (SELECT did FROM Student_Department GROUP BY did HAVING COUNT ()>1 ) (3) SELECT s.sname, s.gpa, d.dname FROM Student s, Student_Department sd, Department d WHERE s.sid = sd.sid AND d.did = sd.did AND s.gpa =( SELECT MIN (gpa) FROM Student)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

true or false? all cells are specialized to have the same function?

Answered: 1 week ago

Question

What tools might be helpful?

Answered: 1 week ago