Question: Single-select QuestionImagine you have the database (relational schema) shown below with 5 tables, a table for Department, a table for Employee and a table for

Single-select QuestionImagine you have the database (relational schema) shown below with 5 tables, a table for Department, a table for Employee and a table for Customer. Salesman is a type of Employee. Subscription is a service that a Customer can pay for.

department (dptno CHAR(3), dptname CHAR(20), dptphone CHAR(15))

employee (eid CHAR(4), name CHAR(20), joindate DATE, dptnoFK CHAR(3))

customer (cid CHAR(6), cname VARCHAR(20), email VARCHAR(30), acquired INTEGER, dptnoFK CHAR(3), salesmanidFK CHAR(4))

subscription (subid CHAR(3), subname VARCHAR(20), desc VARCHAR(100))

subcustomer (cidFK CHAR(6), subidFK CHAR(3), startdate DATE)

Which is the correct SQL code to list the names of those subscriptions who have more than 250 customers.

A.

Select subname from subscription group by subid having count(cid) > 250

B.

Select subname from subscription where subid from subcustomer group by subid having count(cid) > 250)

C.

Select subname count(cid) from subscription where count(cid) > 250)

D.

Select subname from subscription where subid IN (select subid from subcustomer group by subid having count(cid) > 250)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!