wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DBI202_PART1

Total questions: 120

Worksheet time: 1hrs 1mins

Name
Class
Date
1.

QN=1 (6803) A ____ is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and being designed, built and populated with data for a specific purpose

a)

a. Database

b)

b. Database Instance

c)

c. Schema

d)

d. Schema Instance

2.

QN=2 (6801) Choose the most correct statement.

a)

a. Database is created and maintained by a DMBS

b)

b. All of the others

c)

c. Database is a collection of data that is managed by a DBMS

d)

d. Database is a collection of information that exists over a long period of time

3.

QN=3 (6802) Which of following is never used as a data model?

a)

a. Hierarchical data model

b)

b. None of the others

c)

c. Graph-based data model

d)

d. Tree-based data model

e)

e. Relational data model

4.

QN=4 (6817) A ____ is a relation name, together with the attributes of that relation.

a)

a. schema

b)

b. database

c)

c. database instance

d)

d. schema instance

5.

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)

a. data model

b)

b. database management system

c)

c. data operation

d)

d. data manipulation

6.

QN=6 (6827) A _____ is a language for defining data structures

a)

a. DDL

b)

b. DML

c)

c. DCL

d)

d. None of the others

7.

QN=7 (6834) Which statement is used to remove a relation named R?

a)

a. DROP TABLE R;

b)

b. REMOVE TABLE R;

c)

c. DELETE TABLE R;

d)

d. TRUNCATE TABLE R;

8.

QN=8 (6829) What is another term for a row in a relational table?

a)

a. Attribute

b)

b. Tuple

c)

c. Field

d)

d. Relation

9.

QN=9 (7961) Given a relation R(A,B,C,D). Which of the followings is trivial?

a)

a. A->AB

b)

b. A->->AB

c)

c. A->BCD

d)

d. A->->BCD

10.

QN=10 (7972) Let R(ABCD) be a relation with functional dependencies
{A -> B,
C -> B,
B -> D}
What is the key for R (choose one)

a)

AB

b)

AC

c)

AD

d)

BD

11.

QN=11 (7966) Suppose R is a relation with attributes A1, A2, A3, A4.
The only key of R is {A1, A2}. So, how many super-keys do R have?

a)

4

b)

8

c)

12

d)

16

12.

QN=12 (7990) 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)

a. R is in First Normal Form

b)

b. R is in Second Normal Form

c)

c. R is in Third Normal Form

d)

d. R is in Boyce Codd Normal Form

13.

QN=13 (7978) The relation R(ABCD) has following FDs:
{ A -> B ; B -> A ; A -> D ; D -> B }

a)

a. R is in 3NF

b)

b. R is not in 3NF

c)

c. R is not in 2NF

d)

d. None of the others

14.

QN=14 (7976) Given a R(A,B,C,D) with the following FDs:
AB->D
BC->A
AD->B
CD->B
AD->C
Choose a correct statement about R:

a)

a. The FD set of R is not canonical and R is in BCNF

b)

b. The FD set of R is canonical and R is not in BCNF

c)

c. The FD set of R is not canonical and R is not in BCNF

15.

QN=15 (7999) What is the difference between the 2NF and the 3NF?

a)

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

b)

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

16.

QN=16 (7993) What is "de-normalization"?

a)

a. De-normalization means allowing redundancy in a table

b)

b. De-normalization means allowing duplicate columns appeared in a table

c)

c. De-normalization means allowing a table to have more than 3 columns

d)

d. De-normalization means allowing a table to have more than 1024 columns

17.

QN=17 (8004) What is the benefit of "de-normalization"?

a)

a. "de-normalization" has no benefit

b)

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)

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

18.

QN=18 (8022) The key for a weak entity set E is .........

a)

a. Zero or more attributes of E

b)

b. The set of attributes of supporting relationships for E

c)

c. The set of attributes of supporting entity sets

d)

