Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

quiz DBI202

Total questions: 40

Worksheet time: 40mins

Name
Class
Date
1.

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)

Database

b)

Database Instance

c)

Schema

d)

Schema Instance

2.

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

3.

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

EDIT COLUMN City SET DEFAULT 'Da Nang'

b)

ALTER TABLE Person

ALTER COLUMN City SET DEFAULT 'Da Nang'

c)

ALTER TABLE Person

UPDATE COLUMN City SET DEFAULT 'Da Nang'

d)

ALTER TABLE Person

MODIFY COLUMN City SET DEFAULT 'Da Nang'

4.

A ____ is a relation name, together with the attributes of that relation.

a)

schema

b)

database

c)

database instance

d)

schema instance

5.

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

6.

A _____ is a language for defining data structures

a)

DML

b)

DDL

c)

DCL

d)

None of the others

7.

Which statement is used to remove a relation named R?

a)

DROP TABLE R;

b)

REMOVE TABLE R;

c)

DELETE TABLE R;

d)

TRUNCATE TABLE R;

8.

What is another term for a row in a relational table?

a)

Attribute

b)

Tuple

c)

Field

d)

Relation

9.

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

a)

A->AB

b)

A->->AB

c)

A->BCD

d)

A->->BCD

10.

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.

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.

Consider the following functional dependencies

e,g,h -> f,j

p,q -> r,s

e,f,g -> h,i

f,g -> j

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

13.

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

a)

R is in 3NF

b)

R is not in 3NF

c)

R is not in 2NF

d)

None of the others

14.

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

15.

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'

16.

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

17.

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

18.

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

19.

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

20.

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

21.

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

22.

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

a)

A schema

b)

A relation

c)

A relation instance

d)

A schema instance

23.

Which statement is used to remove a column named D from the relation R?

a)

ALTER TABLE R DROP COLUMN D;

b)

ALTER TABLE R DROP COLUMN D [DataType];

c)

ALTER TABLE R DELETE COLUMN D;

d)

ALTER TABLE R DELETE COLUMN D [DataType];

24.

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

25.

A ____ is a relation name, together with the attributes of that relation.

a)

schema

b)

database

c)

database instance

d)

schema instance

26.

Which statement is used to add a column named D into the relation R?

a)

ALTER TABLE R ADD D [DataType];

b)

ALTER TABLE R ADD ATTRIBUTE D [DataType];

c)

ALTER TABLE R ADD PROPERTY D [DataType];

27.

Which one of the following is NOT a DML command?

a)

DELETE

b)

GRANT

c)

INSERT

d)

UPDATE

28.

What is another term for a row in a relational table?

a)

Attribute

b)

Tuple

c)

Field

d)

Relation

29.

The relational operator that adds all possible pairs of rows from two tables is known as the .... operator.

a)

union

b)

product

c)

join

d)

selection

30.

Let R(ABCDEFGH) satisfies the following functional dependencies:

A -> B,

CH -> A,

B -> E,

BD -> C,

EG -> H,

DE -> F.

Which of the following FDs is also guaranteed to be satisfied by R?

a)

CGH -> BF

b)

ACG -> DH

c)

ADG -> CH

d)

BCD -> FH

31.

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

32.

Consider a relation with schema R(A, B, C, D) and FD's BC -> D, D -> A, A -> B. Which of the following is the key of R?

a)

BD

b)

BC

c)

D

d)

AB

33.

Given the relation schema R(A,B,C) and functional dependencies

F = {AB-> C, B->A, C->B}.

Which attribute(s) is/are prime?

a)

only A

b)

only B

c)

A and B

d)

B and C

34.

Given the relation R(ABCDE) with the following FD's:

D -> C,

CE ->A,

D ->A,

and AE ->D.

Which of the following attribute set is a key?

a)

ABCDE

b)

CDE

c)

ABE

d)

BD

35.

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

36.

A set of attributes forms a ____ for a relation if we do not allow 2-tuples in a relation instance to have the same values in all that attributes

a)

Key

b)

Foreign Key

c)

Index Key

d)

Trigger Key

37.

The relation R(ABCD) has following FDs:

{ A -> B ; B -> A ; A -> D ; D -> B }

a)

R is not in 2NF

b)

R is not in 3NF

c)

R is in 3NF

d)

None of the others

38.

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

39.

Suppose we have a relation R(ABCD) with FD's:

BC -> A ;

AD -> C ;

CD -> B ;

BD -> C.

a)

R is in BCNF

b)

R is not in BCNF

c)

All of the others

d)

None of the others

40.

Let R(A,B,C,D) with the following FDs:

{AB->C, AC->B, AD->C}

a)

R is in BCNF

b)

R is in 3NF

c)

R is in 2NF

d)

None of the others