Anda di halaman 1dari 2

Roll Number:

Thapar University, Patiala


Department of Computer Science and Engineering

Course Code: UCS304


MST: Semester-III
Course Name: Information Management System
(COE, CML, CAG, SEM)
Monday, 3:30 p.m. — 5:30 p.m.
September 26, 2016
Name of Instructors: Dr. Parteek Bhatia, Dr. Avleen
Time: 2 Hours, M. Marks: 25
Kaur Malhi, Ms. Anika

Note: All questions are compulsory and attempt all parts of a question at one place.
Assume missing data, if any, suitably. Clearly specify your assumptions, if any.

Q. 1 How foreign key help to maintain integrity of data? Explain with two different
examples.
n x m that is to be used in your
Q. 2 (a) Consider a two-dimensional integer array of size
favorite programming language. Using the array as an example, illustrate the difference
between the three levels of data abstraction.
(b) Illustrate the difference between a schema and instance.
Q. 3 You've started a new movie-rating website, and you've been collecting data on
reviewers' ratings of various movies. There's not much data yet, but you can still try out
some interesting queries. Here's the schema:
Movie: (mID, title, year, director) director.
There is amovie with ID number mID, a title, a release year, and a
Reviewer: (rID, name)
The reviewer with ID number rID has a certain name.
Rating: (rID, mID, stars, ratingDate)
rating (1-5) on a
The reviewer rID gave the movie mID a number of stars
certain ratingDate.
i. Create the Rating table with appropriate constraints.
ii. Find all years that have a movie that received a rating of 4 or 5, and sort them in
increasing order.
iii. Find the titles of all movies that have no ratings.
iv. Some reviewers didn't provide a date with their rating. Find the names of all
reviewers who have ratings with a NULL value for the date.
v. Write a query to return the ratings data in a more readable format: reviewer name,
movie title, stars, and ratingDate. Also, sort the data, first by reviewer name, then
by movie title, and lastly by number of stars.
vi. Update the rating of all the movies directed by director 'SKY to 4.
vii. Return movie title, rating stars, rating date and the reviewer name for all movies.
viii. Delete the record of movie where the movie title is 'Inception'. Also write your
comment on the outcome of this operation.
ix. Add a column Location in the Reviewer table. The location of the reviewer can P.T.Q]
only be New York, I3oston, New Jersey, Washington DC.
cher inormtion
f a in the form of 4
Q. 4 Consider the database of a University having tea mation in the form
Teacher_code, T_Name and T_Address. It has course infor
Course_Code, Course Name, L, T, P, Credit. Each teacher teaches multiples courses
and for a give course there are multiple teachers. Store this information in hierarchical,
network and relational models.
Write about insert, update, delete and retrieve anomalies based on given database for
hierarchical and network model.
Example: Consider a Relation or Table RI. Let A, B, C, D, E are the attributes of this
5
relation.
R(A,B,C,D,E)
A—BCDE This means the attribute 'A' uniquely determines the other attributes
B,C,D,E.
BC--+ADE This means the attributes 'BC' jointly determines all the other attributes
A,D,E in the relation. .ustij your answer.
Identif candidate ke s, rimary ke and alternate ke and
At which layer following operations are performed. Justify your answer.
.6
a) Indexing of data
b) Compression of data
c) Data Types
d) Concatenations of Columns
'7 What will be the output of the following statements?
SELECT ROUND(3.14159, 4), TRUNC(3.14159, 3),
a)
ROUND(TRUNC(3.14159, 4), 2) FROM DUAL;
SELECT REPLACE(REPLACE('Follow the yellow brick road','o', '0'), ", '3')
b)
FROM DUAL;
SELECT TRIM (0 FROM 0043974580601090) FROM DUAL;
c)
_L_

Anda mungkin juga menyukai