Worksheetsquiz DBI202
Total questions: 40
Worksheet time: 40mins
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
Database
Database Instance
Schema
Schema Instance
Choose the most correct statement.
Database is created and maintained by a DMBS
All of the others
Database is a collection of data that is managed by a DBMS
Database is a collection of information that exists over a long period of time
To create a DEFAULT constraint on the "City" column of the table PERSON which is already created, use the following SQL:
ALTER TABLE Person
EDIT COLUMN City SET DEFAULT 'Da Nang'
ALTER TABLE Person
ALTER COLUMN City SET DEFAULT 'Da Nang'
ALTER TABLE Person
UPDATE COLUMN City SET DEFAULT 'Da Nang'
ALTER TABLE Person
MODIFY COLUMN City SET DEFAULT 'Da Nang'
A ____ is a relation name, together with the attributes of that relation.
schema
database
database instance
schema instance
A ___ is a notation for describing the structure of the data in a database, along with the constraints on that data
data model
database management system
data operation
data manipulation
A _____ is a language for defining data structures
DML
DDL
DCL
None of the others
Which statement is used to remove a relation named R?
DROP TABLE R;
REMOVE TABLE R;
DELETE TABLE R;
TRUNCATE TABLE R;
What is another term for a row in a relational table?
Attribute
Tuple
Field
Relation
Given a relation R(A,B,C,D). Which of the followings is trivial?
A->AB
A->->AB
A->BCD
A->->BCD
Let R(ABCD) be a relation with functional dependencies{A -> B,C -> B,B -> D}What is the key for R (choose one)
AB
AC
AD
BD
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?
4
8
12
16
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)?
R is in First Normal Form
R is in Second Normal Form
R is in Third Normal Form
R is in Boyce Codd Normal Form
The relation R(ABCD) has following FDs:{ A -> B ; B -> A ; A -> D ; D -> B }
R is in 3NF
R is not in 3NF
R is not in 2NF
None of the others
Choose the correct statement.
You can remove a trigger by dropping it or by dropping the trigger table.
The syntax to remove a trigger is: DROP TRIGGER <trigger_name>
Use ALTER TRIGGER to change the definition of a trigger
All of the others
To create a DEFAULT constraint on the "City" column of the table PERSON which is already created, use the following SQL:
ALTER TABLE Person
ALTER COLUMN City SET DEFAULT 'SANDNES'
ALTER TABLE Person
EDIT COLUMN City SET DEFAULT 'SANDNES'
ALTER TABLE Person
UPDATE COLUMN City SET DEFAULT 'SANDNES'
ALTER TABLE Person
MODIFY COLUMN City SET DEFAULT 'SANDNES'
A(an) _____ asserts that a value appearing in one relation must also appear in the primary-key component(s) of another relation
Unique key constraint
Primary key constraint
Foreign key constraint
Candidate key constraint
What is difference between PRIMARY KEY and UNIQUE KEY ?
A table can have more than one UNIQUE KEY constraint but only one PRIMARY KEY
A table can have more than one PRIMARY KEY constraint but only one UNIQUE KEY
UNIQUE KEY and PRIMARY KEY are the same
None of the others
Select the most correct answer
An index is a data structure used to speed access to tuples of a relation, given values of one or more attributes
The key for index can be any attribute or set of attributes, and need not be the key of the relation
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
All of the others
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)
)
CREATE TABLE MovieStar (name StarType );
CREATE TABLE MovieStar (name StarType PRIMARY KEY );
CREATE TABLE MovieStar OF StarType ();
None of the others
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
DBMS
Database
Excel
None of the others
What is the hierarchical data model?
A hierarchical data model is a data model in which the data is organized into a tree-like structure
A hierarchical data model is a data model in which the data is organized into a table-like structure
A hierarchical data model is a data model in which the data is organized into a graph-like structure
None of the others
"R(A,B,C,D)" is an example of:
A schema
A relation
A relation instance
A schema instance
Which statement is used to remove a column named D from the relation R?
ALTER TABLE R DROP COLUMN D;
ALTER TABLE R DROP COLUMN D [DataType];
ALTER TABLE R DELETE COLUMN D;
ALTER TABLE R DELETE COLUMN D [DataType];
What is a primary key?
A primary key is the field(s) in a table that uniquely defines that table in a database
A primary key is the field(s) in a table that is used to establishes a relationship between two tables
A primary key is the field(s) in a table that uniquely defines the row in the table
A primary key is the field(s) in a table that is used to establishes a relationship between two databases
A ____ is a relation name, together with the attributes of that relation.
schema
database
database instance
schema instance
Which statement is used to add a column named D into the relation R?
ALTER TABLE R ADD D [DataType];
ALTER TABLE R ADD ATTRIBUTE D [DataType];
ALTER TABLE R ADD PROPERTY D [DataType];
Which one of the following is NOT a DML command?
DELETE
GRANT
INSERT
UPDATE
What is another term for a row in a relational table?
Attribute
Tuple
Field
Relation
The relational operator that adds all possible pairs of rows from two tables is known as the .... operator.
union
product
join
selection
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?
CGH -> BF
ACG -> DH
ADG -> CH
BCD -> FH
What is a functional dependency?
A functional dependency (A->B) occurs when the attribute A uniquely determines B
A functional dependency (A->B) occurs when the attribute B uniquely determines A
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?
BD
BC
D
AB
Given the relation schema R(A,B,C) and functional dependencies
F = {AB-> C, B->A, C->B}.
Which attribute(s) is/are prime?
only A
only B
A and B
B and C
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?
ABCDE
CDE
ABE
BD
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?
4
8
12
16
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
Key
Foreign Key
Index Key
Trigger Key
The relation R(ABCD) has following FDs:
{ A -> B ; B -> A ; A -> D ; D -> B }
R is not in 2NF
R is not in 3NF
R is in 3NF
None of the others
The relation R(ABCD) has following FDs:
{ACD -> B ;
AC -> D ;
D -> C ;
AC -> B}
Choose the correct statement about R:
R is in 3NF
R is in 2NF only, not higher
R is in 1NF only, not higher
None of the others
Suppose we have a relation R(ABCD) with FD's:
BC -> A ;
AD -> C ;
CD -> B ;
BD -> C.
R is in BCNF
R is not in BCNF
All of the others
None of the others
Let R(A,B,C,D) with the following FDs:
{AB->C, AC->B, AD->C}
R is in BCNF
R is in 3NF
R is in 2NF
None of the others
