Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

What are the two formal languages for the relational model?

✗ - SQL and set theory


✗ - SQL and relational calculus
✗ - Relational algebra and SQL
✓ - Relational algebra and relational calculus

Which language is primarily based on concepts from relational calculus?


✗ - Relational model
✗ - Relational algebra
✗ - Set theory
✓ - SQL

What is the main purpose of the relational algebra?


✗ - To perform basic retrieval requests
✗ - To define the structure of relational databases
✓ - To provide a formal foundation for relational model operations, To implement and
optimize queries in relational database management systems

What is the difference between relation and relationship in DBMS?


✗ - Relation and relationship are the same thing
✗ - Relation refers to how two tables are connected together, while relationship refers to a
table
✓ - Relation refers to a table, while relationship refers to how two tables are connected
together
✗ - Relation and relationship are both used to refer to tables

Which operation is used to select a subset of tuples from a relation based on a selection
condition?
✗ - UNION
✗ - PROJECT
✗ - JOIN
✓ - SELECT

What is the result of a SELECT operation?


✓ - A relation with the same schema as the input relation
✗ - A relation with a different schema than the input relation
✗ - A set of attributes from the input relation
✗ - A set of tuples with the same attributes as the input relation
Which operation keeps certain columns from a relation and discards the other columns?
✗ - JOIN
✗ - SELECT
✗ - UNION
✓ - PROJECT

What is the result of a PROJECT operation?


✓ - A relation with a subset of attributes from the input relation
✗ - A set of tuples with the same attributes as the input relation
✗ - A relation with the same attributes as the input relation
✗ - A set of attributes from the input relation

What is the result of a UNION operation?


✗ - A relation that includes only the tuples that are in the second relation
✗ - A relation that includes only the tuples that are in both the first relation and the second
relation
✓ - A relation that includes all tuples that are either in the first relation or in the second
relation or in both
✗ - A relation that includes only the tuples that are in the first relation

What are the conditions for a UNION operation to be valid?


✗ - The two operand relations must have the same number of attributes and the same
attribute domains
✓ - The two operand relations must have the same number of attributes and compatible
attribute domains
✗ - The two operand relations must have the same number of attributes
✗ - The two operand relations must have the same attribute domains

What happens to duplicate tuples in the result of the PROJECT operation?


✗ - They are duplicated in the result
✗ - They are sorted in the result
✓ - They are eliminated
✗ - They are kept in the result

Which operation combines tuples from two relations and eliminates duplicate tuples?
✓ - UNION
✗ - SELECT
✗ - JOIN
✗ - PROJECT
What is the type compatibility requirement for the binary set operation UNION?
✗ - R1(A1, A2, ..., An) and R2(B1, B2, ..., Bn) are type compatible if they have different
number of attributes and the domains of corresponding attributes are type compatible.

✗ - R1(A1, A2, ..., An) and R2(B1, B2, ..., Bn) are type compatible if they have different
number of attributes and the domains of corresponding attributes can be different.

✗ - R1(A1, A2, ..., An) and R2(B1, B2, ..., Bn) are type compatible if they have the same
number of attributes but the domains of corresponding attributes can be different.

✓ - R1(A1, A2, ..., An) and R2(B1, B2, ..., Bn) are type compatible if they have the same
number of attributes and the domains of corresponding attributes are type compatible.

What is the result of the INTERSECTION operation?


✗ - The result of the operation R ∩ S is a relation that includes all tuples that are in R but not
in S.
✓ - The result of the operation R ∩ S is a relation that includes all tuples that are in both R and
S.
✗ - The result of the operation R ∩ S is a relation that includes all tuples that are in S but not in
R.
✗ - The result of the operation R ∩ S is a relation that includes all tuples that are in either R or
S.

What is the syntax of the INTERSECT operator in Microsoft SQL Server?


✗ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN JOIN SELECT
column1, column2,..., columnN FROM table1, table2,..., tableN
✗ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN MINUS SELECT
column1, column2,..., columnN FROM table1, table2,..., tableN
✓ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN INTERSECT
SELECT column1, column2,..., columnN FROM table1, table2,..., tableN
✗ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN UNION SELECT
column1, column2,..., columnN FROM table1, table2,..., tableN

What is the result of the SET DIFFERENCE operation?


