Database Systems - Paper I-1
Database Systems - Paper I-1
1) One type of database users would be practitioners. Which statements is/are true regarding
practitioners?
(a) more than one conceptual schema. (b) several external schemas.
(c) several physical schemas. (d) exactly one conceptual schema.
(e) exactly one external schema.
(a) making changes at the physical level without affecting the conceptual level.
(b) making changes at the conceptual level without affecting the physical level.
(c) making changes at the external level without affecting the conceptual level.
(d) making changes at the conceptual level without affecting the external level.
(e) making changes at the physical level without affecting the external level.
5) Which of the following statement(s) is/are correct with respect to DBMS languages?
6) Which of the following constraints is/are inherent model based constraints with respect to the
relational model?
2
7) Which of the following is/are true with respect to the database design process?
What would you get when entity B is mapped to the corresponding relation(s), where B_E is a
possible representation for attribute e of entity B?
DateofBirth Age
1 N
Doctor has Patient Address
What would you get when Patient in the above ER diagram maps to the corresponding relation(s)?
3
Consider the following scenario to answer the question from (10) – (13)
Pharmaceutical companies produce drugs and the trade name identifies each drug
uniquely with respect to each company. Each pharmacy sells several drugs and has a
price for each. A drug could be sold at several pharmacies at a fixed price. A
pharmaceutical company can contract with several pharmacies, and a pharmacy can
contract with several pharmaceutical companies. For each contract, it is necessary to
store a start date, an end date and the text of the contract.
10) In the corresponding conceptual database model, how could the contract be represented?
11) Based on the given scenario, how would the price be represented?
12) If the price of each drug could vary from one pharmacy to another, how would the price be
represented?
13) Based on the given scenario if it is necessary to maintain the price history of each drug along with
the effective date of each price, which of the following statement(s) is/are correct?
14) Which of the following sets of operations represent the operations defined specifically for
relational databases?
(a) Union, intersection and set difference (b) Set Difference and Cartesian Product
(c) Union and Cartesian Product (d) Selection, Projection and Join
(e) Selection, Projection and Cartesian
Product
4
Consider the following university schema to answer the questions from (15) to (22). Primary
Keys are underlined and Foreign Keys are in italics. Lecturers can teach courses offered by
other departments as well.
15) Consider the sequence of operations given below on the above relations.
(i) RESULT1 πCNo (σDNo=3 ( Course))
(ii) RESULT2 Deliver ÷ RESULT1
(iii) RESULT πName (RESULT2 ⋈ EmpNo=EmpNo Lecturer)
What will the above sequence of operations performed on the given relations produce?
(a) Find the names of Lecturers who are working for department No.3 and all the courses
delivered by them.
(b) Find the names of Lecturers who are delivering any course offered by department No.3.
(c) Find the names of Lecturers who are not delivering any course offered by department No.3.
(d) Find the names of Lecturers who are delivering all the courses offered by department No. 3.
(e) Find the names of Lecturers who are delivering only the courses offered by department No.3.
16) Which of the following sequence of operations would list the names of department heads who
have at least one research fund?
5
17) List the EmpNo, Name and Category of all the lecturers and the department name of all heads of the
department. Which of the following sequence of operations would perform that?
18) Which of the following sequence of operations would find the names of lecturers who have no
research fund?
19) Two queries given in (I) and (II) below were written to achieve the following:
For each department that has more than five lecturers retrieve the department name and the
number of its lecturers who are earning a salary more than Rs.40,000.
Which of the following statements is/are correct with respect to the above two queries?
6
20) It is necessary to create a view called Head_Funds to display the EmpNo, Name, Salary and the
No_of_RFunds (Research Funds) of the department heads who control more than one research fund.
Which of the following statements would achieve it?
21) One tries to execute the following SQL statements on the Head_Funds view created in question
(20) above.
(i) SELECT COUNT(No_of_RFunds) FROM Head_Funds;
(ii) SELECT * FROM Head_Funds WHERE No_of_RFunds >2;
(iii) CREATE VIEW Head_Fund1 AS
SELECT EmpNo, Salary, No_of_RFunds
FROM Head_Funds WHERE Salary >50000;
7
22) Which SQL statement would display the EmpNo and Names of all lecturers along with the total
sum of the research funds (TotalFund) if a lecturer controls some research fund? Otherwise
TotalFund should be kept blank or NULL.
Consider the following Lecturer relation with the given attributes and data types to answer
questions from (23) to (27). Assume that the attributes are stated in the order that they were
specified in the create table statement. Salary and Income are monthly income for a lecturer.
23) Which of the following SQL statements display the name and annual income for each lecturer?
24) Which of the following SQL statements would display all Lecturers’ names and hired dates in
chronological order with the person on staff with the longest service, listed first?
8
25) Consider the following details of a Lecturer. Note SYSDATE returns the current system date.
Which of the following SQL statements will insert the above data into Lecturer relation?
26) Consider the following two queries to display the Lecturer’s name and also the name of the
Lecturer’s research supervisor in alphabetical order.
(a) Both queries will display the Lecturer’s name and also the name of the Lecturer’s
supervisor in alphabetical order.
(b) Output of the two queries will be different.
(c) Only query (I) will give the required results.
(d) Only query (II) will give the required results.
(e) Neither query (I) nor query (II) will give the required results.
27) Which of the following SQL statements will increase the Salary by Rs: 3000/= for Lecturers who
are categorised as Senior Lecturers?
(a) UPDATE Lecturer SET Salary = Salary + 3000 WHERE Category = ‘Senior Lecturer’;
(b) UPDATE Salary SET Salary = Salary + 3000
FROM Lecturer WHERE Category = ‘Senior Lecturer’;
(c) UPDATE Lecturer SET Salary = Salary + 3000 WHERE EmpNo
IN (SELECT EmpNo FROM Lecturer WHERE Category = ‘Senior lecturer’);
(d) UPDATE SET Salary + 3000 FROM Lecturer WHERE Category = ‘Senior lecturer’;
(e) UPDATE SET Salary = Salary + 3000 FROM Lecturer WHERE Category = ‘Senior
lecturer’;
9
28) Which of the following statements is/are correct with respect to views?
(a) Any view defined using a single table is updateable.
(b) Query materialization is efficient for views defined via complex queries which are time
consuming to execute.
(c) The clause WITH CHECK OPTION is used to materialize views.
(d) The view mechanism provides support for physical data independence in the relational model.
(e) The DROP VIEW command will drop a view along with the other views which are defined
on the view that is being dropped.
We execute the following sequence of modifications. Some of them may be rejected due to the
constraints in the relation.
(i) INSERT INTO Employee VALUES ('Dias', 12000);
(ii) UPDATE Employee SET Salary = 50000 WHERE Name = 'Silva';
(iii) INSERT INTO Employee VALUES (‘Perera’, 13000);
(iv) DELETE FROM Employee WHERE Name = 'Costa';
At the end of these statements, the sum of the Salaries over all the tuples in Employee relation is:
Note: NVL function lets you substitute a value when a NULL to value is encountered.
(i) SELECT AVG(Commission) FROM Employee;
(ii) SELECT AVG(NVL(Commission,0)) FROM Employee;
(iii) SELECT SUM(Commission)/COUNT(*) AS Avg_Com FROM Employee;
(iv) SELECT SUM(Commission)/COUNT(Commission) AS Avg_Com FROM Employee;
(a) (i) and (iii) will give the same results. (b) All (i) to (iv) will give the same results.
(c) (i) and (iv) will give the same results. (d) (ii) and (iii) will give the same results.
(e) (iii) and (iv) will give a syntax error.
10
31) Suppose relation R1(A,B) has tuples {(a,b), (a,b), (c,d)}, and relation R2(B,C) has tuples {(b,e),
(b,e), (d,f), (g,h)}.
Consider the following SQL query.
What is the number of tuples in the result of the above SQL query?
32) Consider the relation R1(A,B) which has got duplicate tuples as given below.
A B
12 10,000
12 10,000
12 25,000
14 20,000
14 25,000
Based on the tuples given in R1 which of the following queries has a result that does not produce
duplicates?
Consider the relation R1(A,B,C,D,E) with the given Functional Dependencies to answer
questions from (33) to (35).
CE D, D B, C
A
35) Which of the following statements is/are true with respect to the decomposition of R1 for BCNF?
11
36) Consider the relation Faculty(Facid, Fname, Office, Phone) with functional dependencies
Facid Fname, Office, Phone
Office Phone
What is the best normal form that Faculty satisfies?
37) Consider the relation Employee(Empid, NIC, Ename, Address, Salary) with the following
functional dependencies
Empid NIC, Ename, Address, Salary
NIC Empid, Ename, Address, Salary
38) Consider the relation Inventory(PartNo, Warehouse, Location, Qty-on-hand, Weight, Colour) with
the following functional dependencies.
FD1 : PartNo Weight, Colour
FD2 : (PartNo , Warehouse) Qty_on_hand
FD3: Warehouse Location
This decomposition
12
Consider the scenario given below to answer questions from (40) to (42)
User1 who works for a bank creates Account_detail relation and Grants Select on all of its
attributes and grants Update privilege on the attribute acct_balance to User2 with Grant
Option. User2 then creates a view called Savings by selecting all the attributes of the
Account_detail using Acct_type = “Savings” as the selection criteria. User2 gives User3 the
Select privileges on all the attributes of Savings view with Grant Option. User3 defines a view
called Fine_Customers through selecting Savings view for acct_balance over Rs 5,000,000
along with the clause ‘With Check Option’.
40) What happens if User1 revokes the Select privilege on Account_detail from User2?
(a) User2 is unable to Select/Update from Account_detail but he is able to Select/Update from
the view Savings.
(b) User3’s privileges will also get revoked, but Fine_Customers View remains intact.
(c) The View Savings will get dropped.
(d) User1 is unable to revoke User2’s privilege even if CASCADE clause is used since two
views have been created based on the privileges of User2.
(e) The View Fine_Customers will get dropped.
41) Suppose that instead of revoking privileges from User2, User1 decides to give Insert privileges on
Account_detail to User2 with Grant Option. Which of the following statements is/are true?
(a) User2 will automatically get Insert privileges on the View Savings.
(b) Insert privilege is not applicable on Savings since that privilege was not there at the creation
time of the Savings view.
(c) User2 acquires insert privileges on Savings and as a result, User3 also acquires insert
privileges on Fine_Customers.
(d) User3 will not get insert privilege unless User2 grants that privilege to User3.
(e) If User3 gets insert privileges, he is able to insert rows into the Account_detail relation.
(a) Grant permission to X1, only to retrieve data from Account_detail relation and grant
permission to X2, only to update the acct_balance from Account_detail relation.
(b) Grant permission to X1 and X2 to retrieve data from Account_detail table.
(c) Grant permission to X1 in order to grant, select and update permission to X2.
(d) Grant permission to X1 and X2 to update acct_balance of customers in the Account_detail
relation.
(e) Grant permission to X1 and X2 to update all data except acct_balance in Account_detail
relation.
(a) In a client-server system, server is responsible for managing data and transaction
execution.
(b) In a distributed database system, data replication will be slower than the query evaluation.
(c) The middleware layer maintains data relevant to the frequently used queries.
(d) The middleware layer coordinates the execution of queries across database servers.
(e) Data fragmentation in distributed databases will always increase message-passing cost.
13
44) Consider the following statements with respect to accessing a database from an application program.
(i) Dynamic SQL Commands involve runtime overhead and hence should limit the use of dynamic
SQL.
(ii) Embedded SQL enables to execute dynamic queries at run time.
(iii) Cursors are declared to retrieve rows one at a time from a relation.
(a) (i) only. (b) (i) and (iii) only. (c) (ii) and (iii) only.
(d) All. (e) (iii) only.
(a) Data mining helps in extracting meaningful new patterns from a vast amount of data.
(b) Data mining cannot be applied to operational databases.
(c) Data mining only allows us to view information along a single dimension.
(d) Data mining allows analyzing data by categorization and summarization of data.
(e) A successful use of data mining applications will depend first on the construction of a data
warehouse.
********
14