Nptel Database Management System Assignment 2 Answers

Are you looking for the Nptel Database Management System Assignment 2 Answers 2024 (July-Dec)? You’ve come to the right place! Our detailed and accurate solutions are designed to assist you in mastering the concepts of DBMS, including SQL queries, database design, normalization, and more.

Course Link: Click Here

Nptel Database Management System Assignment 2 Answers
Nptel Database Management System Assignment 2 Answers

Nptel Database Management System Assignment 2 Answers

Session: JUL-DEC 2024


Q1. In a particular messenger application, the instance of Chat Details is as follows:

For the instance, the Total_Text values need to be updated to increase by 500 for those entries whose current values are less than 1000. What is the correct SQL Query for updating the current instance?
a) MODIFY ChatDetails Total_Text=Total_Text+500 where Total_Text<1000;
b) UPDATE ChatDetails set Total_Text=Total_Text+500 where Total_Text<1000;
c) UPDATE ChatDetails Total_Text=Total_Text+500 where Total_Text<1000;
d) ALTER ChatDetails set Total_Text=Total_Text+500 where Total_Text<1000;

Answer: b) UPDATE ChatDetails set Total_Text=Total_Text+500 where Total_Text<1000;


Q2. In a particular messenger application, the instances of ChatDetails and UserDetails are as follows:

What is the output of the following SQL Query?
SELECT COUNT(Address) FROM ChatDetails, UserDetails GROUP BY Address;
a) 4
3
b) 4
8
c) 4
d) 3

Answer: b) 4
8


For answers or latest updates join our telegram channel: Click here to join

These are Nptel Database Management System Assignment 2 Answers


Q3. In a particular messenger application, the instance of UserDetails is as follows:

Which of the options will not be present in the output generated by the SQL query: SELECT Address FROM UserDetails WHERE Address LIKE ‘%’ OR Address LIKE ‘M%’;
a) Agartala
b) Kolkata
c) Mumbai
d) Delhi

Answer: a) ALTER command is used to add remove\modify rows to a relation.
c) DROP command is used to delete all data from a relation.

See also  All About NPTEL

Q4. Which of the following statements is incorrect?

a) ALTER command is used to add remove\modify rows to a relation.
b) ALTER command is used to add remove\modify attributes to a relation.
c) DROP command is used to delete all data from a relation.
d) DROP command is used to delete a relation.

Answer: a) ALTER command is used to add remove\modify rows to a relation.


For answers or latest updates join our telegram channel: Click here to join

These are Nptel Database Management System Assignment 2 Answers


Q5. Let students (student_id, student name, address, emailid) and enrolment (student_id, dept name, enrolment_date) be two relations in a schema. The primary keys are shown underlined.
Let student_id be a foreign key in enrolment relation referring to students relation. Suppose, there is no violation of the above referential integrity constraint in the corresponding relation instances of students and enrolment.
Which one of the following relational algebra expressions would necessarily produce an empty relation?

a) Istudent_id (enrolment) Istudent_id (students)
b) Istudent_id (students) Istudent_id (enrolment)
c) Istudent_id(enrolment <> students)
d) Istudent_id (enrolment students)

Answer: a) Istudent_id (enrolment) Istudent_id (students)


Q6. Consider the following instance of MountainDetails (MountainName, Altitude, StateName) relation.
What will be the output of the following query?
SELECT MountainName, Altitude
FROM MountainDetails md1
WHERE Altitude = (
SELECT MAX(Altitude) FROM MountainDetails md2 WHERE md1.StateName = md2. StateName);

Answer:

image 4

For answers or latest updates join our telegram channel: Click here to join

These are Nptel Database Management System Assignment 2 Answers


Q7. Consider the following instance of MountainDetails (MountainName, Altitude, StateName) relation.

What will be the output of the following query?
SELECT MountainName, Altitude FROM MountainDetails WHERE Altitude > (
SELECT Altitude FROM MountainDetails WHERE StateName = “Uttarakhand”);

See also  Data Base Management System | Week 5

Answer:

image 5

Q8. Consider the following instance UserDetails of a messenger application

a) SELECT * FROM UserDetails
WHERE Address AS (‘Delhi’, ‘Mumbai’);
b) SELECT * FROM UserDetails WHERE Address IN (‘Delhi’, ‘Mumbai’);
c) SELECT * FROM UserDetails WHERE Address FOR (‘Delhi’, ‘Mumbai’);
d) SELECT * FROM UserDetails WHERE Address TO (‘Delhi’, ‘Mumbai’);

Answer: b) SELECT * FROM UserDetails WHERE Address IN (‘Delhi’, ‘Mumbai’);


For answers or latest updates join our telegram channel: Click here to join

These are Nptel Database Management System Assignment 2 Answers


Q9.Consider the following instance UserDetails of a messenger application:

Identify the correct statement to create an index on SenderID and Address of UserDetails relation named as ‘View_UserDetails’
a) Create View_UserDetails AS UserDetails (Sender ID, Address);
b) Create index View_UserDetails AS UserDetails (Sender ID, Address);
c) Create index View_UserDetails ON UserDetails (Sender ID, Address);
d) Create index View_UserDetails TO UserDetails (SenderID, Address);

Answer: c) Create index View_UserDetails ON UserDetails (Sender ID, Address);


Q10. Consider the following instance UserDetails of a messenger application:

Identify the correct statement to find the SenderID, Receiver ID, and Address of UserDetails table whose Total_Text is in between 700 and 1200.
a) SELECT SenderID, ReceiverID, Address FROM UserDetails WHERE Total_Text AS (700, 1200);
b) SELECT SenderID, ReceiverID, Address FROM UserDetails WHERE Total_Text IN (700, 1200);
c) SELECT SenderID, ReceiverID, Address FROM UserDetails WHERE Total_Text BETWEEN (700, 1200);
d) SELECT SenderID, ReceiverID, Address FROM UserDetails WHERE Total_Text BETWEEN 700 AND 1200;

Answer: d) SELECT SenderID, ReceiverID, Address FROM UserDetails WHERE Total_Text BETWEEN 700 AND 1200;


For answers or latest updates join our telegram channel: Click here to join

See also  Nptel Database Management System Assignment 4 Answers

These are Nptel Database Management System Assignment 2 Answers


All Weeks of Database Management System: Click here

For answers to additional Nptel courses, please refer to this link: Check here