MIS 3353 - Single-Table SQL
Which aggregate function would you use (in the SELECT clause) if you wanted to know the total number of magicians in the Magician table who are from Albuquerque? - SUM - COUNT - MAX - TOTAL
COUNT
Let's assume that you wrote a query that has the following four clauses: SELECT, FROM, WHERE, ORDER BY. The order in which the four SQL query clauses are executed is _____ _____ _____ _____. (separate your answers by commas.) - Fill in the Blank
FROM, WHERE, SELECT, ORDER BY
* in an SQL SELECT statement means: - List all columns - 0 or more characters - Many - Exactly 1 character
List all columns
To override precedence of AND, OR, and NOT, use: - Precedence cannot be overridden - Parentheses - Curly brackets - Square brackets
Parentheses
Assuming that the table and fields referenced are valid, which of the following queries have appropriate syntax and would work without error? - SELECT PlayerName, Gender, Position WHERE Position = 'Seeker' SORT BY PlayerName ASC; - SELECT PlayerName, Hometown FROM Roster WHERE Hometown IS 'Pittsburgh' - SELECT PlayerNumber, PlayerName, Weight WHERE Weight > 100 FROM Roster; - SELECT PlayerName, Position, Height FROM Roster WHERE Height > 63 ORDER BY Position;
SELECT PlayerName, Position, Height FROM Roster WHERE Height > 63 ORDER BY Position;
Which of the following is not a clause in a SELECT query? - GROUP BY - WHERE - SORT BY - SELECT
SORT BY
Which of the following WHERE clauses would include only those records in the output where the value in the Destination field is something OTHER than Norman? - WHERE Destination <> 'Norman' - WHERE Destination NOT 'Norman' - WHERE Destination =/= 'Norman' - WHERE Destination != 'Norman'
WHERE Destination <> 'Norman'
Which of the following WHERE clauses would include only those records from the Customer table where the customer's last name (the LastName field) starts with Y and the customer's birthday (DOB field) falls some time after 1994? - WHERE LastName STARTS WITH 'Y' AND DOB >= '1/1/1994' - WHERE (LastName IS 'Y%') AND (DOB >= '1994-01-01') - WHERE LastName LIKE 'Y' AND DOB > 1994-12-31 - WHERE LastName LIKE 'Y%' AND DOB > '1994-12-31'
WHERE LastName LIKE 'Y%' AND DOB > '1994-12-31'
Which of the following WHERE clauses would include only those records in the output for which the value of UniformNumber is 1, 3, 5, or 7? - WHERE UniformNumber NOT IN (2, 4, 6, 8) - WHERE UniformNumber IN (1, 3, 5, 7) - WHERE UniformNumber = 1, 3, 5, 7 - WHERE UniformNumber < 8
WHERE UniformNumber IN (1, 3, 5, 7)
Using a database that includes information about every opera ever written, I want to write a query that displays information only about those operas that were written prior to the year 1825. To do this, I would use which of the following? - SORT BY clause - HAVING clause - WHERE clause - @ operator
WHERE clause