Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relational database schema: SALESMAN table [ [ SALESMAN _ ID , NAME,CITY,COMMISSION ] ] ORDERS table [ [ ORD _

Consider the following relational database schema:
SALESMAN
\table[[SALESMAN_ID,NAME,CITY,COMMISSION]]
ORDERS
\table[[ORD_NO,PURCH_AMT,CUSTOMER_ID,SALESMAN_ID]]
Which of the following SQL statements is NOT correct?
a) SELECT SALESMAN_ID AS COL1 FROM SALESMAN WHERE CITY LIKE '%d' UNION
SELECT COMMISSION AS COL2 FROM SALESMAN WHERE SALESMAN_ID >
ALL(5003,5006);
b) SELECT COUNT( NAME) AS COUNT FROM SALESMAN WHERE SALESMAN_ID > ALL
(SELECT SALESMAN_ID FROM ORDERS WHERE PURCH_AMT 2000);
c) SELECT CITY FROM SALESMAN WHERE NAME LIKE '%_a%' LEFT INTERSECT SELECT
CITY FROM SALESMAN WHERE SALESMAN_ID > ALL(5003,5004);
d) None of the above.
Consider the following relational database schema:
SALESMAN
\table[[SALESMAN_ID,NAME,CITY,COMMISSION]]
ORDERS
ORDNOPURCHAMTCUSTOMERIDSALESMANID
Which of the following SQL statements is NOT correct?
a) SELECT DISTINCT ORD_NO FROM SALESMAN S FULL JOIN ORDERS O ON
S.SALESMAN_ID=O.SALESMAN_ID WHERE CITY NOT IN ('New York', 'Paris');
b) SELECT COUNT(DISTINCT NAME) AS COUNT FROM SALESMAN WHERE
SALESMAN_ID > ALL (SELECT SALESMAN_ID FROM ORDERS WHERE PURCH_AMT =
25000);
c) SELECT NAME FROM SALESMAN GROUP BY CITY WHERE 5* COMMISSION=0.75;
d) None of the above.
Consider the following relational database schema:
SALESMAN
\table[[SALESMAN_ID,NAME,CITY,COMMISSION]]
ORDERS
\table[[ORD_NO,PURCH_AMT,CUSTOMER_ID,SALESMAN_ID]]
Which of the following SQL statements is NOT correct?
a) SELECT COUNT(DISTINCT CITY) AS COUNT FROM SALESMAN WHERE
SALESMAN_ID > ANY (SELECT SALESMAN_ID FROM ORDERS WHERE PURCH_AMT >
1983);
b) SELECT CITY, MAX(COMMISSION) AS M FROM SALESMAN WHERE NAME LIKE '%e %'
GROUP BY CITY;
c) SELECT NAME FROM SALESMAN WHERE AVG(COMMISSION)=0.12;
d) None of the above.
Consider the following database state and SQL query result.
Query Result
SALESMAN
ORDERS
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

Explain the various methods of job evaluation

Answered: 1 week ago

Question

Differentiate Personnel Management and Human Resource Management

Answered: 1 week ago

Question

Describe the functions of Human resource management

Answered: 1 week ago

Question

What is the general process for selecting expatriates?

Answered: 1 week ago