✗ - The result of R - S is a relation that includes all tuples that are in both R and S.
✓ - The result of R - S is a relation that includes all tuples that are in R but not in S.
✗ - The result of R - S is a relation that includes all tuples that are in S but not in R.
✗ - The result of R - S is a relation that includes all tuples that are in either R or S.
Which of the following operations are commutative?
✗ - Union, intersection, and set difference
✗ - Union and set difference
✓ - Union and intersection
✗ - Intersection and set difference

Which of the following operations are associative?


✓ - Union and intersection
✗ - Union, intersection, and set difference
✗ - Intersection and set difference
✗ - Union and set difference

Which of the following operations is not commutative?


✓ - Set difference
✗ - Union
✗ - Cartesian product
✗ - Intersection

What is the result of the CARTESIAN PRODUCT operation?


✗ - The result is a relation Q with degree n + m attributes, where Q(A1, A2, ..., An, B1, B2, ...,
Bm), in that order. The resulting relation state has one tuple for each combination of tuples—
either from R or S.

✓ - The result is a relation Q with degree n + m attributes, where Q(A1, A2, ..., An, B1, B2, ...,
Bm), in that order. The resulting relation state has one tuple for each combination of tuples—
one from R and one from S.

✗ - The result is a relation Q with degree n + m attributes, where Q(A1, A2, ..., An, B1, B2, ...,
Bm), in that order. The resulting relation state has one tuple for each combination of tuples—
both from R and S.

✗ - The result is a relation Q with degree n + m attributes, where Q(A1, A2, ..., An, B1, B2, ...,
Bm), in that order. The resulting relation state has one tuple for each combination of tuples—
neither from R nor S.

Is the CARTESIAN PRODUCT operation type compatible?


✗ - Yes, the two operands have to be type compatible.
✗ - No, the two operands have to be type compatible.
✗ - Yes, the two operands do not have to be type compatible.
✓ - No, the two operands do not have to be type compatible.
What is the purpose of the JOIN operation?
✗ - The JOIN operation combines tuples from two relations randomly.
✓ - The JOIN operation combines related tuples from two relations based on a join condition.
✗ - The JOIN operation combines tuples from two relations based on a union condition.
✗ - The JOIN operation combines all tuples from two relations.

What is the type compatibility requirement for the UNION operation?


✗ - The resulting relation has the same attribute names as the first operand relation
✗ - The two operand relations must have the same attribute names
✗ - The two relations must have the same number of attributes
✓ - The domains of corresponding attributes must be type compatible

What is the result of the INTERSECTION operation?


✓ - A relation that includes all tuples that are in both R and S
✗ - A relation that includes all tuples that are in R but not in S
✗ - A relation that includes all tuples that are in S but not in R
✗ - A relation that includes all tuples from both R and S

Which operation is denoted by ∩?


✗ - CARTESIAN PRODUCT
✓ - INTERSECTION
✗ - SET DIFFERENCE
✗ - UNION

What is the syntax of the INTERSECT operator in Microsoft SQL Server?


✗ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN SET
DIFFERENCE SELECT column1, column2,..., columnN FROM table1, table2,..., tableN

✗ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN CARTESIAN


PRODUCT SELECT column1, column2,..., columnN FROM table1, table2,..., tableN

✓ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN INTERSECT


SELECT column1, column2,..., columnN FROM table1, table2,..., tableN

✗ - SELECT column1, column2,..., columnN FROM table1, table2,..., tableN UNION SELECT
column1, column2,..., columnN FROM table1, table2,..., tableN
Which operations are commutative?
✗ - INTERSECTION and SET DIFFERENCE
✓ - UNION and INTERSECTION
✗ - UNION and SET DIFFERENCE
✗ - INTERSECTION and CARTESIAN PRODUCT

Which operation is not commutative?


✓ - SET DIFFERENCE
✗ - CARTESIAN PRODUCT
✗ - UNION
✗ - INTERSECTION

What is the result of the CARTESIAN PRODUCT operation?


✓ - A relation with one tuple for each combination of tuples from two relations
✗ - A relation that includes all tuples that are in the second relation
✗ - A relation that includes all tuples that are in both relations
✗ - A relation that includes all tuples that are in the first relation
What is the type compatibility requirement for the JOIN operation?
✗ - The two operand relations must have the same attribute names
✗ - The domains of corresponding attributes must be type compatible
✗ - The two relations must have the same number of attributes
✓ - There is no type compatibility requirement

What is the general form of a join operation on two relations R and S?


✗-R∩S
✗-R–S
✓ - R <join condition> S
✗-R∪S

You might also like