EXAM WITH COMPLETE QUESTIONS AND
CORRECT ANSWERS RATED A+
Which action deletes all rows from a table? Correct Answer
Omitting the WHERE clause from a DELETE statement
How does Table 2 affect the returned results from Table 1 in a left
join? Correct Answer All Table 1 results are returned, regardless
of whether a match is found in Table 2.
Which command functions as a RIGHT JOIN with the roles of the
tables reversed? Correct Answer LEFT JOIN
Refer to the given SQL statement.
SELECT t1.*, t2.* FROM t1 LEFT JOIN t2 ON t1.i1 = t2.i2
What does the LEFT JOIN statement do? Correct Answer It
selects all of the rows in Table 1 and the matching rows in Table
2.
What is the difference between COUNT(*) and COUNT(
col_name) for specified column names? Correct Answer
COUNT(*) counts every row selected, and COUNT(col_name)
counts only non-null values.
Which function determines the total value for a column? Correct
Answer SUM()
How does a row subquery differ from a table subquery? Correct
Answer A row subquery returns a single row of one or more
values.
, Refer to the given SQL statement.1.
SELECT SPNAME2.
FROM SALESPERSON3.
WHERE SPNUM=4.
FROM CUSTOMER5.
WHERE CUSTNUM=20900);
What is missing from the subquery at the beginning of line 4?
Correct Answer (SELECT SPNUM
What is the purpose of using a SELECT statement? Correct
Answer To retrieve data
Which SQL statement retrieves all of the columns from the
Owners table? Correct Answer SELECT * FROM Owners;
Which SQL statement tallies the number of different cities in
which record companies have been founded? Correct Answer
SELECT COUNT(DISTINCT city) FROM recordcompany;
Which task does ORDER BY perform by default? Correct Answer
Sorting rows in ascending order
A database administrator of a movie rental company needs to
compile a list of movies released each year for a marketing
campaign.
Which SQL command will accomplish this? Correct Answer
SELECT YEAR, TITLE FROM MOVIE GROUP BY YEAR;
What is Structured Query Language (SQL)? Correct Answer A
high-level computer language for storing, manipulating, and
retrieving data in a relational database