d. Zero or more attributes of E and key attributes from supporting entity sets

19.

QN=19 (8019) A class in UML is similar to...........

a)

a. An entity set in E/R model

b)

b. An attribute in E/R model

c)

c. A Relationship in E/R model

d)

d. None of the others

20.

QN=20 (8013) A(n) _____ provides a means to analyze business requirements so as to standardize organizational vocabulary, enforce business rules, and ensure adequate data quality

a)

a. Entity Relationship Diagram

b)

b. Relation Schema Design

c)

c. All of the others

d)

d. None of the others

21.

QN=21 (8032) An association class in UML is similar to ______ in the ER model

a)

a. attributes on a relationship

b)

b. Attributes

c)

c. Entities

d)

d. entity sets

22.

QN=22 (8009) In UML, what is the difference between an aggregation and a composition?

a)

a. In composition, when the owning object is destroyed, so are the contained objects. In aggregation, this is not necessarily true.

b)

b. In aggregation, when the owning object is destroyed, so are the contained objects. In composition, this is not necessarily true.

c)

c. All of the others

d)

d. There is no difference between an aggregation and a composition

23.

QN=23 (8222) Which of the following is NOT a standard aggregation operator?

a)

a. GROUP

b)

b. SUM

c)

c. COUNT

d)

d. AVG

24.

QN=24 (8238) Consider the law, that holds for set relations:
T intersect(R union S) = (T intersect R) union (T intersect S)
The above law still hold for bag relations?

a)

T

b)

F

25.

QN=25 (8236) Choose the correct statement:

a)

a. Aggregate functions perform a calculation on a set of values and return a single value

b)

b. Aggregate functions perform a calculation on a single value and return a single value

c)

c. Aggregate functions perform a calculation on a set of values and return a relation

d)

d. Aggregate functions perform a calculation on a set of values and return a row

26.

QN=26 (8507) 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

27.

QN=27 (8500) 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)

a. (9,12)

b)

b. (9,14)

c)

c. (9,16)

d)

d. (9,18)

28.

QN=28 (8509) Column A of a relation has the following list of values in the six rows of the table:

NULL, NULL, 10, 10, 20, 30

In SQL Server, which of the following is the correct value of
AVG(DISTINCT A)?

a)

a. 15

b)

b. NULL

c)

c. 20

d)

d. 10

29.

QN=29 (8513) 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)

a. (3,1,2)

b)

b. (1,3,4)

c)

c. (2,4,6)

d)

d. (3,2,6)

30.

QN=30 (8517) How we can understand about this statement:
"All aggregate functions are deterministic"?

a)

a. This means aggregate functions return the same value any time they are called by using a specific set of input values

b)

b. This means aggregate functions return the different values each time they are called by using a specific set of input values

c)

c. This means aggregate functions return the same value any time they are called by using any set of input values

d)

d. None of the others

31.

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

a)

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)

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)

c. All of the others

32.

QN=32 (8526) How many JOIN conditions are necessary to combine five tables based on common attributes?

a)

a. 1

b)

b. 2

c)

c. 3

d)

d. 4

33.

QN=33 (8528) 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)

a. (10,x)

b)

b. (30,y)

c)

c. (50,z)

d)

d. (70,t)

34.

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)

a. x = 5, y = 3, z = 10

b)

b. x = 3, y = 1, z = 10.

c)

c. x = NULL, y = 2, z = 10.

d)

d. x = NULL, y = 3, z = 10.

35.


QN=35 (8547) What operator tests column for the absence of data?

a)

a. IS BLANK operator

b)

b. IS ZERO operator

c)

c. IS NULL operator

d)

d. ISNULL operator

36.

QN=36 (8542) What does NULL mean?

a)

a. The value NULL means UNKNOWN

b)

b. The value NULL means '' (empty string)

c)

c. The value NULL means ' ' (space character)

d)

d. The value NULL means ZERO

37.

