CS403 Assignment 2
CS403 Assignment 2
ID
BC230201414
SESSION
FALL 2024
SUBMITTED TO
CS403
CS403
ASSIGNMENT: 02
Question: 01
You are required to select the correct SQL query from the Table title ‘List of Queries’ and then
fill out the Table named ‘Tasks’ with the proper serial number:
List of Queries
2 INSERT INTO Books (BookID, Title, Author, Price, Stock) VALUES (B001,
'Database Systems', 'Salman', '1000', '20');
5 SELECT Title, Price FROM Books WHERE Category = 'Fiction' AND Price >
500;
6 INSERT INTO Books (BookID, Title, Author, Category, Price, Stock) VALUES
('B001', 'Database Systems', 'Salman', 'Technology', 1000, 20);
12 SELECT Title, Price FROM Books WHERE Category = 'Fiction' AND Price <
500;
13 INSERT INTO Authors (BookID, Title, Author, Category, Price, Stock) VALUES
(B001, 'Database Systems', 'Salman', Technology, '1000', '20');
15 SELECT Title, Price FROM Books WHERE Category = 'Technology' AND Price
< 500;
Solution:
Tasks
Sample Delete records from the Borrowings table where the ReturnDate is
1
earlier than January 1, 2022
2 Insert a new record into the Books table with the following details:
BookID = 'B001', Title = 'Database Systems', Author = 'Salman ', 6
Category = 'Technology', Price = 1000, Stock = 20.
3 Delete all records from the Borrowings table where the ReturnDate is
8
earlier than January 1, 2024.
5 Retrieve the Title and Price of all books in the Books table where the 12
Task Statement SQL Command
THANK YOU!