What is the hierarchical data model?

What is the hierarchical data model? 





a. A hierarchical data model is a data model in which the data is organized into a tree-like structure
b. A hierarchical data model is a data model in which the data is organized into a table-like structure
c. A hierarchical data model is a data model in which the data is organized into a graph-like structure
d. None of the others




Answer: A

Select the well-formed XML.

Select the well-formed XML. 



a. <? xml version = "1.0" ?>
<MovieData>
<Movie title="StarWar"><Year>1997</Year></Movie>
</MovieData>
b. <? xml version = "1.0" ?>
<MovieData>
<Movie title="StarWar"><Year>1997</Year></Movie>
</Movies>
c. <? xml version = "1.0" ?>
<MovieData>
<Movie title="StarWar"><Year>1997</Movie></Year>
</MovieData>
d. All of the others.


Answer: A 

Select the right statement to declare MovieStar to be a relation whose tuples are of type StarType. Note: StarType is a user-defined type that has its definition as follows:

Select the right statement to declare MovieStar to be a relation whose tuples are of type StarType. Note: StarType is a user-defined type that has its definition as follows:

CREATE TYPE StarType AS
(
name CHAR(30),
address CHAR(100)
);



a. CREATE TABLE MovieStar (name StarType );
b. CREATE TABLE MovieStar (name StarType PRIMARY KEY );
c. CREATE TABLE MovieStar OF StarType ();
d. None of the others




Answer: C

The benefits of stored procedures are: (a)They improve the security by letting the admin to LIMIT the access rights of users (b) They can save a lot of storage space (c) They can be reused many times (d) They can store a part of the database in order to retrieve the data more quickly

The benefits of stored procedures are:
(a)They improve the security by letting the admin to LIMIT the access rights of users
(b) They can save a lot of storage space
(c) They can be reused many times
(d) They can store a part of the database in order to retrieve the data more quickly 





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




Answer: A

Which of the following statements is the most correct?

Which of the following statements is the most correct? 



a. Using Stored procedures reduces network traffic
b. Using Stored procedures improves security
c. Using Stored procedures improves performance
d. All of the others





Answer: D

What are the drawbacks of indexes? (a)Indexes require more disk space (b) Indexes make UPDATE, INSERT, DELETE statement slower (c)Indexes have no any drawback (d) Indexes make SELECT statement slower

What are the drawbacks of indexes?
(a)Indexes require more disk space
(b) Indexes make UPDATE, INSERT, DELETE statement slower
(c)Indexes have no any drawback
(d) Indexes make SELECT statement slower 



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





Answer: A

Select the most correct answer

Select the most correct answer 




a. An index is a data structure used to speed access to tuples of a relation, given values of one or more attributes
b. The key for index can be any attribute or set of attributes, and need not be the key of the relation
c. We can think of the index as a binary search tree of (key, locations) pairs in which a key a is associated with a set of locations of the tuples
d. All of the others.






Answer: D

What is difference between PRIMARY KEY and UNIQUE KEY ?

What is difference between PRIMARY KEY and UNIQUE KEY ? 



a. A table can have more than one UNIQUE KEY constraint but only one PRIMARY KEY
b. A table can have more than one PRIMARY KEY constraint but only one UNIQUE KEY
c. UNIQUE KEY and PRIMARY KEY are the same
d. None of the others






Answer: A

To create a DEFAULT constraint on the "City" column of the table PERSON which is already created, use the following SQL:

To create a DEFAULT constraint on the "City" column of the table PERSON which is already created, use the following SQL: 




a. ALTER TABLE Person
ALTER COLUMN City SET DEFAULT 'SANDNES'
b. ALTER TABLE Person
EDIT COLUMN City SET DEFAULT 'SANDNES'
c. ALTER TABLE Person
UPDATE COLUMN City SET DEFAULT 'SANDNES'
d. ALTER TABLE Person
MODIFY COLUMN City SET DEFAULT 'SANDNES'




Answer: A