QN=37 (8550) What is the value of the query:
SELECT 'Nancy' + NULL + 'Smith'
when evaluated on Microsoft SQL Server?

a)

a. 'Nancy Smith'

b)

b. 'Nancy'

c)

c. 'NancySmith'

d)

d. NULL

38.

QN=38 (8557) Which SQL keyword is used to sort the result-set?

a)

a. ORDER BY

b)

b. SORT BY

c)

c. ORDER

d)

d. SORT

39.

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. (a) and (c) and (d) are true

b)

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

c)

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

d)

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

40.

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

a)

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)

b. "Durable" means that: Transactions must not violate any integrity constraints during its execution

c)

c. "Durable" means that: Transactions that have committed will survive permanently

d)

d. All of the others

41.

QN=41 (8569) Suppose relation R(A,B).
Choose the SQL statement that is equivalent to the following RA expression:


[file:8569.jpg]

a)

a. SELECT *
FROM R

b)

b. SELECT (A+B) AS C
FROM R
WHERE (A+B) > 10

c)

b. SELECT (A+B) AS C
FROM R
WHERE (A+B) > 10

d)

d. There is not any choice

42.

QN=42 (8575) What is the difference between the WHERE and HAVING SQL clauses?

a)

a. The WHERE and the HAVING clauses are identical

b)

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)

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)

d. None of the others

43.

QN=43 (8599) Choose the correct statement.

a)

a. You can remove a trigger by dropping it or by dropping the trigger table

b)

b. The syntax to remove a trigger is: DROP TRIGGER <trigger_name>

c)

c. Use ALTER TRIGGER to change the definition of a trigger

d)

d. All of the others.

44.

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)

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)

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)

45.

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)

a. ALTER TABLE Person
ALTER COLUMN City SET DEFAULT 'SANDNES'

b)

b. ALTER TABLE Person
EDIT COLUMN City SET DEFAULT 'SANDNES'

c)

c. ALTER TABLE Person
UPDATE COLUMN City SET DEFAULT 'SANDNES'

d)

d. ALTER TABLE Person
MODIFY COLUMN City SET DEFAULT 'SANDNES'

46.

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. (a) and (b) and (c) are true

b)

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

c)

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

d)

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

47.

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)

a. Unique key constraint

b)

b. Primary key constraint

c)

c. Foreign key constraint

d)

d. Candidate key constraint

48.

QN=48 (8600) What is difference between PRIMARY KEY and UNIQUE KEY ?

a)

a. A table can have more than one UNIQUE KEY constraint but only one PRIMARY KEY

b)

b. A table can have more than one PRIMARY KEY constraint but only one UNIQUE KEY

c)

c. UNIQUE KEY and PRIMARY KEY are the same

d)

d. None of the others

49.

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)

a. Index

b)

b. Trigger

c)

c. stored-procedure

d)

d. View

50.

QN=50 (8620) Select the most correct answer

a)

a. An index is a data structure used to speed access to tuples of a relation, given values of one or more attributes

b)

b. The key for index can be any attribute or set of attributes, and need not be the key of the relation

c)

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)

d. All of the others.

51.

QN=51 (8633) ___ allow the database application to find data fast, without reading the whole table

a)

a. Indexes

b)

b. Views

c)

c. Triggers

d)

d. Store-procedures

52.

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. (a) and (b) are true

b)

b. (a) and (c) are true

c)

c. (b) and (c) are true

d)

d. (b) and (d) are true

53.

QN=53 (8624) Well-designed ____ can reduce disk I/O operations and consume fewer system resources therefore improving query performance

a)

a. Triggers

b)

b. Indexes

c)

c. Views

d)

d. Stored Procedures

54.

QN=54 (9178) Which of the following statements is the most correct?

a)

a. Using Stored procedures reduces network traffic

b)

b. Using Stored procedures improves security

c)

c. Using Stored procedures improves performance

