Basic SQL
CS340 · Chapter 6
1
SQL as a declarative language, SELECT–FROM–WHERE with projection and selection, duplicates and DISTINCT, renaming, LIKE patterns, arithmetic, BETWEEN, ORDER BY, the set operators UNION / INTERSECT / EXCEPT, and INSERT, DELETE and UPDATE.
In SQL, rows are filtered in the:
Correct: WHERE clause.
SELECT removes duplicate rows by default.
False. Use DISTINCT.
WHERE name LIKE '_a%' matches names whose:
Correct: Second letter is a.
rating BETWEEN 5 AND 7 includes ratings 5 and 7.
True.
Sailors who reserved a red boat but NOT a green boat:
Correct: Red query EXCEPT green query.
Asked in a real exam
Give every employee in department 5 a 10% raise:
Correct: UPDATE EMPLOYEE SET Salary = Salary * 1.1 WHERE Dno = 5;.
No slides match this filter.