Quiz 2 Flashcards

1
Q

All the entries in the column of a table must come from the same domain - i.e., have the same type. (T/F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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)

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The projection operation operator may be used to extract certain columns from a database table and display their contents to the user. (T/F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SQL can be used to perform updates to database tables as well as carry out ‘read only’ queries. (T/F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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)

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

It is [possible] for the result returned by a SELECT query to be just a single number. (T/F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

[Any] two relations - irrespective of their schema - can be combined using the union operator. (T/F)

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The result of an UPDATE SQL query returns set of two rows updated by the query. (T/F)

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The [difference] of two relations is a third relation containing the tuples that appear in the second but not the first relation. (T/F)

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The [Cartesian product] of two relations is the concentration of every tuple of one relation with every tuple of the second relation. (T/F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

[Selection] is an operation is a combination of the product, selection, and optionally the projection operations. (T/F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The [join] operation in a combination of the product, selection, and optionally the projection operations. (T/F)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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)

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A SELECT SQL query can read from only one table. (T/F)

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

b. DISTINCT

17
Q

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

18
Q

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

19
Q

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

20
Q

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

21
Q

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

A

d. SELECT * FROM EMPLOYEE WHERE Name Like ‘S%’