d)

d. All of the others

55.

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. (a) and (c) are true

b)

b. (a) and (b) are true

c)

c. (a) and (d) are true

d)

d. (b) and (d) are true

56.

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)

a. CREATE TABLE MovieStar (name StarType );

b)

b. CREATE TABLE MovieStar (name StarType PRIMARY KEY );

c)

c. CREATE TABLE MovieStar OF StarType ();

d)

d. None of the others

57.

QN=57 (9187) A ____ table is a table that is embedded within another table

a)

a. Nested

b)

b. Primitive

c)

c. Parent

d)

d. Child

58.

QN=58 (9195) A database of _____ data model is a collection of nodes, each node is either a leaf or interior

a)

a. semi-structured

b)

b. relational

c)

c. network

d)

d. object-relational

59.

QN=59 (9196) Select the well-formed XML.

a)

a. <? xml version = "1.0" ?>
<MovieData>
<Movie title="StarWar"><Year>1997</Year></Movie>
</MovieData>

b)

b. <? xml version = "1.0" ?>
<MovieData>
<Movie title="StarWar"><Year>1997</Year></Movie>
</Movies>

c)

c. <? xml version = "1.0" ?>
<MovieData>
<Movie title="StarWar"><Year>1997</Movie></Year>
</MovieData>

d)

d. All of the others.

60.

QN=60 (9211) A _____ specifies which characters are "less than" which other characters

a)

a. Domains

b)

b. Character set

c)

c. Collation

d)

d. Stored procedure

61.

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)

a. DBMS

b)

b. Database

c)

c. Excel

d)

d. None of the others

62.


QN=3 (6800) What is the hierarchical data model?

a)

a. A hierarchical data model is a data model in which the data is organized into a tree-like structure

b)

b. A hierarchical data model is a data model in which the data is organized into a table-like structure

c)

c. A hierarchical data model is a data model in which the data is organized into a graph-like structure

d)

d. None of the others

63.

QN=4 (6795) In _____ Data Model, the data and relations between them are organized in tables

a)

a. Relational

b)

b. Network

c)

c. Flat-file

d)

d. Object-oriented

e)

e. Tree-based

64.

QN=5 (6833) Why the intersection operator is not called a primitive relational algebra operator?

a)

a. Because the intersection operator can be expressed through the union operator and the difference operator

b)

b. Because the intersection operator can be expressed through the selection operator and the projection operator

c)

c. Because the intersection operator can be expressed through the product operator and the projection operator

d)

d. Because the intersection operator can be expressed through the selection operator and the product operator

65.

QN=6 (6814) In SQL , the command/statement that let you add an attribute to a relation schema is .......

a)

a. Insert

b)

b. Update

c)

c. Alter

d)

d. None of the others

66.

QN=7 (6826) To update a relation's schema, which one of the following statements can be used?

a)

a. ALTER TABLE

b)

b. SELECT

c)

c. INSERT

d)

d. UPDATE

67.

QN=8 (6832) Schema-altering commands are known as _________ commands.

a)

a. Data Definition Language

b)

b. Data Manipulation Language

c)

c. Data Controlling Language

d)

d. None of the others

68.

QN=10 (6830) Which one of the following is NOT a DML command?

a)

a. DELETE

b)

b. ALTER TABLE

c)

c. INSERT

d)

d. UPDATE

69.

QN=12 (7962) What is a functional dependency?

a)

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

b)

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

70.

QN=14 (7970) What is a key attribute in a relation?

a)

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

b)

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

71.

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

a)

a. R(ABCD) with FD's: BD -> C ; AB -> D ; AC -> B ; BD -> A

b)

b. R(ABCD) with FD's: BC -> A ; AD -> C ; CD -> B ; BD -> C

c)

c. R(ABCD) with FD's: A -> C ; B -> A ; A -> D ; AD -> C

d)

