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 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started