Professional Documents
Culture Documents
meaning, representing some aspect of real world and being designed, built and
populated with data for a specific purpose
a. Database
b. Database Instance
c. Schema
d. Schema Instance
QN=5 (6824) A ___ is a notation for describing the structure of the data in a database,
along with the constraints on that data
a. data model
b. database management system
c. data operation
d. data manipulation
BCD
------------------------------------
a46
c68
c55
e99
F 10 10
c79
SELECT SUM(D)
FROM S
WHERE D < 8 AND D > 5
BCD
-----------------------------------
a46
c68
c55
e99
f 10 10
c79
SELECT D, SUM(C)
FROM S
GROUP BY D
AB
-------------------
10 x
30 y
50 z
70 t
BCD
------------------------------------
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)
a
QN=34 (8539) 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.
c
QN=35 (8547) What operator tests column for the absence of data?
a. IS BLANK operator
b. IS ZERO operator
c. IS NULL operator
d. ISNULL operator
a
QN=36 (8542) 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
d
QN=37 (8550) What is the value of the query:
SELECT 'Nancy' + NULL + 'Smith'
when evaluated on Microsoft SQL Server?
a. 'Nancy Smith'
b. 'Nancy'
c. 'NancySmith'
d. NULL
a
QN=38 (8557) Which SQL keyword is used to sort the result-set?
a. ORDER BY
b. SORT BY
c. ORDER
d. SORT
a
QN=39 (8558) 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
c
QN=40 (8560) 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
b
QN=41 (8569) Suppose relation R(A,B).
Choose the SQL statement that is equivalent to the following RA expression:
[file:8569.jpg]
a. SELECT *
FROM R
b. SELECT (A+B) AS C
FROM R
WHERE (A+B) > 10
c. SELECT (A+B) AS C
FROM R
d. There is not any choice
c
QN=42 (8575) 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
d
QN=43 (8599) Choose the correct statement.
a. You can remove a trigger by dropping it or by dropping the trigger table.
b. The syntax to remove a trigger is: DROP TRIGGER <trigger_name>
c. Use ALTER TRIGGER to change the definition of a trigger
d. All of the others.
b
QN=44 (8585) 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)
a
QN=45 (8592) 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'
a
QN=46 (8582) Three basic types of database integrity constraints are:
(a)Entity integrity
(b) Domain integrity
(c) Referential integrity
(d) Primary key integrity
a. (a) and (b) and (c) are true
b. (a) and (b) and (d) are true
c. (a) and (c) and (d) are true
d. (b) and (c) and (d) are true
c
QN=47 (8609) A(an) _____ asserts that a value appearing in one relation must also
appear in the primary-key component(s) of another relation
a. Unique key constraint
b. Primary key constraint
c. Foreign key constraint
d. Candidate key constraint
a
QN=48 (8600) 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
a
QN=49 (8637) A/An _____ is a data structure that makes it efficient to find those tuples
that have a fixed value for an attribute
a. Index
b. Trigger
c. stored-procedure
d. View
d
QN=50 (8620) 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.
a
QN=51 (8633) ___ allow the database application to find data fast, without reading the
whole table
a. Indexes
b. Views
c. Triggers
d. Store-procedures
a
QN=52 (8630) 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
b
QN=53 (8624) Well-designed ____ can reduce disk I/O operations and consume fewer
system resources therefore improving query performance
a. Triggers
b. Indexes
c. Views
d. Stored Procedures
d
QN=54 (9178) 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
a
QN=55 (9168) 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
c
QN=56 (9186) 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
a
QN=57 (9187) A ____ table is a table that is embedded within another table
a. Nested
b. Primitive
c. Parent
d. Child
a
QN=58 (9195) A database of _____ data model is a collection of nodes, each node is
either a leaf or interior
a. semi-structured
b. relational
c. network
d. object-relational
a
QN=59 (9196) 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.
c
QN=60 (9211) A _____ specifies which characters are "less than" which other
characters
a. Domains
b. Character set
c. Collation
d. Stored procedure
a
QN=1 (6797) A ____ is a powerful tool for creating and managing large amounts of data
efficiently and allowing it to persist over long periods of time, safely
a. DBMS
b. Database
c. Excel
d. None of the others
a
QN=3 (6800) 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
a
QN=4 (6795) In _____ Data Model, the data and relations between them are organized
in tables
a. Relational
b. Network
c. Flat-file
d. Object-oriented
e. Tree-based
a
QN=5 (6833) 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
c
QN=6 (6814) In SQL , the command/statement that let you add an attribute to a relation
schema is .......
a. Insert
b. Update
c. Alter
d. None of the others
a
QN=7 (6826) To update a relation's schema, which one of the following statements can
be used?
a. ALTER TABLE
b. SELECT
c. INSERT
d. UPDATE
a
QN=8 (6832) Schema-altering commands are known as _________ commands.
a. Data Definition Language
b. Data Manipulation Language
c. Data Controlling Language
d. None of the others
b
QN=10 (6830) Which one of the following is NOT a DML command?
a. DELETE
b. ALTER TABLE
c. INSERT
d. UPDATE
a
QN=12 (7962) 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
a
QN=14 (7970) 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
a
QN=15 (7984) 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
e
QN=16 (7991) 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
a
QN=17 (7979) 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
c
QN=18 (7975) Let R(A,B,C,D) with the following FDs: {AB->C, AC->B, AD->C}
Choose a correct statement about R:
a. R is in BCNF
b. R is in 3NF
c. R is in 2NF
d. None of the others
b
QN=19 (8002) 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
d
QN=20 (8005) 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.
a
QN=21 (7995) 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
a
QN=22 (7994) 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
d
QN=24 (8029) Consider the following statement:
SELECT x, COUNT(y)
FROM Arc
GROUP BY x;
[file:8522.jpg]
a. (4,4)
b. (4,5)
c. (4,6)
d. (4,7)
e. (4,8)
d
QN=34 (8501) Suppose the relation S(B,C,D) has tuples:
BCD
------------------------------------
a46
c68
c55
e99
F 10 10
c79
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)
b
QN=35 (8503) 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
d
QN=36 (8505) Suppose the relation S(B,C,D) has tuples:
BCD
------------------------------------
a46
c68
c55
e99
f 10 10
c79
S
CD
-------------------
01
10
21
58
Compute the result of the query:
SELECT A, B, C, D
FROM R RIGHT OUTER JOIN S
ON R.A = S.C
S
CD
-------------------
01
10
21
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)
a
QN=40 (8534) A tuple which fails to participate in a join is called:
a. dangling tuple
b. child tuple
c. parent tuple
d. neighbor tuple
a
QN=41 (8538) (TRUE OR NULL) return:
a. TRUE
b. FALSE
c. NULL
d. None of the others
b
QN=42 (8552) Choose one correct statement:
a. Two null values are equal
b. Comparisons between two null values, or between a NULL and any other value,
return unknown
c. Comparisons between two null values, or between a NULL and any other value,
return FALSE
a
QN=43 (8554) 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.
a
QN=44 (8551) Choose one correct statement:
a. No two null values are equal
b. Two null values are equal
c. Comparisons between two null values, or between a NULL and any other value,
return FALSE
d
QN=46 (8559) 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
a
QN=47 (8578) What one is a wildcard used for pattern matching?
a. "%" (for multi-character substitution)
b. "?" (for single character substitution)
c. "?" (for multi-character substitution)
b
QN=48 (8573) Suppose we have a relation instance R(A,B,C) as following:
R
ABC
----------------------------------
123
456
789
SELECT * FROM R
WHERE A LIKE '%a%';
So, in the above case, the wildcard % represents what?
a. % (percent sign) represents zero, one, or more character
b. % (percent sign) represents exactly 1 character
d
With SQL, how do you select all the records from a table named "Persons" where the
value of the column "FirstName" starts with an "a"?
a. SELECT * FROM Persons WHERE FirstName='a'
b. SELECT * FROM Persons WHERE FirstName LIKE '%a'
c. SELECT * FROM Persons WHERE FirstName='%a%'
d. SELECT * FROM Persons WHERE FirstName LIKE 'a%'
a
What does the keyword ESCAPE mean?
a. The keyword ESCAPE is used to match any string that contains the characters "%" or
"_"
b. There is no keyword named ESCAPE
c. The keyword ESCAPE is used to match any string that contains the characters "?" or
"*"
d. The keyword ESCAPE is used to match any string that contains the characters "@"
or "$"
a
The SQL BETWEEN operator:
a. Specifies a range to test.
b. Specifies which tables we are selecting from.
c. Specifies that a column is a primary key.
d. None of the others
d
Referential integrity Constraints control relationships between ....
a. attributes in a table
b. operations of an object
c. database instances
d. tables in a database
a
Database integrity ensures that:
a. data entered into the database is accurate, valid, and consistent
b. data entered into the database is accurate, and consistent
c. data entered into the database is valid, and consistent
d. data entered into the database is accurate, and valid
d
Which of the following statements is the most correct?
a. Poorly designed indexes and a lack of indexes are primary sources of database
application bottlenecks.
b. Designing efficient indexes is paramount to achieve good database and application
performance
c. The selection of the right indexes for a database and its workload is a complex
balancing act between query speed and update cost
d. All of the others
c
What is a view?
a. A view is a database diagram
b. A view is a special stored procedure executed when certain event occurs
c. A view is a virtual table which results of executing a pre-compiled query. A view is not
a part of the physical database schema, while the regular tables are.
d. None of the others
a
What structure can you implement for the database to speed up table reads?
a. indexes
b. triggers
c. store-procedures
d. synonyms
a
Often, a DBMS allows us to build a single index on ____ attribute(s)
(choose the most correct answer)
a. only one
b. two
c. three
d. multiple
c
Suppose an updatable view ParamountMovies is associated with Movies relation.
Choose a correct answer.
a. Drop Movies relation also delete the view ParamountMovies
b. Drop ParamountMovies also delete Movies
c. An update on ParamountMovies is translated into Movies
d. None of the others
e
Why we should use stored procedures?
a. They allow faster execution
b. They can reduce network traffic
c. They allow modular programming
d. They can be used as a security mechanism
e. All of the others
a
In UML, a _____ between classes is called an association
a.binary relationship
b.multi-way relationship
c.none of the others
b
When an entity is called "weak"?
(a) When it is used to represent weak objects, such as patients, elders
(b) When all of its attributes can not identify itself
(c) When It always needs support from other entity
(d) When It is not really necessary in the ERD
a.(a) and (b) are correct
b.(b) and (c) are correct
c.(c) and (d) are correct
d.(d) and (a) are correct
b
Consider the following statement:
"When drawing ERD, if an entity has no non-key attribute and it is the 'one' in many-one
relationship, then we should set it to the attribute of other entities"
S
CD
-------------------
01
10
11
T
EF
-------------------
01
10
11
Identify, in the list below, the row that appears in the result.
A.(1,1,2,1)
B.(1,1,2,2)
C.(1,1,1,1)
D.None of the others
a
Choose the correct statement
A.Except for COUNT, aggregate functions ignore null values
B.Except for SUM, aggregate functions ignore null values
C.Except for AVG, aggregate functions ignore null values
D.Except for MIN, aggregate functions ignore null values
E.Except for MAX, aggregate functions ignore null values
a
What is the difference between Where and Having Clause?
A.WHERE is for Rows and HAVING is for Groups
B.WHERE is for Groups and HAVING is for Rows
C.WHERE and HAVING are the same
D.We can use aggregation functions in WHERE clause
c
Suppose relation R(a,b,c) has the following tuples:
ABC
-----------------------------------
113
123
214
235
241
324
336
SELECT * FROM R
UNION
SELECT * FROM S
[file:8524.jpg]
a. There is an error a
b. The output has 15 rows
c. The output has 16 rows
d. The output has 17 rows
a
QN=18 (8537) What is a "join"?
a. 'join' used to connect two or more tables logically with or without common field(s) a
b. 'join' used to connect two or more tables logically with common field(s)
c. 'join' used to connect two or more tables logically without common field(s)
d. 'join' used to connect two or more tables logically with aliases
a
When join R and S, we want to display all the records in R we must use:
a. LEFT OUTER JOIN a
b. RIGHT OUTER JOIN
c. INNER JOIN
d. None of the others
c
Given relations R(A,B) and S(B,C,D). The result of natural join of the relations R and S
has
a. Only attribute B
b. Only two attributes R.B and S.B
c. Attributes A, B, C, D
d. None of the others
a
Relation R(x,y) currently consists of only one tuple (NULL, NULL). Which of the
following queries will produce a nonempty output? That is, at least one tuple will be
produced, although the tuple(s) may have NULL's.
a. SELECT * FROM R WHERE x IS NULL
b. SELECT * FROM R WHERE x = NULL
c. SELECT * FROM R WHERE x = y
d. SELECT * FROM R WHERE x <> 10
a
(TRUE AND NULL) returns: ???
a. NULL
b. TRUE
c. FALSE
d. None of the others
d
Choose the in-correct statement:
a. In SQL Server, every DML operation is a transaction regardless of whether it has a
BEGIN TRANSACTION or not
b. COMMITTING a transaction makes permanent the changes resulting from all SQL
statements in the transaction
c. ROLLING back a transaction rejects any of the changes resulting from the SQL
statements in the transaction
d. When the sequence of tasks is complete, the SAVE POINT closes the transaction
a
QN=43 (8610) In order to modify or delete an existing constraint, it is necessary that:
a. the constraint has a name
b. the constraint has an ID
c. the constraint has some attributes
b
QN=37 (8611) Look at the following tables and then choose the correct statment:
ARTISTS
Airtist_id Airtist_Name
-----------------------------------
1 Bono
2 Cher
ALBUM
artist_id Album_name
------------------------------------
3 Eat the rich
a. The above picture is an example of a database that has not enforced referential
integrity
b. The above picture is an example of a database that has not enforced entity integrity
c. The above picture is an example of a database that has not enforced domain integrity
d. All of the others
c
QN=33 (8576) The IN SQL keyword
a. Is used with the DISTINCT SQL keyword only
b. Is used with the INSERT SQL keyword only
c. Determines if a value
any of the values in a list or a sub-query
d. Defines the tables we are selecting or deleting data from
b
Choose a right answer.
[A]
A SOL environment is the framework under which data may exist and SQL operations
on data may be executed
[B]
All of the others
[C]
Within a SQL environment are two special kinds of processes: SQL clients and SQL
servers.
[D]
A SQL environment is a DBMS running at some installation.
a
Choose the right statement below to declare zero or one occurrence of an Element in
DTD.
[A]
<"ELEMENT element-name (child-name?)>
[B]
<IELEMENT element-name (child-name+)>
[C]
<'ELEMENT element-name (child-name*)>
[D]
<IELEMENT element-name (child-name)>
a
Given the relation Employee(SSN. FNAME. LNAME. SALARY). Select the right query
below to find the employee(s) who has the lowest salary in the company
[A]
SELECT LNAME. FNAME. SALARY FROM Employee WHERE SALARY IN (SELECT
MIN(SALARY) FROM Employee)
[B]
SELECT LNAME. FNAME. SALARY FROM Employee WHERE SALARY >= ALL
(SELECT SALARY FROM Employee)
[C]
SELECT LNAME. FNAME. SALARY FROM Employee WHERE SALARY < MAX
(SELECT SALARY FROM Employee)
[D]
None of the others
b
Given a relation R(A.B.C.D). Which of the followings is trivial?
[A]
A->BCD
[B]
A->->BCD
[C]
A->AB
[D]
A->->AB
b
Select the well-formed XML
[A]
All of the others
[B]
<? xml version = "1.0" ?>
<MovieData>
<Movie tiHe="StarWar*><Year>1997</Yearx/MovJe>
</MovieData>
[C]
<? xml version - "1 0' ?>
<MovieData>
<Movie Me-'StarWaf*><Year>1997</Year></Movie>
</Movies>
[D]
<? xml version = 1 0 7>
<MovieData>
<Movie trtle-"StarWar"><Year>1997</Movie></Year>
</MovieData>
a
Which of the followings is true?
[A]
The Entity Relationship (ER) model represents the structure of data graphically
[B]
The ER model is a low level database design
IC]
The ER model represents the operation on data
[D]
All of the others
d
In the three-tier architecture, the database tier's function is to
[A]
All of the others.
[B]
Execute the business logic of the organization operating the database.
[C]
Manage the interactions with the user.
[D]
Execute queries that are requested from the application tier.
c
Choose a right answer
[A]
When a privilege is granted, it cannot be revoked
[B]
Privileges cannot be granted on a view
[C]
An authorization ID may be granted privileges from others or may grve its privileges to
others
[D]
All of the others
c
Exception handler in PSM is defined as follows:
DECLARE <where to go next> HANDLER FOR condition list> <statement>
The <where to go next> clause can be:
[A]
UNDO
[B]
EXIT
[C]
All of the others
[D]
CONTINUE
a
In SQL language, the command/statement that let you add an attribute to a relation is_
[A]
Alter
[B]
None of the others
[C]
Insert
[D]
Update
d
Consider the Dalalog rule H(xy) <- Sfx. y) AND x > 2 AND y < 6. Relation S(x y) has 3
tuples (2.3). (3.5). and (4.6). What is about H?
[A]
H has a tuple (2.3)
[B]
H has 3 tuples (2.3) and (3.5) and (4.6)
[C]
H has 2 tuples (2.3) and (3.5)
[D]
H has a tuple (3.5)
d
Select the valid query to declare the foreign key presC# of the relation Studiolname.
address. presC#) that references the cert of the relation MovieExeclname. address.
cert#. netWorth):
[A]
All of the others.
[B]
CREATE TABLE Studio (name CHAR(30) PRIMARY KEY. address VARCHAR(256).
presC# INT FOREIGN KEY):
[C]
CREATE TABLE Studio (name CHAR(30) PRIMARY KEY. address VARCHAR(256).
presC# INT UNIQUE KEY REFERENCES MovieExec):
[D]
CREATE TABLE Studio (name CHAR(30) PRIMARY KEY. address VARCHAR(256).
presC# INT REFERENCES Movie Exec (cert#));
b
Choose the right statement
[A]
XML Schema allows us to declare simple types, such as integer or float and even
complex types
[B]
All of the others
[C]
XML schema provides us the ability to declare keys and foreign keys.
[D]
XML Schema is an alternative way to provide a schema for XML documents.
c
The relational operator that yields all possible pairs of rows from two tables is known as
a_
[A]
Union
[B]
Selection
[C]
Product
[D]
Join
d
Consider a relation with schema R(A, B, CD) and FD's BC-> D, D-> A, A-> B. Which of
the following is the key of R?
[A]
BD
[B]
D
[C]
AB
[D]
BC
c
In PSM. the difference between 3 stored procedure and a function is that
[A]
A function has the return statement.
[B]
We can declare local variables in a function.
[C]
All of the others
[D]
Loops are not allowed in a function.
b
Selecl Ihe right syntax for HAVING clause in SOL
[A]
SELECT <list of attributes>
FROM <list of tables>
WHERE <conditions on tuples>
HAVING <conditions on groups>
GROUP BY <list of attributes>
[B]
SELECT <list of attributes>
FROM <list of tables>
WHERE <conditions on tuples>
GROUP BY <list of attributes>
HAVING <conditions on groups>
[C]
SELECT < list of attributes>
FROM < list of tables>
HAVING <conditions on groups>
WHERE <conditions on tuples>
GROUP BY <list of attributes>
[D]
All of the others
a
Select the right answer.
[A]
All of the others
[B]
Tags in XML are text surrounded by triangular brackets (for example, <_>).
[C]
An XML tag can be a single tag with no matching closing tag (for example. <foo />
[D]
Tags in XML comes in matching pairs, with an opening tag like <foo> and a matched
closing tag like</foo>
d
Given relations R(A.B) and S(B.C.D). The result of natural join of the relations R and S
has
[A]
Only two attributes R B and SB
[B]
None of the others
[C]
Only attribute B
[D]
Attributes A B. C. D
c
Given relation U(A, B, C) that has 2 tuples (1,2,3) and (4,5,6), and relation V(B(C, D)
that has 2 tuples (2,3,10) and (2,3,11). Choose the right answer below;
[A]
None of the others.
[B]
The outer join of U and V is the relation R(A, B, C, D) that has 2 tuples (1.2, 3.10) and
(1,2, 3,11).
[C]
The outer join of U and V is the relation R(A. B. C. D) that has 3 tuples (1.2.3.10) .
(1.2.3.11) and (4.5.6. NULL).
[D]
The outer join of U and V is the relation R(A. B. C. D) that has only 1 tuple (NULL.
4.5.6).
c
The result of (UNKNOWN OR TRUE) is
[A]
UNKNOWN
[B]
FALSE
[C]
TRUE
[D]
NULL
d
In Java Database Connectivity (JDBC). before we can execute SQL statements), we
need to _
[A]
Create a cursor.
[B]
Create an environment
[C]
Create a description.
[D]
Establish a connection to the database and create statement(s)
d
Choose a right answer
[A]
The object-relational model is the extension of the relation model with new features
such as structured types, methods, identifiers for tuples, and references
[B]
Object-relation model allows a non-atomic type that can be a relation schema which is
called nested relation
[C]
In object-relational model, the type of an attribute can be a reference to a tuple with a
given schema or a set of references to tuples with a given schema
[D]
All of the others
d
Select the right answer
[A]
Virtual views do not exist physically
[B]
Virtual views are defined by an expression like a query
[C]
Virtual views can be queried and can even be modified
[D]
All of other
c
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 (
nameCHAR(30).
address CHAR(IOO) };
[A]
CREATE TABLE MovieStar (name StarType).
PI
CREATE TABLE MovieStar (name StarType PRIMARY KEY);
[C]
CREATE TABLE MovieStar OF StarType Q;
[D]
None of the others
c
Which of the following statements is true?
[A]
I3NF implies BCNF
[B]
Multi-valued Dependency (MVD) implies Fourth Normal form (4NF)
[C]
4NF implies BCNF and BCNF implies 3NF
[D]
None of the others
d
Choose the right statement
[A]
Sub-queries return a single constant this constant can be compared with another value
in a WHERE clause;
[B]
Sub-queries return relations, that can be used in WHERE clause
[C]
Sub-queries can appear in FROM clauses, followed by a tuple variable
[D]
All of the others
c
Given the relation Movies(title, year, length, genre. studioName). Select the right query
to create a View with the titles and studio names of all movies that were produced in
1980
[A]
CREATE VIEW OldMovies SELECT title. studioName FROM Movies WHERE year-
1980
[B]
CREATE VIEW OldMovies SELECT title, year FROM Movies WHERE year=1980
[C]
CREATE VIEW OldMovies AS SELECT title. studioName FROM Movies WHERE
year=1980
[D]
None of the others
b
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 COUNTf) FROM Employee
[B]
SELECT DepartmentNo. COUNT(*) FROM Employee GROUP BY DepartmentNo
[C]
SELECT DepartmentNo. COUNT(*) FROM Employee
[D]
None of the others
b
Consider a relation with schema R(A, B. C. D) and FD's A-> B. A-> C. C -> D. Which
ofthe following is the {A}+ ?
[A]
{A}
[B]
{A B C D}
[C] {A. B. C}
[D] {A.B}
b
To create a constraint (for example, referential integrity constraint) on a relation, the
owner ofthe schema must have
[A]
UNDER privilege
[B]
REFERENCES privilege
[C]
UPDATE privilege
[D]
EXECUTE privilege
a
Choose a wrong answer.
[A]
Relational algebra can express recursion.
[B]
Basic relational algebra can be expressed in Datalog rule(s).
IC]
Single Datalog rule can be expressed in relational algebra.
[D]
Datalog does not support bag operations.
a
In DTD. the main difference between PCDATA and CDATA is
[A]
PCDATA is text that will be parsed by a parser and tags inside the text will be treated as
markup and entities will be expanded CDATA is text that will NOT be parsed by a
parser and tags inside the text wil
NOT be treated as markup and entities will not be expanded.
[B]
All of the others.
[C]
CDATA is used to assert something about the allowable content of elements where as
PCDATA is used as a common type for attribute
[D]
There's no difference between PCDATA and CDATA.
b
_______authorizes access to database, coordinate, monitor its use, acquiring software,
and hardware resources.
[A]
All of the others
[B]
Database administrator
[C]
Database designer
[D]
Database end-user
d
Choose right answer(s).
[A]
NULL value is unknown, inapplicable, or withheld
[B]
Comparisons with NULL values will return UNKNOWN
[C]
Arithmetic operators on NULL values will return a NULL value
[D]
All of orther
d
Choose the right statement
[A]
The action associated with the trigger executes no matter what the condition is hold or
not
[B]
Triggering events do not support INSERT and DELETE.
[C]
All of the others.
[D]
When the trigger is awakened, it tests a condition. If the condition is satisfied, the action
associated with the trigger is executed.
d
Four characteristics of transactions are
[A]
None of the others
[B]
Read uncommitted, Read committed, Repeatable read, Serializable
[C]
Atomicity. Isolation. Concurrency. Durability
[D]
Atomicity. Isolation. Consistency. Durability
c
Choose the right statement to grant the INSERT and SELECT privileges on table
Movies to users torn' and jerry'
[A]
GRANT SELECT. INSERT on Movies
[B]
GRANT SELECT. INSERT on Movies TO torn, jerry CASCADE
[C]
GRANT SELECT. INSERT on Movies TO torn, jerry WITH GRANT OPTION
[D]
GRANT SELECT. INSERT on Movies TO ALL
a
When declaring foreign key constraint for relation A thai references relation B. the
referenced attribute(s) of the relation B must be declare as_______
[A]
UNIQUE or PRIMARY KEY
[B]
FOREIGN KEY
[C]
INDEX KEY
[D]
All of the others
a
Choose an incorrect statement
[A]
None of the others
[B]
Database is created and maintained by a DMBS
IC]
Database is a collection of information that exists over a long opened of time
[D]
Database is a collection of data that is managed by a DBMS
a
Select the right statement
[A]
All of the others
[B]
Every constraint has a name. If we don't define constraint's name explicitly, then DBMS
automatically generates a name for it
[C]
We can create constraint on a tuple as a whole.
[D]
We can create constraint on a single attribute
c
Given relations Movies(title, year, length, genre. studioName. producer#).
MovieExec(name. address. cert#). and Studio(name. address. presC#). Suppose we
have the materialized view that finds the name -
ofthe producer of a given movie as follows:
CREATE MATERIALIZED VIEW MovieProd AS
SELECT title, year, name
FROM Movies. MovieExec
WHERE producer# - cert#
Which of the following modification will affect the MovieProd materialized view?
[A]
Insert a new tuple into Studio
[B]
Delete a tuple from Studio
[C]
Insert a new tuple into Movies or delete a tuple from Movies
[D]
None of the others
b
In relational data model, an attribute is a column
[A]
True
[B]
False
b
A data model is a notation for describing data or information. And the description
generally consist of:
[A]
2 parts
[B]
3 parts
[C]
4 parts
[D]
5 parts
b
DBMS stands for what?
[A]
Database Managing Systems
[B]
Database Management System
[C]
Database Manage System
[D]
Database Managable System
b
Look at this line:
MOVIES (Id, Name, Description)
What the above represent?
[A]
A relation
[B]
A schema
[C]
A schema instance
[D]
A relation instance
b
Look at the following data for table R:
ABC
112
112
113
Choose all correct answers
[A]
R is not a relation
[B]
R is a relation
[C]
R has no key
a
In relational data model, a tuple is a record or a row
[A]
True
[B]
False
d
When the Relational Data Model first proposed?
[A]
1940
[B]
1950
[C]
1960
[D]
1970
a
What is the oldest data model?
[A]
Network Data Model
[B]
Flat File Data Model
[C]
Relational Data Model
[D]
Hierachical Data Model
d
How many data models mentioned in our database course?
[A]
3
[B]
4
[C]
5
[D]
6
a
XML files are semi-structured data
[A]
True
[B]
False
b
A relation is a list of tuples
[A]
True
[B]
False
a
A relation is a set of tuples
[A]
True
[B]
False
c
A weak entity:
[A]
must have total participation in an identifying relationship
[B]
does not have a key attribute(s)
[C]
both (a) and (b)
[D]
none of the above
b
Give the relation R(XYZT) with the following FD's:
XY -> Z ; XYT -> Z ; XYZ -> T ; XZ -> T
Determine the primary key for R and then choose the correct statement
[A]
R is in BCNF
[B]
R is not in BCNF
c
Given the relation schema R(XYZT) and functional dependencies
F = {X->Z, T->Y}.
Which functional dependency causes a violation of second normal form (2NF) ?
[A]
X->Z
[B]
T->Y
[C]
both X->Z and T->Y
[D]
none of the above
d
5. The ER model is meant to
a) replace relational design
b) enable detailed descriptions of data query processing
c) enable low level descriptions of data
d) be close to a users perception of the data
a
To apply a selection to bag:
A. NULL
B. TRUE
C. FALSE
D. None of the others
a
Give the relation Employee(SSN,FNAME,LNAME,SALARY).Select the right query
below to find the employee(s) who has the lowest salary in the company
A. DISTINCT ALL
B. DISTINCT
C. UNION ALL
D. COMBINED
b
In databse design precesses, data requirements are expressed through......
(a) Schema Design
(b)ERD
(c)UML
(d) Table Design
A.Isolation
B.Consistency
C.Atomic.
D. Durability
c
Given the diagram below,using the nulls method we can create a single relation whose
schema is.....
A.Movies(title,year,length,genre)
B.Movies(title,year,length,genre,cartoons)
C.Movies(title,year,length,genre,weapon)
D.Movies(title,year,length,genre,murder)
b
In relational data model, an attribute is a column
A. True
B. False