d. R(ABCD) with FD's: A -> D ; C -> A ; D -> B ; AC -> B

72.

QN=16 (7991) 3NFconcept is related to (choose 1 answer only):

a)

a. Atomic definition

b)

b. Full dependency definition

c)

c. Transitive dependency definition

d)

d. Super Key definition

e)

e. All of the others

73.

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)

a. R is in 3NF

b)

b. R is in 2NF only, not higher

c)

c. R is in 1NF only, not higher

d)

d. None of the others

74.

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)

a. R is in BCNF

b)

b. R is in 3NF

c)

c. R is in 2NF

d)

d. None of the others

75.

QN=19 (8002) Which of the following statements is correct?

a)

a. All relations in 3NF are also in BCNF

b)

b. For any relation schema, there is a dependency-preserving decomposition into 3NF

c)

c. All relations in 2NF are also in BCNF

76.

QN=20 (8005) Which of the following statements is true?

a)

a. BCNF condition guarantees the non existence of the anomalies.

b)

b. In BCNF condition, the left side of every non trivial FD must be a super key.

c)

c. Any two-attribute relation is in BCNF.

d)

d. All of the others.

77.

QN=21 (7995) How to eliminate anomalies when we design a database?

a)

a. We should decompose relation to eliminate anomalies

b)

b. We should join relations to eliminate anomalies

c)

c. We should union relations to eliminate anomalies

d)

d. None of the others

78.

QN=22 (7994) What is the goal of decomposition when designing a database?

a)

a. The goal of decomposition is to replace a relation by several relations that do not exhibit anomalies

b)

b. The goal of decomposition is to increase the speed of the database

c)

c. The goal of decomposition is to increase the security of the database

d)

d. None of the others

79.

QN=24 (8029) Consider the following statement:

"Entity Sets and their attributes should reflect the reality"

That above statement describes which principle?

a)

a. Avoid Redundancy Principle

b)

b. Simplicity Count Principle

c)

c. Limit the use of weak entity sets principle

d)

d. Faithfulness principle

80.

QN=25 (8010) 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. (a) and (b) are correct

b)

b. (a) and (c) are correct

c)

c. (a) and (d) are correct

d)

d. (b) and (c) are correct

81.


QN=26 (8017) The ER Diagram uses three principle element types:

a)

a. Entity sets, Attributes and Constraints

b)

b. Entity sets, Attributes, and Relationships

c)

c. Attributes, Constraints, and Relationships

d)

d. Entity sets, Constraints, and Relationships

82.

QN=27 (8030) The binary relationship between classes in UML is called ...

a)

a. Aggregation

b)

b. Composition

c)

c. Association

d)

d. Relation

83.


QN=28 (8231) Consider the Datalog rule H(x,y) <- S(x, 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)

a. H has a tuple (3, 5)

b)

b. H has a tuple (2, 3)

c)

c. H has 2 tuples (2, 3) and (3, 5)

d)

d. H has 3 tuples (2, 3) and (3, 5) and (4, 6)

84.

QN=30 (8232) Suppose that tuple t appears, respectively, x, y, and z times in the relations X, Y, and Z. Let t appear w times in the relation:
X union (Y intersect Z).
Which of the following inequalities is true ?

a)

a. w <= x+y

b)

b. w <= y+z

c)

c. w >= z

d)

d. w <= max(x,y)

85.

QN=33 (8522) The table Arc(x,y) currently has the following tuples (note there are duplicates):
(See picture)


Compute the result of the query:

SELECT x, COUNT(y)
FROM Arc
GROUP BY x;

Which of the following tuples is in the result?

[file:8522.jpg]

a)

a. (4,4)

b)

b. (4,5)

c)

c. (4,6)

d)

d. (4,7)

e)

e. (4,8)

86.

QN=34 (8501) 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)

a. (c,11)

b)

b. (c,13)

c)

c. (c,12)

d)

d. (c,18)

87.

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)

