Question 1
The lowest level of data abstraction is
physical level
logical level
view level
application level
The IIT Madras BS Database Management Systems (DBMS) Quiz 1 paper sat on 16 Jul 2023, in the May 2023 term: 17 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.
The lowest level of data abstraction is
physical level
logical level
view level
application level
Correct answer
physical level
Suppose a company wants to determine whether the ’price’ of the commodity will be an attribute in the shopping database or not. Which of the following holds good about this?
This is a physical-level decision.
This is a logical level decision.
This is an application-level decision.
This is a view-level decision.
Correct answer
This is a logical level decision.
Consider the following scenario:
The Reserve Bank of India (RBI) has issued guidelines declaring that the Rs. 2000 note will no longer be considered legal tender, starting from a specific date. The RBI wants to update its database to reflect this change and ensure that transactions involving the Rs. 2000 note are flagged as invalid.
Which DBMS concept would be most relevant for the RBI to update its database and flag transactions involving the Rs. 2000 note as invalid after the specified date?
CASCADE
Data Definition Language (DDL)
Triggers
Indexing
Correct answer
Triggers
Consider the schema given below :
Emp (eid, ename, age, salary)
Works (eid, did, pct_time)
Dept (did, budget, managerid)
Identify the correct SQL command to create a view named, EMPLOYEE, by selecting attributes like eid, salary, and managerid. Select those employees whose salary is greater than 1,00,000 and are atleast 45 years old.
Correct answer
An instance of the relation students is given below.
| sid | name | age | gpa |
|---|---|---|---|
| 53831 | Madayan | 11 | 1.8 |
| 53832 | Guldu | 12 | 2 |
| 53666 | Jones | 18 | 3.4 |
| 53688 | Smith | 19 | 3.2 |
| 53650 | Smith | 19 | 3.8 |
Figure 3: Relation students
Which of the following query executed on relation students would result in the output given below ?
| sid | name | age | gpa |
|---|---|---|---|
| 53832 | Guldu | 12 | 2 |
| 53666 | Jones | 18 | 3.4 |
| 53831 | Madayan | 11 | 1.8 |
| 53650 | Smith | 19 | 3.8 |
| 53688 | Smith | 19 | 3.2 |
Figure 4: Output
Correct answer
Consider two relations R and S as shown below.
| A | B | C |
|---|---|---|
| 1 | 2 | 3 |
| 2 | 4 | 6 |
| 3 | 7 | 3 |
| 4 | 3 | 4 |
Table 1: R
| B | C | D |
|---|---|---|
| 7 | 3 | 4 |
| 2 | 3 | 5 |
| 3 | 7 | 6 |
| 2 | 3 | 7 |
Table 2: S
The number of tuples in R ⟕ S are : [Note : ⟕ denotes left outer join.]
3
4
5
16
Correct answer
5
Correct answer
Only a and b are correct
Only b, c, and d are correct
Only a, c and d are correct
All a, b, c, d are correct
Correct answer
All a, b, c, d are correct
Consider the relation G20(country_name, foreign_minister_name, events, date, venue)
Questions:
SQL queries:
a. Select foreign_minister_name from G20where foreign_minister_name like 'j____'
b. Select foreign_minister_name from G20where foreign_minister_name like 'j____%'
c. Select count(events) from G20 where venue = 'GIFT City'
d. Select count(events) from G20 where venue = 'GIFT City' Group By venue
e. Select venue, count(events) from G20 Group By venue
f. Select venue, count(events) from G20Match the correct SQL queries with the corresponding Questions.
1-a, 2-c, 3-f
1-b, 2-c, 3-e
1-a, 2-d, 3-f
1-b, 2-d, 3-e
Correct answers
1-b, 2-c, 3-e
1-b, 2-d, 3-e
Correct answers
Correct answers
Consider the student relation given below. Select the correct query/queries to obtain the last name of students whose age is more than 25.
Student
| Fname | Lname | Age | Course |
|---|---|---|---|
| David | Sharma | 27 | DBMS |
| Aaron | Lilly | 17 | JAVA |
| Sahil | Khan | 19 | Python |
| Sachin | Rao | 20 | DBMS |
| Varun | George | 23 | JAVA |
| Simi | Verma | 22 | JAVA |
Correct answers
Consider the two relations R and S.
| A | B | C |
|---|---|---|
| 0 | 9 | 0 |
| 2 | 2 | 2 |
| 1 | 1 | 1 |
| A | B | C |
|---|---|---|
| 0 | Cat | 0 |
| 2 | Dog | 2 |
| 1 | Lion | 1 |
Figure 1: R and S
Let 'X' be the number of columns and 'Y' be the number of rows of the (R S ) relations.
What is the value of (X + Y) ?
Correct answer: 3
Consider the relation student shown in Table 3
| Roll_no | Name | marks |
|---|---|---|
| 1 | Ram | 50 |
| 2 | Rakesh | 65 |
| 3 | Ram | 45 |
| 4 | Pranav | 89 |
| 5 | Rakesh | 99 |
| 6 | Emily | 99 |
| 7 | Grace | 100 |
| 8 | Lily | 95 |
Table 3: student
What is the number of tuples returned by the following relational algebra expression
Correct answer: 5
Consider the following table which has four attributes: A, B, C, and D where A is the primary key and C is the foreign key referencing to A.
| A | B | C | D |
|---|---|---|---|
| 1 | 1 | 5 | 6 |
| 2 | 2 | 5 | 7 |
| 8 | 4 | 7 | 4 |
| 3 | 1 | 5 | 8 |
| 4 | 2 | 4 | 9 |
| 5 | 2 | 4 | 1 |
| 6 | 1 | 1 | 2 |
| 7 | 4 | 1 | 3 |
How many tuples will be left in the table if the tuple (1,1,5,6) is deleted and ON DELETE CASCADE construct is applied over the table?
Correct answer: 4
Correct answer: 17
Correct answer: 8