0% found this document useful (0 votes)
38 views8 pages

B.Sc. H Computer SC RYNrJ3F

Uploaded by

mohit1022005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views8 pages

B.Sc. H Computer SC RYNrJ3F

Uploaded by

mohit1022005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

4095 t6 [This question paper contains l6 printed pages.

amount, destination, and final delivery date. Your Roll No..,.....,..,...


Shipped items are received into the system at a
single retail center. RetaiI centers are characterized Sr. No. of Question Paper: 4095 H
by their type, unique ID, and address. Shipped
items arrive al their destination via one or more Unique Paper Code 2342012402
standard transportation events (i.e., flights, truck
) )
deliveries). These transportation events are N amc of the Paper Database Management Systems
characterized by a unique schedule number, a type
(e.g., flight, truck), and a deliveryRoute. Name of the Course : B.Sc. (H) Computer Science

Create an Entity Relationship diagram that -


Semester IV
captures this information about the company. Also,
indicate the primary key, cardinality, and Duration : 3 Hours Maximum Marks : 90
participation constraints. (8)

Instructions for Candidates


cor
J AN

Write your Roll No. on the top imm


of this question paper. v
* * U

) ) Section A is compulsory.
t,
ew Delh\
J Attempt any FOUR questions from Section B

4. Parts of a question should be attempted together

(1500) P.T.O.
409s 2 4095 15

Section A 7 (a) How does multilevel indexing improve the


efficiency of searching an index file? (3)
(a) Consider the following Entity Relationship diagram
(b) Suppose that we have an ordered file with
(ERD) for a ternary relationship ProjGuide. Map
r - 10,000 records stored on a disk. The records
the given ER diagram to a relation schema.
are of fixed size and are unspanned. The search
(3) ) key field in each record is V:9 bytes long. The
Ee,BA! remaining attributes of the record are 91 bytes in
total. The block size for the disk is B -- 1024
n!fd b ytes.
S.Lrt CndX
Edldr
Compute the following :

(i) record length (R)


(ii) blocking factor (bfr)

(iii) number of file blocks (b)


(b) Consider the following SQL statements : (3)
(iv) number of block accesses required during
(D CREATE TABLE binary search on the data (4)

(ii) SELECT ) )
(c) ABC shipping company prides itselfon having up-
(iiD INSERT to-date information on the processing and current
location of each shipped item. To do this, the
(iv) CREATE VIEW company relies on its database management
system.
(v) DELETE
Shipped items can be characterized by item
(vi) ALTER TABLE number (unique). weight, dimensions, insurance

P.T.O
409s 4 4095 13

TRIP (triplD, SSN,fromCity, toCity, departureDate,


Dale
returnDate)

EXPENSE. (tripID, accountNo, amount) Longilud6

Latilud6

The sales office maintains multiple bank accounts.


HISTORY
A trip can be charged to one or more accounts. ) )
Specify the foreign keys for the above relations.
N
TYPE

(e) Consider the following relations R and S : (3)

R
(c) Consider the following two tables, Tl and T2:
A B c D B D E
(6)
15 1 15 a 1 a 15

20 2 25 a 3 20 T1 T2
P a R A B c
25 A 20 b 1 a z5 10 a 5 10 b 6
15 b 8 15 c 3
15 1 25 a 2 b 30 25 a 6 10 b 5

30 2 20 b 3 b null
) ) Show the results of the following operations :

Show the output for the following relational


statements:
(i) p, (rl x T2)
(ii) rl - 12
(r) R X *.r:.." S

(iii) Tl T2
(iD R >< S ^
".="."

P.T.O
4095 t4 409s 3

6 (a) Compare and contrast the traditional file For each of the above commands, indicate whether
processing approach with the database approach it is a Data Mani.pulation Language (DML)
in the context of the self-describing nature of the command, Data Definition Language (DDL)
database system. (2) command, or View Definition Language (VDL)
command.
(b) WhV can a database allow at most one primary
) )
index on a file but several secondary indexes? (c) Consider the following relations (3)
(3)
Employee(empID: inteeer, deptID: integer,
(c) Consider a relation R with three attributes {A, B,
empSalary: integer, empHobby: char (20))
C). It is decomposed into relations Rl with
attributes {A, B} and R2 with attributes {B, C}. Department(deotID: inteeer, deptName: char (20),
State the condition (using relational algebra deptFloor: integer)
notation) that should be met for this decomposition
to satisfy lossless-join property. (4) Which attributes will appear in the output on
executing the following SQL queries?
(d) Considering the below given state of R(A, B, C, D) :
(0 SELECT * FROM Employee E NATURAL
(6)
A B c D
JOIN Department D;
1 2 3
1 2 5
5 7 I 2
(i0 SELECT * FROM Employee E, Department
, ) )
1 3 4 D WHERE E.deptID = D.deptID;

Which of these FDs may hold on R? Justify your


(d) Consider the following relations for a database
answer.
that keeps track of business trips of salespersons
(i)D-+A working in a sales office: (3)

(ii) BC -+ D
SALESPERSON (SSN, name, j oining Date,
(iii) BC -+ A supervisorSSN)

P. T. O,
40 95 6 4095 11

(c) Consider the following relation schema: (9)