a. SELECT COUNT(*) FROM Employee

b)

b. SELECT DepartmentNo, COUNT(*) FROM Employee GROUP BY DepartmentNo

c)

c. SELECT DepartmentNo, COUNT(*) FROM Employee

d)

d. None of the others

88.

QN=36 (8505) 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

What row that appears in the result of the following query:

SELECT SUM(C), SUM(D)
FROM S
WHERE D < 9 AND D > 5

a)

a. (10,11)

b)

b. (10,12)

c)

c. (10,13)

d)

d. (10,14)

89.

QN=38 (8532) 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)

a. (null, null, 0, 1)

b)

b. (null, null, 5, 8)

c)

c. (8, 6, null, null)

d)

d. (4, 7, null, null)

90.

QN=39 (8531) 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)

a. (4, 7, null, null)

b)

b. (4, 7, 0, 1)

c)

c. (4, 7, 1, 0)

d)

d. (4, 7, 2, 1)

91.


QN=40 (8534) A tuple which fails to participate in a join is called:

a)

a. dangling tuple

b)

b. child tuple

c)

c. parent tuple

d)

d. neighbor tuple

92.

QN=41 (8538) (TRUE OR NULL) return:

a)

a. TRUE

b)

b. FALSE

c)

c. NULL

d)

d. None of the others

93.

QN=42 (8552) Choose one correct statement:

a)

a. Two null values are equal

b)

b. Comparisons between two null values, or between a NULL and any other value, return unknown

c)

c. Comparisons between two null values, or between a NULL and any other value, return FALSE

94.

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)

a. x = NULL, y = 0, z = 4.

b)

b. x = -2, y = -2, z = -2.

c)

c. x = 3, y = 0, z = 7.

d)

d. x = 2, y = -1, z = 6.

95.

QN=44 (8551) Choose one correct statement:

a)

a. No two null values are equal

b)

b. Two null values are equal

c)

c. Comparisons between two null values, or between a NULL and any other value, return FALSE

96.

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

a)

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)

b. "Isolated" means that: Transactions must not violate any integrity constraints during its execution

c)

c. "Isolated" means that: Transactions that have committed will survive permanently

d)

d. "Isolated" means that: how/when the changes made by one operation in one transaction become visible to other concurrent operations in other transactions

97.

QN=47 (8578) What one is a wildcard used for pattern matching?

a)

a. "%" (for multi-character substitution)

b)

b. "?" (for single character substitution)

c)

c. "?" (for multi-character substitution)

98.

QN=48 (8573) 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)

a. 0

b)

b. NULL

c)

c. 3

d)

d. 10

99.


QN=49 (8589) Choose the most correct statement about PRIMARY KEY:

a)

a. The PRIMARY KEY constraint uniquely identifies each record in a database table

b)

b. Primary keys must contain unique values

c)

c. A primary key column cannot contain NULL values

d)

d. Each table should have a primary key, and each table can have only ONE primary key

e)

e. All of the others

100.

QN=50 (8584) Foreign key constraints are created by using "_____" keyword to refer to the primary key of another table

a)

a. REFERENCES

b)

b. POINT TO

c)

c. REFER

d)

d. None of the others

101.

QN=52 (8616) The most useful index on a relation is an index on its key. This is because:

a)

a. The index on non key attribute(s) runs slower

b)

b. The search operation based on the primary key is commonly used.

c)

c. The index on non key attribute(s) makes update operations to the relation more complex and time-consuming

d)

d. All of the others

102.

QN=53 (9176) The SQL operations that are performed while a connection is active form a ____

a)

a. Session

b)

b. Catalog

c)

c. Module

d)

d. None of the others

103.

QN=54 (9171) In PSM, the difference between a stored procedure and a function is that:

a)

a. A function has the return statement.

b)

b. We can declare local variables in a function.

c)

c. Loops are not allowed in a function.

d)

d. All of the others.

