Question: 1. There are multiple errors in the below SQL; correct them and write a workable SQL. SELECT CustomerNum, CustomerName, RepNum, LastName, FirstName FROM Customer Rep
1. There are multiple errors in the below SQL; correct them and write a workable SQL.
SELECT CustomerNum, CustomerName, RepNum, LastName, FirstName
FROM Customer Rep
WHERE RepNum = RepNum
CreditLimit = 10000
ORDERBY CustamerNum;
2. Write an alternate SQL query by joining both OrderLine and Part tables for the below SQL one with SubQuery.
SELECT OrderNum
FROM OrderLine
WHERE Partnum IN (
SELECT PartNum
FROM Part
WHERE warehouse = '3');
3. In the below SQL, CreditLimit IN (7500, 10000, 15000) indicates one of the following.
SELECT CustomerNum,
CustomerName,
CreditLimit
FROM Customer
WHERE CreditLimit IN (7500, 10000, 15000);
CreditLimit = 7500 AND CreditLimit = 10000 AND CreditLimit = 15000
CreditLimit = 7500 OR CreditLimit = 10000 OR CreditLimit = 15000
CreditLimit = 7500 AND CreditLimit = 10000 OR CreditLimit = 15000
None of the above
4. All the simple conditions must be true for the compound condition to be true. These simple conditions are connected using the operator.
OR
AND
NOT
None of the above
5. The order of columns and order of rows are immaterial in any table.
True
False
6. ____________ are listed in the SELECT clause, ____________ are listed in the FROM clause, and ____________ are listed in the WHERE clause.
Conditions
Fields
Tables
7. Grouping is accomplished in SQL by using the __________ clause.
ORDER BY
HAVIING
GROUP BY
One of the above
8. How do you qualify the name of a field in an SQL query? When is it necessary to do so?
9. How do you sort data in SQL? When there is more than one sort key, how do you indicate which one is the major sort key? How do you sort data in descending order?
10. How do you take the union of two tables in SQL? What criteria must the tables meet to make a union possible?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