Tlmestamp T1 r2
1 read (x) Student (sNum: inteser, sName: string, major:
2 x-x+10 string, level: string, age: integer)
3 Read (X)
4 X=X+20 Class (cName: strinq, room: string, flD: integer)
5 write (x) Enrolled (sNum: inteeer. cName: strine)
6 Write (x) ) )
7 corunlt
I Corr[IIit Write SQL statements to perform the following

(i) Find the names of all classes that either


(i) Consider the following relation Studentcourse. meet in room 'R12' or have five or more
(3) students enrolled.

StudentCourse
(ii) For all levels except'JR', display the level
studentrD studentNan€ CGPA cours6ID and the average age of students for that
123 shyan s lcrre lc*. I
I level.
t32 shyan 8.5 c121 .rava 4
(iii) Find the names of students not enrolled in
131 lrohan lcrre C++ 4
any class.
135 vIJay e l"tre lc** 4

Which of the following commands result in an


5. (a) Consider the following relational schema: (3)
) )
update anomaly? Justify your answer. retiredEm 1o
mPID asicSalary eptName yGrad
lempName
(i) DELETE FROM StudentCourse WHERE
or Fjnur l2 5000 lq,relgg tsEc
studentlD : 132 oz Fotut s000 13 hdmin lpEP
ros Naman Esooo lResearch laec
(ii) UPDATE Studentcourse SET credits = 3 04 jlsree ee F4oooo lrLnance loer
WHERE courselD : 118
105_-]otreeraj
lPranay 22000 R
roo la sooo [esearch leqn
io? E rav liTooo inance lnBc

P. T. O.
4095 t2 4095 5

(f) Consider the following relational schema: (3)


pe nsionc!ade
paycrade hmount
hBC 12 500 Suppliers(sID: inteeer, sName: string, address:
loep B o oo string)
lPoR b56b- Parts(olD: inteeer, pName: string, color: string)
Show the result for each of the following on the ) ) Catalog(slD: inteqer. pID: inteqer, cost: real)
tables:
Write relational algebra expressions to perform
(i) SELECT deptName, COUNT ('r'), SUM
the following :
(basicSalary)

FROM retiredEmployee (i) Find the names of suppliers who supply a


red part.
GROUP BY deptName;
(ii) List the IDs and names of parts with an
(iD SELECT emplD, empName, deptName entry in the table Catalog.
FROM retiredEmployee
(g) Identify multivalued and composite attributes from
WHERE empName LIKE '_aYo';
the following complex attribute : (3)

(b) Consider the following ER diagram to conceptualize {Hobby_stats (Name (First_name, Last_name),
a database that can be used to keep track of ) ) {Phone (Area_code, Phone_number) }, { Hobbies }) }
transport ships and their locations. (6)
(h) In the given schedule, what is the problem
(i) Map the given ER diagram into a relational
encountered due to concurrent execution of
schema.
transactions Tl and T2? Assuming the initial value
(ii) Specify the primary key and foreign keys X=5, what will be the value of X after the schedule
for each relation. is executed? (3)

P.T.O
4095 8 4095 9

(i) Specify the role names for the given 3. (a) Consider the following relation schema : (4\
relationship.
Student(SSN, Name, Major, Birthdate)
(ii) Determine the cardinality ratio. Justify your Course(CourseId, CourseName)
answer.
Fnroll(SSN, CourseId, Duration)
) )
(iii) Determine the participation constraint. Which of the relational model constraints may be
Justify your answer. violated by the following operations? Justify your
answer in each case,
(c) Consider the following relation for which {Car#,
(i) Insert a record in the Enroll table.
Salesperson#) is the primary key. Assume that all
attributes are simple and atomic. Also. assume (ii) Delete a record from the Student table.
that a car may be sold by multiple salespersons.
(b) Describe the three-schema architecture with the
CarSale(Car#, datesold, Salesperson#, Commissiono/o,
help of a suitable diagram. In this context, give a
DiscountAmt) suitable example of data independence. (3+2)
Additional functional dependencies are :

(c) State and prove the Pseudotransitive inference


{dateSold -> DiscountAmt}, {Salesperson# -+ rule. (1+3+2)
Commissiono/o) (3+4) ) )
Apply the above rule to infer ONE additional
(i) Based on the given primary key, check functional dependency for the given set F =
whether the above schema is in 2NF. {M -+ P, MY -r P, YP -+ C}
Justify your answer.

4 (a) Consider a relation R(A, B, C, D, E) with the


(ii) Ifrequired, normalize the given relation up
following dependencies : (2)
to 3NF. Show all the intermediate steps.

P.T.O
409s 10 409s 7

{AB -r C, CD -+ E, DE + B} () Consider the relation R = {A, B, C, D, E, F, G, H,


I, J) and the set of functional dependencies
Is AB a candidate key of this relation? Justify {c}, {A} -+ {D, E}, {B} -}
F ={{A, B} -+ {F},
your answer. {F} -+ {G,H}, {D} -+ {I, J}}. (3)

(b) Consider the following SQL statement : (4) (i) Find the closure of {A, B}.
) )
(ii) Assuming {A, B} as theprimary key, does
Create table Student
the relation R exhibit partial dependency?
(Rollno INT, Justify your answer.

Name VARCHAR(15),
Section B
Marks DECIMAL(3,2),

Age INT CHECK(Age>=17 and Age <:25),


2 (a) Consider a relation R(A, B). Is the given relation
DOB DATE); in BCNF? Why or why not? (3)

Which of the following values entered for the (b) Consider the following ER diagram and answer
columns holds valid? Justify your answer for each the questions that follow: (5)

case.
) )
(i)' 14-12-2002' for. DOB STUOENT

(ii) 3 4.75 for Marks

(iii) 16 for Age


HING
(iv) '21' for RollNo STANT

P.T.O

You might also like