104.

QN=55 (9182) 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)

T

b)

F

105.

QN=56 (9189) Choose the correct statement:

a)

a. A User-Defined Type (UDT) in SQL can be the type of a table

b)

b. A UDT can be the type of an attribute belonging to some table

c)

c. The form of UDT definition is: CREATE TYPE T AS (<primitive type | attribute declarations>)

d)

d. All of the others

106.


QN=57 (9192) ______ is a set of markup declarations that define a document type for SGML-family markup languages (SGML, XML, HTML)

a)

a. Document Type Definition

b)

b. Document Definition Language

c)

c. Document Manipulation Language

d)

d. Document Control Language

107.

QN=58 (9198) A ____ document defines the XML document structure with a list of legal elements and attributes

a)

a. XML

b)

b. DTD

c)

c. XSLT

d)

d. SGML

108.

QN=60 (9207) A ____ is the framework under which data may exist and SQL operations on data may be executed

a)

a. SQL Environment

b)

b. SQL Statement

c)

c. SQL Parser

d)

d. SQL Optimizer

109.

QN=1 (6807) What is a graph database?

a)

a. A graph database is a database that uses tree structures with nodes to represent and store information

b)

b. A graph database is a database that uses table structures to represent and store information

c)

c. A graph database is a database that uses graph structures with nodes, edges and properties to represent and store information

d)

d. None of the others

110.

QN=2 (6808) What is a database?

a)

a. A database is a collection of information that is organized so that it can easily be accessed, managed, and updated

b)

b. A database is a collection of data files

c)

c. A database is a collection of records

d)

d. A database is a collection of tuples

111.

QN=4 (6793) 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)

a. MSSQL

b)

b. DBMS

c)

c. DBS

d)

d. DB2

112.


QN=5 (6810) Today, the two important data models are:

a)

a. The semi-structured data model (including XML and related standards) and the network data model

b)

b. The relational data model (including object-relational extensions) and the semi-structured data model (including XML and related standards)

c)

c. The network data model and the flat file data model

d)

d. The flat file data model and the semi-structured data model (including XML and related standards)

113.

QN=6 (6798) Today, in a modern DBMS, the queries are parsed and optimized by

a)

a. all of the others

b)

b. execution engine

c)

c. buffer manager

d)

d. query compiler

114.

QN=9 (6806) A person who is responsible for the structure or schema of the database is called:

a)

a. an end user

b)

b. a database administrator

c)

c. a database analyst

d)

d. all of the others

115.

QN=10 (6809) A database administrator (DBA) is a person that is also known by the title:

a)

a. Database Analyst

b)

b. Database Tuner

c)

c. Database Coordinator or Database Programmer

d)

d. Database Modeller

116.

QN=12 (6816) Data Definition language (DDL) is used to ......

a)

a. query database and modify the database

b)

b. connect to database and query database

c)

c. declare database schemas

d)

d. All of the others

117.

QN=13 (6815) Which is the subset of SQL commands used to manipulate Database structures, including tables?

a)

a. DDL (Data Definition Language)

b)

b. DML (Data Manipulation Language)

c)

c. DCL (Data Control Language)

d)

d. All of the others

118.

QN=14 (6818) Which of the followings is part of data model?

a)

a. Structure of the data

b)

b. Operations on the data

c)

c. Constraints on the data

d)

d. All of the others

119.

QN=15 (6823) "R(A,B,C,D)" is an example of:

a)

a. A schema

b)

b. A relation

c)

c. A relation instance

d)

d. A schema instance

120.

QN=16 (6813) Which statement is used to remove a column named D from the relation R?

a)

a. ALTER TABLE R DROP COLUMN D;

b)

b. ALTER TABLE R DROP COLUMN D [DataType];

c)

c. ALTER TABLE R DELETE COLUMN D;

d)

d. ALTER TABLE R DELETE COLUMN D [DataType];