With SQL, how can you return all the records from a table named “Employees” sorted descending by “Title”?

computer science

Description

Question 1

  1. What will be the result of the following query:

SELECT * FROM InventoryItems WHERE InventoryItemID Between 1 and 10

UNION

SELECT * FROM InventoryItems WHERE InventoryItemID Between 5 and 10

UNION

SELECT * FROM InventoryItems WHERE InventoryItemID Between 10 and 20

a) All rows that have InventoryItemID between 1 and 20

b) All rows that have InventoryItemID between 1 and 20 excluding 1, 5, 10, and 20

c) All rows that have InventoryItemID between 1 and 20 excluding duplicate rows

d) All rows that have InventoryItemID between 5 and 10

 

Question 2

  1. 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 in InventoryItems

c) Returns all ProductID values from InventoryItems that are not in Invoices

d) Returns no row

 

 

 

 

 

 

 

Question 3

  1. 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%’

 

Question 4

  1. 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 DE

 

 

Question 5

  1. What is the result of the following query:

SELECT * FROM InventoryItems WHERE InventoryItemID BETWEEN 1 AND 10

UNION ALL

SELECT * FROM InventoryItems WHERE InventoryItemID BETWEEN 5 AND 15

a) All rows where the values in InventoryItemID are from 5 to 10

b) All rows where the values in InventoryItemID are from1 to 15 excluding duplicates

c) All rows where the values in InventoryItemID are from 1 to 10

d) All rows where the values in InventoryItemID are from 1 to 15

 


Related Questions in computer science category