Suppose R and S are 2 relations. R is the parent of S. And the relationship between R and S is set to "ON DELETE CASCADE". This means that:

Suppose R and S are 2 relations. R is the parent of S.
And the relationship between R and S is set to
"ON DELETE CASCADE".
This means that: 




a. We can delete a row from R if that row has children in S (and in this case, the database server will raise up an error)
b. We can delete a row from R although that row has children in S (and in this case, all the children will be deleted too)




Answer: B

What is the difference between the WHERE and HAVING SQL clauses?

What is the difference between the WHERE and HAVING SQL clauses? 




a. The WHERE and the HAVING clauses are identical
b. The HAVING SQL clause condition(s) is applied to all rows in the result set before the WHERE clause is applied (if present). The WHERE clause is used only with SELECT SQL statements and specifies a search condition for an aggregate or a group
c. The WHERE SQL clause condition(s) is applied to all rows in the result set before the HAVING clause is applied (if present). The HAVING clause is used only with SELECT SQL statements and specifies a search condition for an aggregate or a group
d. None of the others






Answer: C

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

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




a. "Durable" 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. "Durable" means that: Transactions must not violate any integrity constraints during its execution
c. "Durable" means that: Transactions that have committed will survive permanently
d. All of the others






Answer: C

Three properties of a lock in DBMS are: a)Granularity: the size of the lock b) Granularity: the type of the lock c) Mode: the type of the lock d) Duration: the time in seconds that the DBMS waits for a lock to be released

Three properties of a lock in DBMS are:
a)Granularity: the size of the lock
b) Granularity: the type of the lock
c) Mode: the type of the lock
d) Duration: the time in seconds that the DBMS waits for a lock to be released 




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





Answer: A

What does NULL mean?

What does NULL mean? 





a. The value NULL means UNKNOWN
b. The value NULL means '' (empty string)
c. The value NULL means ' ' (space character)
d. The value NULL means ZERO




Answer: A

For what values of x, y, and z, including NULL, does the Boolean expression x <= 4 OR NOT(y >= 2 AND z = 10) have the truth value FALSE? Identify one of those values from the list below

For what values of x, y, and z, including NULL, does the Boolean expression
x <= 4 OR NOT(y >= 2 AND z = 10)
have the truth value FALSE? Identify one of those values from the list below 




a. x = 5, y = 3, z = 10
b. x = 3, y = 1, z = 10.
c. x = NULL, y = 2, z = 10.
d. x = NULL, y = 3, z = 10.





Answer: A

Compute the right outer join of R and S, where the condition is: R.B = S.B. Then identify 2 tuples of R that do not appear in the computed result.

 Suppose relation R(A,B) has the tuples:

A B
-------------------
10 x
30 y
50 z
70 t

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

B C D
------------------------------------
x 40 60
z 60 80
z 50 50
z 70 90

Compute the right outer join of R and S, where the condition is: R.B = S.B. Then identify 2 tuples of R that do not appear in the computed result. 



a. (10,x)
b. (30,y)
c. (50,z)
d. (70,t)



Answer: B and D.

When we apply set operators (UNION, INTERSECT, EXCEPT) to two relations R and S, which conditions on R and S must be satisfied?

When we apply set operators (UNION, INTERSECT, EXCEPT) to two relations R and S, which conditions on R and S must be satisfied? 




a. R and S must have schemas with identical sets of attributes and the types (domains) for each attributes must be the same in R and S
b. Before we compute the set-theoretic union, intersection, or difference of sets of tuples, the columns of R and S must be ordered so that the order of attributes is the same for both relations
c. All of the others





Answer: C

How we can understand about this statement: "All aggregate functions are deterministic"?

How we can understand about this statement:
"All aggregate functions are deterministic"? 




a. This means aggregate functions return the same value any time they are called by using a specific set of input values
b. This means aggregate functions return the different values each time they are called by using a specific set of input values
c. This means aggregate functions return the same value any time they are called by using any set of input values
d. None of the others





Answer: A

