makautnotes.in Provides makaut Previous Year Question Papers & Notes, answer keys, organizer, syllabus

Find your queries what you want today🙂 but first join my telegram group

NPTEL Data Base Management System Week 2 Assignment Answers 2024 (July-October)

The NPTEL Database Management System course provides a comprehensive understanding of database systems, including SQL queries, database design, and data manipulation. In Week 2, the assignment focuses on practical applications of SQL queries to solve real-world database problems. Here are the detailed solutions and explanations for each question in the assignment.Week 2: Assignment 2

NPTEL Data Base Management System Week 2 Assignment Answers 2024 (July-October)


Question 1

Question:
In a particular company application, the instances of ClassTeacher to HostelAddress are as follows:

ClassTeacherIDHostelAddressID
110112
120212
130313
140414
150515

We need to maintain the instances for four class teachers and five hostel addresses. Write the SQL query to output the ClassTeacherID, and HostelAddressID from the above data.

Answer:

sql
SELECT ClassTeacherID, HostelAddressID FROM ClassTeacher JOIN HostelAddress ON ClassTeacher.HostelAddressID = HostelAddress.HostelAddressID;

Reason:
This query selects the ClassTeacherID and HostelAddressID from the joined tables ClassTeacher and HostelAddress based on the matching HostelAddressID.


Question 2

Question:
In a particular company application, the instances of ClassTeacher and TreeType are as follows:

ClassTeacherIDTreeTypeID
11015
12024
13033
14042
15051

We need to maintain the instances for five class teachers and five tree types. Write the SQL query to output the ClassTeacherID, and TreeTypeID from the above data.

Answer:

sql
SELECT ClassTeacherID, TreeTypeID FROM ClassTeacher JOIN TreeType ON ClassTeacher.TreeTypeID = TreeType.TreeTypeID;

Reason:
This query selects the ClassTeacherID and TreeTypeID from the joined tables ClassTeacher and TreeType based on the matching TreeTypeID.


Question 3

Question:
Which of the following scenarios is incorrect?

a) ATM transaction record is infrequently modified once it is written.
b) E-commerce record is infrequently modified once it is written.
c) OTP transaction record is valid for less than a minute.
d) None of the above.

Answer:
d) None of the above.

Reason:
All the given scenarios are correct descriptions of their respective contexts. ATM transactions and e-commerce records are typically not modified frequently, and OTP transactions are indeed valid for a very short duration.


Question 4

Question:
Consider the data instances:

BoardingIDFoodItemIDTotalItemsTotalCost
00110210500
002103201000
00310415750
004105251250
005106301500

Write the SQL query to output the BoardingID, FoodItemID, TotalItems, and TotalCost from the above data.

Answer:

sql
SELECT BoardingID, FoodItemID, TotalItems, TotalCost FROM Boarding JOIN FoodItem ON Boarding.FoodItemID = FoodItem.FoodItemID;

Reason:
This query selects the BoardingID, FoodItemID, TotalItems, and TotalCost from the joined tables Boarding and FoodItem based on the matching FoodItemID.


Question 5

Question:
Consider the following instance of BranchDetails and BranchName relations:

BranchIDBranchName
1Alpha
2Beta
3Gamma
4Delta

What will be the output of the following query?

sql
SELECT BranchID FROM BranchDetails WHERE BranchName = 'Delta';

Answer:
4

Reason:
The query selects the BranchID from BranchDetails where the BranchName is 'Delta'. Since BranchName 'Delta' corresponds to BranchID 4, the output will be 4.


Question 6

Question:
Consider the following instance of NewRecords and NewAddress relations:

RecordIDNewRecordIDTotalCost
001101500
0021021000
003103750
0041041250

Identify the correct statement to display the RecordID and Address of NewRecords instance based on NewAddress relation.

Answer:

sql
SELECT RecordID, Address FROM NewRecords JOIN NewAddress ON NewRecords.NewRecordID = NewAddress.NewRecordID;

Reason:
This query selects the RecordID and Address from the joined tables NewRecords and NewAddress based on the matching NewRecordID.


Question 7

Question:
Consider the following instance of NewRecords of a company application:

RecordIDNewRecordIDTotalCost
001201500
0022021000
003203750
0042041250

Identify the correct statement to display RecordID, NewRecordID, and TotalCost from the NewRecords instance.

Answer:

sql
SELECT RecordID, NewRecordID, TotalCost FROM NewRecords;

Reason:
This query simply selects the RecordID, NewRecordID, and TotalCost from the NewRecords table.


Conclusion

The Week 2 assignment in the NPTEL Database Management System course effectively reinforces the understanding of SQL query construction and table relationships. By solving these practical problems, students gain valuable skills in data manipulation and retrieval, essential for any database management role.

Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Telegram Group For Nptel Answer Keys Join Now

html 5

lagged02

 

gamelix