DBI 202 Exam Questions with 100%
Correct Answers
Which of the following is the correct definition of a procedure:
a. Create procedure () returns ;
b. All of the others
c. Create procedure () ;
d. Create procedure () returns return ; - ✔ ✔ B
Which statement is true?
a. All xml documents must have a dtd
b. All of the others
c. All xml elements must be properly closed
d. All xml elements must be lower case - ✔ ✔ C
Select the wrong statement
a. None of the others
b. An index can be created in a table to find data more quickly and
Efficiently c. A table can have only one index
d. The key for index can be any attribute or set of attributes, and Need not be the key of
the relation - ✔ ✔ C
,Consider a relation with schema r(a, b, c, d) and the set of fds: bc ->
D, d -> a, a -> b. Compute {ac}+
a. {a, c, d}
b. {a, b, c}
c. {a, c}
d. {a, b, c, d} - ✔ ✔ D
Question 33
Consider a relation with schema r(a, b, c) and the set of fds: a -> b, a
-> c, b -> a, b -> c, c -> a, c -> b, ab -> c, bc -> a, ac -> b, a -> Bc, b ->
ac, c -> ab. Find a minimal basis for relation r.
a. A -> b, b -> c, c -> a
b. All of the others
c. Ac -> b, bc -> a
d. Ac -> b, bc -> a, a -> bc - ✔ ✔ A
Choose the wrong statement
a. A user defined type (udt) can be the type of a
table b. None of the others
c. A user defined type can be the type of an attribute belonging to Some
table d. A user defined type (udt) cannot be the type of a table - ✔ ✔ D
,A type of an attribute that can be used as pointer to a user-defined
Type (udt) is called ______
a. Pointer types
b. None of the others
c. Reference types
d. Linking types - ✔ ✔ C
Which of the following is not a valid privilege in sql?
a. Procedure
b. Trigger
c. Execute
d. References - ✔ ✔ A
In the three-tier architecture, the function of the application tier
is To _______
a. Execute the business logic of the organization operating the
database b. All of the others
c. Perform queries and modifications at the request of the application
Servers d. Manage the interactions with the user - ✔ ✔ A
Select the right statement
, a. Updating views are allowed if query involves a single base relation and contains a candidate
key of base relation
b. Updating views are allowed if query involves aggregation or grouping
operations c. Updating views are allowed if query involves multiple base relations.
d. All of the others - ✔ ✔ A
Given table moviestar defined as follows: create table moviestar( name
Char(30) primary key, address varchar(256), gender char(1) check (gender
In ('m','f')), birthdate date not null ) which of the following query is
Not valid?
a. Insert into moviestar values ('tom cruz', '123 little rd, la city','m', null);
b. Insert into moviestar(name, gender, birthday) values ('tom cruz','M', '1973-09-12 00:00:00');
c. Insert into moviestar values ('tom cruz', null, 'm', '1973-09-12 00:00:00');
d. Insert into moviestar(name, address, gender, birthday) values ('tomCruz', null, 'm', '1973-09-
12 00:00:00'); - ✔ ✔ A
Suppose the relation tblemployee(employeeid, employeename, salary,
Department). Consider the following code in sql server 2005:
Declare @employeeid int, @employeename nvarchar(50), @salary decimal(10,0);
Declare mycursor cursor for select employeeid, employeename, salary from
Tblemployee where department=1;
Open mycursor;
Fetch next from mycursor into @employeeid,@employeename,@salary;
If @@fetch_status <> 0
Print '<<none>>';
While @@fetch_status = 0
Begin