What will be the result of the following query: SELECT * FROM InventoryItems WHERE InventoryItemID Between 1
Question:
What will be the result of the following query:
SELECT * FROM InventoryItems WHERE InventoryItemID Between 1 and10
UNION
SELECT * FROM InventoryItems WHERE InventoryItemID Between 5 and10
UNION
SELECT * FROM InventoryItems WHERE InventoryItemID Between 10and 20
a) All rows that have InventoryItemID between 1 and 20
b) All rows that have InventoryItemID between 1 and 20 excluding1, 5, 10, and 20
c) All rows that have InventoryItemID between 1 and 20 excludingduplicate rows
d) All rows that have InventoryItemID between 5 and 10
4 points
QUESTION 2
What will be the result of the following query:
SELECT ProductID FROM Invoices | ||
EXCEPT | ||
Select ProductID FROM InventoryItems | ||
a) Returns all ProductID values from both tables | ||
b) Returns all ProductID values from Invoices that are not inInventoryItems | ||
c) Returns all ProductID values from InventoryItems that are notin Invoices | ||
d) Returns no rows |
4 points
QUESTION 3
With SQL, how do you select all the records from a table named“Vendors” where the value of the column “Country” ends with an“a”?
a) SELECT * FROM Vendors WHERE Country =’a’ | ||
b) SELECT * FROM Vendors WHERE Country LIKE ‘a%’ | ||
c) SELECT * FROM Vendors WHERE Country LIKE ‘%a’ | ||
d) SELECT * FROM Vendors WHERE Country =’%a%’ |
4 points
QUESTION 4
With SQL, how can you return all the records from a table named“Employees” sorted descending by “Title”?
a) SELECT * FROM Employees SORT BY ‘Title’ DESC
b) SELECT * FROM Employees ORDER Title DESC
c) SELECT * FROM Employees SORT ‘Title’ DESC
d) SELECT * FROM Employees ORDER BY Title DESC
4 points
QUESTION 5
What is the result of the following query:
SELECT * FROM InventoryItems WHERE InventoryItemID BETWEEN 1 AND10 | ||
UNION ALL | ||
SELECT * FROM InventoryItems WHERE InventoryItemID BETWEEN 5 AND15 | ||
a) All rows where the values in InventoryItemID are from 5 to10 | ||
b) All rows where the values in InventoryItemID are from1 to 15excluding duplicates | ||
c) All rows where the values in InventoryItemID are from 1 to10 | ||
d) All rows where the values in InventoryItemID are from 1 to15 |
4 points
QUESTION 6
SQL query to find every country in a table named “Atlas” whosepopulation is 950,000.
a) SELECT country WHERE population = 950000 | ||
b) SELECT country FROM Atlas WHERE population = 950000 | ||
c) SELECT population = 950000 FROM Atlas | ||
d) SELECT country FROM Atlas WHERE population = 950,000 |
4 points
QUESTION 7
SQL query to find the city, country, and language in a tablename “Atlas” in increasing order of all cities within language.
a) SELECT language, city, country FROM Atlas ORDER BYlanguage | ||
b) SELECT language, city, country FROM Atlas | ||
c) SELECT city, country, language FROM Atlas ORDER BY city,language | ||
d) SELECT city, country, language FROM Atlas ORDER BY language,city |
4 points
QUESTION 8
Which query will return rows from the first Select statementthat are identical to rows in the second select statement
a) SELECT ProductID FROM Invoices UNION SELECT ProductID FROMInventory | ||
b) SELECT ProductID FROM Invoices INTERSECT SELECT ProductIDFROM Inventory | ||
c) SELECT ProductID FROM Invoices EXCEPT SELECT ProductID FROMInventory | ||
d) SELECT ProductID FROM Invoices UNION ALL SELECT ProductIDFROM Inventory |
4 points
QUESTION 9
Which of the following Where clauses will return rows forProductID 3 for SupplierID 4 and 5
a) WHERE SupplierID = 4 AND SupplierID = 5 AND ProductID = 3 | ||
b) WHERE SupplierID = 4 OR SupplierID = 5 AND ProductID = 3 | ||
c) WHERE (SupplierID = 4 OR SupplierID = 5) AND ProductID =3 | ||
d) WHERE SupplierID = 4 OR SupplierID = 5 OR ProductID = 3 |
4 points
QUESTION 10
Find the EmpId, EmpLName and Status in a table named “Employees”whose status is neither contractor nor consultant.
a) SELECT EmpID, EmpLName, Status FROM Employees WHERE statusNOT IN (‘contractor, ‘consultant’) | ||
b) SELECT EmpID, EmpLName, Status FROM Employees WHERE statusNOT BETWEEN (‘contractor, ‘consultant) | ||
c) SELECT EmpID, EmpLName, Status FROM Employees WHERE status IN(‘contractor, ‘consultant) | ||
d) SELECT EmpID, EmpLName, Status FROM Employees WHERE statusBETWEEN (‘contractor, ‘consultant); |
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill