DBMS_QuestionBank_IA2
DBMS_QuestionBank_IA2
Dept of CSE
Question Bank
Questions BTL CO
2) List and brief basic data types available in SQL with suitable L2 3
examples
1. Retrieve details of all books in the library – id, title, name of publisher,
authors, number of copies in each branch.
2. Get the particulars of borrowers who have borrowed more than 3 books,
but from Jan 2017 to Jun 2017
3. Delete a book in BOOK table. Update the contents of other tables to
reflect this data manipulation operation.
4. Create a view of all books and its number of copies that are currently
available in the Library.
7) Consider the following schema
Write the suitable code for creating tales, inserting data and for the queries.
1) For each piece, find the most expensive offering of that piece and
L4 4
include the piece name, provider name, and price(Note that there could be two
providers who supply the same piece at the most expensive price).
2) Obtain the names of all providers who supply piece 1.
3) Update the database to reflect that "Susan Calvin Corp." (code "RBT")
will not supply any pieces
4) Add an entry to the database to indicate that "Skellington Supplies"
(code "TNBC") will provide sprockets (code "1") for 7 cents each.
Obtain the average price of each piece (show only the piece code and the
average price).
L2 4
Queries:
1 . Retrieve the product_name and unit_price from the Products table.
2. Filter the Sales table to show only sales with a total_price greater than
$100.
3. Retrieve the sale_id and total_price from the Sales table for sales made
on January 3, 2024.
4. Calculate the average unit_price of products in the Products table.
Write the suitable code for creating tales, inserting data and for the
queries.
1) Select the codes of all warehouses that are saturated (a warehouse CL4 4
is saturated if the number of boxes in it is larger than the
warehouse's capacity).
2) Select the code of each box, along with the name of the city the
box is located in.
3) Select the codes of all the boxes located in Chicago.
4) Reduce the value of all boxes by 15%.
5) Add Index for column "Warehouse" in table "boxes"