Assignment No 2 Bc230200920
Assignment No 2 Bc230200920
Bc230200920
Muhammad Mujeeb
Question:
The following database tables with their structure will be used.
1. Books
o Title
o Author
o Category
o Price
2. Members
o Name
o Email
o JoinDate
3. Borrowings
o BorrowDate
o ReturnDate
4. Authors
o AuthorName
Country
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;
12 SELECT Title, Price FROM Books WHERE Category = 'Fiction' AND Price <
500;
Tasks
Task Statement SQL Command
Sample Delete records from the Borrowings table where the ReturnDate is earlier than
1
January 1, 2022
1 Create a table named Members with the schema described above, including
3
primary key and any foreign key relationships if applicable.
2 Insert a new record into the Books table with the following details: BookID =
'B001', Title = 'Database Systems', Author = 'Salman ', Category = 6
'Technology', Price = 1000, Stock = 20.
3 Delete all records from the Borrowings table where the ReturnDate is earlier 8
Task Statement SQL Command
than January 1, 2024.
4 Update the Email of a member in the Members table with MemberID = 'M002'
10
to '[email protected]'.
5 Retrieve the Title and Price of all books in the Books table where the Category
12
is 'Fiction' and the Price is less than 500.