What is a primary key?

What is a primary key? 




a. A primary key is the field(s) in a table that uniquely defines that table in a database
b. A primary key is the field(s) in a table that is used to establishes a relationship between two tables
c. A primary key is the field(s) in a table that uniquely defines the row in the table
d. A primary key is the field(s) in a table that is used to establishes a relationship between two databases




Answer: C

"R(A,B,C,D)" is an example of:

"R(A,B,C,D)" is an example of: 



a. A schema
b. A relation
c. A relation instance
d. A schema instance




Answer: A

Which of the followings is part of data model?

Which of the followings is part of data model? 





a. Structure of the data
b. Operations on the data
c. Constraints on the data
d. All of the others

Answer: D

Data Definition language (DDL) is used to ......

Data Definition language (DDL) is used to ...... 




a. query database and modify the database
b. connect to database and query database
c. declare database schemas
d. All of the others



Answer: C

Today, the two important data models are:

Today, the two important data models are: 





a. The semi-structured data model (including XML and related standards) and the network data model
b. The relational data model (including object-relational extensions) and the semi-structured data model (including XML and related standards)
c. The network data model and the flat file data model
d. The flat file data model and the semi-structured data model (including XML a
nd related standards)

Answer: B

A ______ is a collection of programs that enables user to create and maintain databases. In other words, it is general-purpose software that provides the users with the processes of defining, constructing and manipulating the databases for various applications

A ______ is a collection of programs that enables user to create and maintain databases. In other words, it is general-purpose software that provides the users with the processes of defining, constructing and manipulating the databases for various applications 




a. MSSQL
b. DBMS
c. DBS
d. DB2



Answer: B

What is a database?

What is a database? 





a. A database is a collection of information that is organized so that it can easily be accessed, managed, and updated
b. A database is a collection of data files
c. A database is a collection of records
d. A database is a collection of tuples


Answer: A

What is a graph database?

What is a graph database? 




a. A graph database is a database that uses tree structures with nodes to represent and store information
b. A graph database is a database that uses table structures to represent and store information
c. A graph database is a database that uses graph structures with nodes, edges and properties to represent and store information
d. None of the others



Answer: C

Choose the correct statement:

Choose the correct statement: 




a. A User-Defined Type (UDT) in SQL can be the type of a table
b. A UDT can be the type of an attribute belonging to some table
c. The form of UDT definition is: CREATE TYPE T AS (<primitive type | attribute declarations>)
d. All of the others


Answer: D

The aim for the Object-relational database is to bridge the gap between conceptual data modelling techniques such as Entity-relationship diagram (ERD) and object-relational mapping (ORM), which often use classes and inheritance, and relational databases, which do not directly support them

The aim for the Object-relational database is to bridge the gap between conceptual data modelling techniques such as Entity-relationship diagram (ERD) and object-relational mapping (ORM), which often use classes and inheritance, and relational databases, which do not directly support them 




a. True
b. False



Answer: A

The most useful index on a relation is an index on its key. This is because:

The most useful index on a relation is an index on its key. This is because: 




a. The index on non key attribute(s) runs slower
b. The search operation based on the primary key is commonly used.
c. The index on non key attribute(s) makes update operations to the relation more complex and time-consuming
d. All of the others



Answer: B

Choose the most correct statement about PRIMARY KEY:

Choose the most correct statement about PRIMARY KEY: 



a. The PRIMARY KEY constraint uniquely identifies each record in a database table
b. Primary keys must contain unique values
c. A primary key column cannot contain NULL values
d. Each table should have a primary key, and each table can have only ONE primary key
e. All of the others



Answer: E

Suppose we have a relation instance R(A,B,C) as following:

Suppose we have a relation instance R(A,B,C) as following:

R
A B C
----------------------------------
1 2 3
4 5 6
7 8 9

Which is the result of the query:
SELECT SUM(B) FROM R WHERE C > 10


a. 0
b. NULL
c. 3
d. 10



Answer: B

What one is a wildcard used for pattern matching?

What one is a wildcard used for pattern matching? 




a. "%" (for multi-character substitution)
b. "?" (for single character substitution)
c. "?" (for multi-character substitution)



Answer: A

A database transaction, by definition, must be ACID (atomic, consistent, isolated and durable). What does "Isolated" mean?

A database transaction, by definition, must be ACID (atomic, consistent, isolated and durable). What does "Isolated" mean? 


a. "Isolated" means that: Transactions provide an "all-or-nothing" proposition, stating that each work-unit performed in a database must either complete in its entirety or have no effect whatsoever
b. "Isolated" means that: Transactions must not violate any integrity constraints during its execution
c. "Isolated" means that: Transactions that have committed will survive permanently
d. "Isolated" means that: how/when the changes made by one operation in one transaction become visible to other concurrent operations in other transactions





Answer: D

For what values of x, y, and z, including NULL, does the Boolean expression x <= 100 AND NOT(y >= 15 OR z = 35) have the truth value UNKNOWN? Identify one of those values from the list below.

For what values of x, y, and z, including NULL, does the Boolean expression
x <= 100 AND NOT(y >= 15 OR z = 35)
have the truth value UNKNOWN? Identify one of those values from the list below. 



a. x = NULL, y = 0, z = 4.
b. x = -2, y = -2, z = -2.
c. x = 3, y = 0, z = 7.
d. x = 2, y = -1, z = 6.



Answer: A

Here are three relations, R(A,B), S(C,D). Their current values are:

Here are three relations, R(A,B), S(C,D). Their current values are:

R
A B
-------------------
1 4
2 5
3 6
4 7

S
C D
-------------------
0 1
1 0
2 1

Compute the result of the query:

