Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 all customers whose sales was made by an employee whose name begins with J.

A.

Select cname LIKEJ%from customer group by dptno

B.

Select cname from customer where salesmanid LIKEJ%

C.

Select cname from customer where salesmanid IN (select cid from customer where cname LIKEJ%)

D.

Select cname from customer where salesmanid IN (select eid from employee where name LIKEJ%)

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 Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

=+ a. a family deciding whether to buy a new car

Answered: 1 week ago

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago