Question 1
Which level of abstraction is responsible for providing data security by limiting access to specific data views?
Physical level
Logical level
View level
Physical level and Logical level

The IIT Madras BS Database Management Systems (DBMS) Quiz 1 paper sat on 23 Feb 2025, in the January 2025 term: 14 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
Which level of abstraction is responsible for providing data security by limiting access to specific data views?
Physical level
Logical level
View level
Physical level and Logical level
Correct answer
View level
Consider the relation student shown in Table 5.
| roll_no | name | house_name |
|---|---|---|
| 1 | John | Nilgiri |
| 2 | Ramesh | Nilgiri |
| 3 | Dilip | Arawali |
| 4 | Suresh | Shiwalik |
| 5 | Kiran | Udaygiri |
| 6 | Vijay | Nilgiri |
Table 5: Relation student
Which of the following SQL command is used to provide INSERT authorization of the table student to instructor.
Correct answer
Consider the tables Products and Suppliers given below:
| P_ID | P_Name | S_ID |
|---|---|---|
| 1 | Laptop | 3 |
| 2 | Smartphone | 2 |
| 3 | Tablet | 3 |
| 4 | Headphones | 1 |
Table 1: Products
| S_ID | S_Name |
|---|---|
| 1 | Sony |
| 2 | Samsung |
| 3 | Apple |
Table 2: Supplier
Now consider the SQL query given below:
Select *From Products P, Supplier SWhere P.P_ID<>S.S_IDHow many attributes and rows will be present in the resultant output table?
4 attributes and 9 rows
5 attributes and 8 rows
4 attributes and 8 rows
5 attributes and 9 rows
Correct answer
5 attributes and 9 rows
Consider a relational database for Formula One Racing containing the following tables.
| D_ID | D_Name | T_ID | Points | Podium |
|---|---|---|---|---|
| 1 | Carlos Sainz | 101 | 92 | P1 |
| 2 | Charles Leclerc | 102 | 56 | P2 |
| 3 | Lando Norris | 101 | 90 | P3 |
| 4 | George Russell | 103 | 71 | P4 |
| 5 | Lewis Hamilton | 102 | 95 | P5 |
| 6 | Max Verstappen | 103 | 64 | P1 |
| 7 | Ayrton Senna | 101 | 100 | P4 |
| 8 | Michael Schumacher | 103 | 72 | P2 |
| 9 | Kimi Raikkonen | 102 | 91 | P5 |
Table 3: Drivers
| T_ID | T_Name | Country |
|---|---|---|
| 101 | Scuderia Ferrari | Italy |
| 102 | Mercedes AMG | Germany |
| 103 | McLaren | UK |
Table 4: Teams
Now consider the following query:
Select T.T_ID, T.T_NameFrom Drivers D, Teams TWhere D.T_ID=T.T_ID andPoints > (Select avg (Points) From Drivers Where Podium='P1') ;The number of rows returned by the above SQL query is:
4
5
9
7
Correct answer
5
Consider the following relations:
auto_part(pid, pname, color)
auto_suppliers(sid, sname, location)
catalog(pid, sid, price)
Consider the TRC expression:
Choose the correct DRC expression equivalent to the TRC expression shown above.
Correct answer
Correct answer
Names of all the drivers whose salary is greater than all Mercedes drivers but not less than all Ferrari drivers
Names of all the drivers whose salary is less than all Mercedes drivers but not greater than all Ferrari drivers
Names of all the drivers whose salary is greater than all Mercedes drivers as well as all Ferrari drivers
Names of all the drivers whose salary is less than all Mercedes drivers as well as all Ferrari drivers
Correct answer
Names of all the drivers whose salary is greater than all Mercedes drivers but not less than all Ferrari drivers
Correct answers
Every company must have produced at least one item
An item can be produced by more than one company
Every customer must have bought at least one item
An item can be bought by more than one customer
Correct answers
Every company must have produced at least one item
Every customer must have bought at least one item
An item can be bought by more than one customer
Consider the following Students table
| student_id | name | grade | marks |
|---|---|---|---|
| 1001 | Alice | A | 85 |
| 1002 | Bob | B | 70 |
| 1003 | Charlie | A | 90 |
| 1004 | David | B | 60 |
| 1005 | Eve | A | 95 |
Figure 1: Students
Choose the correct SQL query to calculate the average marks scored by students in each grade and sort the result by average marks in descending order.
Correct answers
Consider relations Book and Author shown in Table 6 and Table 7
| BookID | Title | AuthorID | Genre |
|---|---|---|---|
| 1 | Harry Potter and the Sorcerer's Stone | 101 | Fantasy |
| 2 | Pride and Prejudice | 103 | Fiction |
| 3 | The Great Gatsby | 104 | Fiction |
| 4 | The chamber of secrets | 101 | Adventure |
| 5 | The Catcher in the Rye | 105 | Fiction |
| 6 | 1984 | 101 | Dystopian |
Table 6: Book Table
| AuthorID | Name |
|---|---|
| 101 | J.K. Rowling |
| 102 | F. Scott Fitzgerald |
| 103 | Jane Austen |
| 104 | Herman Melville |
Table 7: Author Table
How many rows will be in the output of below query?
SELECT *FROM Book LEFT OUTER JOIN AuthorON Book.AuthorID = Author.AuthorIDWHERE Genre LIKE 'F%';Correct answer: 4
Consider the tables student and course as shown below.
| ID | name | dept_name |
|---|---|---|
| 21f11 | Ram | CS |
| 21f12 | Rakesh | ME |
| 21f13 | Pranav | EE |
| 21f14 | Rajib | CS |
| 21f15 | Vikash | BT |
Table 8: student
| course_id | title | dept_name |
|---|---|---|
| C001 | DBMS | CS |
| C002 | CAD | ME |
| C003 | Digital | EE |
| C004 | PDSA | CS |
Table 9: course
How many rows are returned by the below query?
(SELECT ID FROM student,courseEXCEPT ALLSELECT ID FROM student)EXCEPTSELECT ID FROM studentCorrect answer: 0
Consider the following scenario and answer the given subquestions
A startup company is building an online learning platform that hosts courses on various subjects. In this platform, students can enroll in multiple courses, and each course can be taught by one or more instructors. The company wants to design the database schema to manage the core entities: Student, Instructor, Course, and Enrollment.
In the Enrollment table, which of the following is a typical way to handle the primary key?
Use an auto-increment column (e.g., EnrollmentID) as the primary key.
Use a composite primary key consisting of StudentID and CourseID.
There is no need to have a primary key for the Enrollment table.
Use a primary key consisting of StudentID.
Correct answer
Use a composite primary key consisting of StudentID and CourseID.
Consider the following scenario and answer the given subquestions
A startup company is building an online learning platform that hosts courses on various subjects. In this platform, students can enroll in multiple courses, and each course can be taught by one or more instructors. The company wants to design the database schema to manage the core entities: Student, Instructor, Course, and Enrollment.
In a typical design, what is the relationship between the Student table and the Enrollment table?
One-to-One
One-to-Many
Many-to-Many
Many-to-One
Correct answer
Many-to-One