SELECT A, B, C, D
FROM R LEFT OUTER JOIN S
ON R.A = S.C

Identify, in the list below, the row that appears in the result.
a. (4, 7, null, null)
b. (4, 7, 0, 1)
c. (4, 7, 1, 0)
d. (4, 7, 2, 1)



Answer: A

Here are two relations, R(A,B), S(C,D). Their current values are:

Here are two relations, R(A,B), S(C,D). Their current values are:

R
A B
-------------------
1 4
2 5
8 6
4 7

S
C D
-------------------
0 1
1 0
2 1
5 8

Compute the result of the query:

SELECT A, B, C, D
FROM R RIGHT OUTER JOIN S
ON R.A = S.C

Identify, in the list below, 2 rows that appears in the result.
a. (null, null, 0, 1)
b. (null, null, 5, 8)
c. (8, 6, null, null)
d. (4, 7, null, null)



Answer: A & B.

Given the relation Employee(SSN, FNAME, LNAME, SALARY, DepartmentNo). Select the right query below to count the number of employees in each department.

Given the relation Employee(SSN, FNAME, LNAME, SALARY, DepartmentNo). Select the right query below to count the number of employees in each department. 




a. SELECT COUNT(*) FROM Employee
b. SELECT DepartmentNo, COUNT(*) FROM Employee GROUP BY DepartmentNo
c. SELECT DepartmentNo, COUNT(*) FROM Employee
d. None of the others


Answer: B

Which one of the followings will appear in the result of the following query:

Suppose the relation S(B,C,D) has tuples:

B C D
------------------------------------
a 4 6
c 6 8
c 5 5
e 9 9
F 10 10
c 7 9

Which one of the followings will appear in the result of the following query: 


SELECT B, SUM(C)
FROM S
GROUP BY B



a. (c,11)
b. (c,13)
c. (c,12)
d. (c,18)




Answer: D

The ER Diagram uses three principle element types:

The ER Diagram uses three principle element types: 




a. Entity sets, Attributes and Constraints
b. Entity sets, Attributes, and Relationships
c. Attributes, Constraints, and Relationships
d. Entity sets, Constraints, and Relationships



Answer: B

Look at the following statements: (a)We should pick the right kind of elements (b) When an entity has no non-primary key attribute, we should convert that entity to an attribute (c) Use weak entities when-ever possible (d) Always make redundancies

Look at the following statements:
(a)We should pick the right kind of elements
(b) When an entity has no non-primary key attribute, we should convert that entity to an attribute
(c) Use weak entities when-ever possible
(d) Always make redundancies 




a. (a) and (b) are correct
b. (a) and (c) are correct
c. (a) and (d) are correct
d. (b) and (c) are correct


Answer: D

What is the goal of decomposition when designing a database?

What is the goal of decomposition when designing a database? 



a. The goal of decomposition is to replace a relation by several relations that do not exhibit anomalies
b. The goal of decomposition is to increase the speed of the database
c. The goal of decomposition is to increase the security of the database
d. None of the others



Answer: A

How to eliminate anomalies when we design a database?

How to eliminate anomalies when we design a database? 



a. We should decompose relation to eliminate anomalies
b. We should join relations to eliminate anomalies
c. We should union relations to eliminate anomalies
d. None of the others



Answer: A

Which of the following statements is true?

Which of the following statements is true? 




a. BCNF condition guarantees the non existence of the anomalies.
b. In BCNF condition, the left side of every non trivial FD must be a super key.
c. Any two-attribute relation is in BCNF.
d. All of the others.


Answer: D

Which of the following statements is correct?

Which of the following statements is correct? 




a. All relations in 3NF are also in BCNF
b. For any relation schema, there is a dependency-preserving decomposition into 3NF
c. All relations in 2NF are also in BCNF



Answer: B

The relation R(ABCD) has following FDs:

The relation R(ABCD) has following FDs:

{ACD -> B ;
AC -> D ;
D -> C ;
AC -> B}
Choose the correct statement about R:




a. R is in 3NF
b. R is in 2NF only, not higher
c. R is in 1NF only, not higher
d. None of the others


Answer: A

3NFconcept is related to (choose 1 answer only):

3NFconcept is related to (choose 1 answer only): 




a. Atomic definition
b. Full dependency definition
c. Transitive dependency definition
d. Super Key definition
e. All of the others



Answer: E

Which of the following relations is in Boyce-Codd Normal Form (BCNF)?

Which of the following relations is in Boyce-Codd Normal Form (BCNF)? 




a. R(ABCD) with FD's: BD -> C ; AB -> D ; AC -> B ; BD -> A
b. R(ABCD) with FD's: BC -> A ; AD -> C ; CD -> B ; BD -> C
c. R(ABCD) with FD's: A -> C ; B -> A ; A -> D ; AD -> C
d. R(ABCD) with FD's: A -> D ; C -> A ; D -> B ; AC -> B


Answer: A

What is a key attribute in a relation?

What is a key attribute in a relation? 



a. A key attribute is an attribute that belongs to one of the keys of the relation
b. A key attribute is an attribute that belongs to one of the super keys of the relation



Answer: A

What is a functional dependency?

What is a functional dependency? 




a. A functional dependency (A->B) occurs when the attribute A uniquely determines B
b. A functional dependency (A->B) occurs when the attribute B uniquely determines A



Answer: A

Why the intersection operator is not called a primitive relational algebra operator?

Why the intersection operator is not called a primitive relational algebra operator? 





a. Because the intersection operator can be expressed through the union operator and the difference operator
b. Because the intersection operator can be expressed through the selection operator and the projection operator
c. Because the intersection operator can be expressed through the product operator and the projection operator
d. Because the intersection operator can be expressed through the selection operator and the product operator


Answer: A