Page 58 - ipp11
P. 58
Table: Orders
OrderID ProductID CustomerName Quantity OrderDate
101 1 Rahul 1 2024-02-20
102 3 Neha 2 2024-03-15
103 2 Arjun 1 2024-03-18
104 4 Pooja 3 2024-03-22
Write SQL queries for (a), (b) and outputs for (c) to (e) on the basis of tables Products and Orders.
(a) Write a query to add a column, Model_No, in the table Products.
(b) Write a query to display details of products whose names contain the letter ‘a’.
(c) SELECT * FROM PRODUCTS WHERE CATEGORY = "ELECTRONICS" AND PRODUCTID >2;
(d) SELECT ProductName, Price FROM Products WHERE Price > 5000;
(e) SELECT CustomerName, OrderDate FROM Orders WHERE OrderDate BETWEEN '2024-
03-01' AND '2024-03-31';
SECTION E (2 × 5 = 10 Marks)
36. Answer the following questions: (1+2+2)
(a) Draw a flowchart to determine whether a user is eligible to vote.
(b) Write a program to check whether a given number is positive, negative or zero.
(c) Write a program to display the factorial of a given number.
37. (a) Write a menu-driven program to perform the following list operations: (5)
(i) Append an element
(ii) Insert an element
(iii) Append a list to the given list
(iv) Modify an existing element
(v) Delete an existing element from its position
(vi) Sort the list in descending order
(vii) Display the list
OR
(b) Write a menu-driven program that accepts either of the two choices, i.e., Deposit and Withdrawal, then
accepts an amount, performs the transaction and displays the balance accordingly.
The menu should display the following:
(i) Open a Savings Bank Account
(ii) Add a Customer
(iii) Deposit Money
(iv) Sorted Records
(v) Close Account
P.5