0% found this document useful (0 votes)
66 views1 page

Test2 Chap5678 HonsDBMS-11feb25

The document is a test paper for a B.Sc. (H) in Computer Science focusing on Database Management Systems (DBMS). It includes questions on SQL commands, relational algebra queries, and database schema design. The test assesses knowledge on various database operations, including data manipulation and schema definition.

Uploaded by

bakwaskaam1173
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)
66 views1 page

Test2 Chap5678 HonsDBMS-11feb25

The document is a test paper for a B.Sc. (H) in Computer Science focusing on Database Management Systems (DBMS). It includes questions on SQL commands, relational algebra queries, and database schema design. The test assesses knowledge on various database operations, including data manipulation and schema definition.

Uploaded by

bakwaskaam1173
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/ 1

TEST2 B.SC. (H) CS DBMS TIME: 1.

5 hr
1. Explain the following with an example
a. DROP command with cascade option in SQL.
b. ALTER command to modify a column to change its datatype and add NOT NULL condition.
c. RENAME a table name. (6)
2. Consider the following Tables:
Musician SSN Name Address Phone
Instrument InstrumentName MusicalKey
Album AlbumId Title CopyrightDate Format ProducerSSN
Song SongId Title Author AlbumId
Plays SSN InstrName
Performs SSN SongId1
Write SQL query for the following:
a. List the names of all musicians who play the 'Guitar'."
b. Find the titles of all songs written by 'John Lennon' that are on albums produced by 'Paul McCartney'.
c. List the names of all instruments played by 'Jimi Hendal'
d. Find the number of songs on each album.
e. List the names of musicians who have performed on more than 5 songs. (10)
3. Consider the following schema:
Sailors (Sailor_id, Sname, Rating, Age)
Boats (Boat_id, Bname, Color)
Reserves (Sailor_id, Boat_id, Date)
Write the following queries in RELATIONAL ALGEBRA:
a. Find the names of sailors who have reserved boat 102.
b. Find the names of sailors who have reserved a blue or a yellow boat.
c. Find the Sailor_id of sailors with age over 30 who have not reserved a red boat. (6)

4. Consider the following tables.


PART PROJECT
PartNo PartName Color Weight PjNo PjName City
P123 Stearing Black 2 Kg R93 Alexor Delhi
Wheel
P459 Carborator Grey 500 R34 Manik Mumbai
gms
P145 Sterio Black 1.2 Kg R78 Bluestar Kolkata
P490 Clutch Plate White 3.4 Kg R49 Olive Madras

SHIPMENT SUPPLIER
SNo PartNo PjNo Qty SNo SName Status City
S345231 P123 R49 4 S127890 Sharma 3 Goa
S562459 P145 R93 8 S345231 Gupta 2 Madras
S127890 P145 R78 2 S562459 Panigrahi 1 Delhi
S562459 P459 R49 5 S321458 Verma 2 UP
a. UPDATE SHIPMENT SET Qty = 5.5 WHERE SNo = 'S345231' AND PartNo = 'P123' AND PiNo = 'R49';
b. INSERT INTO SHIPMENT VALUES ('S562459', 'P459', 'R79', 10);
c. INSERT INTO PART VALUES ('P145', 'Wheel', 'Silver', '2.5 Kg');
d. INSERT INTO SUPPLIER VALUES (NULL, 'New Supplier', 3, 'London');
e. DELETE FROM PART WHERE PartNo = 'P490'; (5)

5. Consider the following relations for a database that keeps track of student enrollment in courses
and the books adopted for each course:
Student (Ssn, Name, Major, Bdate)
Course (Course#, Cname, Dept)
Enroll (Ssn, Course#, Semester, Grade)
Book_Adoption (Course#, Semester, Book_isbn)
Text (Book_isbn, Book_title, Publisher, Author)
Specify the primary keys and foreign keys for this schema, stating any assumptions you make. (5)

You might also like