Quiz 2 Flashcards
All the entries in the column of a table must come from the same domain - i.e., have the same type. (T/F)
T
Duplicate rows are permitted in some tables that are part of your database schema - that is, among those these tables that are stored permanently on disk. (T/F)
F
The projection operation operator may be used to extract certain columns from a database table and display their contents to the user. (T/F)
T
SQL can be used to perform updates to database tables as well as carry out ‘read only’ queries. (T/F)
T
Immediately following the SELECT ‘key word’ of a query, the [primary key] values of the rows you wish to extract from a database table must be written. (T/F)
F
It is [possible] for the result returned by a SELECT query to be just a single number. (T/F)
T
[Any] two relations - irrespective of their schema - can be combined using the union operator. (T/F)
F
The result of an UPDATE SQL query returns set of two rows updated by the query. (T/F)
F
The [difference] of two relations is a third relation containing the tuples that appear in the second but not the first relation. (T/F)
F
The [Cartesian product] of two relations is the concentration of every tuple of one relation with every tuple of the second relation. (T/F)
T
[Selection] is an operation is a combination of the product, selection, and optionally the projection operations. (T/F)
T
The [join] operation in a combination of the product, selection, and optionally the projection operations. (T/F)
T
In a [left outer join] of a table A with Table B, rows of a Table A that do not join with any row of table B are also returned. (T/F)
T
A SELECT SQL query can read from only one table. (T/F)
F
You cannot have a “SELECT major, COUNT(*)” as the first part of a SELECT query unless you have a “GROUP BY Major” clause at the end.
T
Which SQL keyword must be used to remove duplicate rows from the result relation (i.e., the “pseudo-table” that comes back from a SELECT query)?
a. DELETE
b. DISTINCT
c. NOT EXISTS
d. UNIQUE
e. KEY
b. DISTINCT
Which SQL keyword precedes the part of the query that indicates the [conditions] using which rows are selected?
a. EXISTS
b. FROM
c. SELECT
d. SET
e. WHERE
e. WHERE
Which SQL keyword precedes the part of the query that specifies the table(s) to be used in the query?
a. EXISTS
b. FROM
c. SELECT
d. SET
e. WHERE
b. FROM
Which SQL keyword is used to combine two [conditions] that both must be true for the rows to be selected?
a. AND
b. EXISTS
c. HAVING
d. IN
e. OR
a. AND
Which keyword is used to determine if a column value is an element of a [set] of values (e.g., (‘a’, ‘b’, ‘c’))?
a. AND
b. EXISTS
c. HAVING
d. IN
e. FROM
d. IN
Given a relation with the structure: EMPLOYEE (EmpNo, Name, Salary, HireDate), which of the following would find all employees whose name begins with the letter “S” ?
a. SELECT * FROM EMPLOYEE WHERE Name IN [‘S’]
b. SELECT EmpNo FROM EMPLOYEE WHERE Name LIKE ‘S’
c. SELECT * FROM Name WHERE EMPLOYEE STARTS WITH ‘S’
d. SELECT * FROM EMPLOYEE WHERE Name Like ‘S%’
e. None of the above
d. SELECT * FROM EMPLOYEE WHERE Name Like ‘S%’