The table Arc(x,y) currently has the following tuples (note that there are duplicates): (1,2), (1,2), (2,3), (3,4), (3,4), (4,1), (4,1), (4,1), (4,2). Compute the result of the query:

The table Arc(x,y) currently has the following tuples (note that there are duplicates): (1,2), (1,2), (2,3), (3,4), (3,4), (4,1), (4,1), (4,1), (4,2). Compute the result of the query: 


SELECT a1.x, a2.y, COUNT(*)
FROM Arc a1, Arc a2
WHERE a1.y = a2.x
GROUP BY a1.x, a2.y;

Which of the following tuples is in the result?



a. (3,1,2)
b. (1,3,4)
c. (2,4,6)
d. (3,2,6)





Answer: A

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

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

Compute the result of the following query:

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

Choose rows that are appear in the computed result


a. (9,12)
b. (9,14)
c. (9,16)
d. (9,18)






Answer: C

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

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

Compute the result of the following query:

SELECT SUM(D)
FROM S
WHERE D < 8 AND D > 5

Choose the row that appears in the computed result.


a. 6
b. 7
c. 8
d. 9




Answer: A

In UML, what is the difference between an aggregation and a composition?

In UML, what is the difference between an aggregation and a composition? 



a. In composition, when the owning object is destroyed, so are the contained objects. In aggregation, this is not necessarily true.
b. In aggregation, when the owning object is destroyed, so are the contained objects. In composition, this is not necessarily true.
c. All of the others
d. There is no difference between an aggregation and a composition





Answer: A

A class in UML is similar to

A class in UML is similar to





a. An entity set in E/R model
b. An attribute in E/R model
c. A Relationship in E/R model
d. None of the others



Answer: A

The key for a weak entity set E is

The key for a weak entity set E is 




a. Zero or more attributes of E
b. The set of attributes of supporting relationships for E
c. The set of attributes of supporting entity sets
d. Zero or more attributes of E and key attributes from supporting entity sets



Answer: D

What is the benefit of "de-normalization"?

What is the benefit of "de-normalization"? 




a. "de-normalization" has no benefit
b. The main benefit of de-normalization is improved performance with simplified data retrieval (this is done by reduction in the number of joins needed for data processing)
c. The main benefit of de-normalization is eliminating redundant information from a table and organizing the data so that future changes to the table are easier




Answer: B

What is "de-normalization"?

What is "de-normalization"? 



a. De-normalization means allowing redundancy in a table
b. De-normalization means allowing duplicate columns appeared in a table
c. De-normalization means allowing a table to have more than 3 columns
d. De-normalization means allowing a table to have more than 1024 columns





Answer: A

What is the difference between the 2NF and the 3NF?

What is the difference between the 2NF and the 3NF? 



a. 2NF deals with partial functional dependency, while 3NF deals with transitive functional dependency
b. 2NF deals with transitive functional dependency, while 3NF deals with partial functional dependency






Answer: A

Consider the following functional dependencies a,b -> c,d e,g,h -> f,j a,c -> b,d p,q -> r,s e,f,g -> h,i s -> t f,g -> j q -> u g,h -> i Which of the following best describes the relation R(e,f,g,h,i,j)?

Consider the following functional dependencies
a,b -> c,d e,g,h -> f,j
a,c -> b,d p,q -> r,s
e,f,g -> h,i s -> t
f,g -> j q -> u
g,h -> i
Which of the following best describes the relation R(e,f,g,h,i,j)? 




a. R is in First Normal Form
b. R is in Second Normal Form
c. R is in Third Normal Form
d. R is in Boyce Codd Normal Form




Answer: A

Which of following is never used as a data model?

Which of following is never used as a data model? 



a. Hierarchical data model
b. None of the others
c. Graph-based data model
d. Tree-based data model
e. Relational data model




Answer: B

Choose the most correct statement.

Choose the most correct statement. 




a. Database is created and maintained by a DMBS
b. All of the others
c. Database is a collection of data that is managed by a DBMS
d. Database is a collection of information that exists over a long period of time




Answer: B