CBSE 2026 · Central · Set 4 · Q34 · 4 marks
Assume that you are the Manager of the Loans department of a Finance House. To keep track of the loans you have created two tables : CUSTOMERS and loans. The sample data in these tables is given below : Table: CUSTOMERS C ID C Name Phone $\displaystyle 00001$ Raj Malhotra $\displaystyle 1234567890$ $\displaystyle 00003$ David Xavier $\displaystyle 3456789012$ $\displaystyle 00004$ Damini Iyer $\displaystyle 3156789012$ $\displaystyle 00008$ Abdul $\displaystyle 2345678901$
Table: LOANS SNo C ID L Amt L Date Terms RoI $\displaystyle 1$ $\displaystyle 00003$ $\displaystyle 200000$ $\displaystyle 2025$-$\displaystyle 12$-$\displaystyle 06$ $\displaystyle 60$ $\displaystyle 7.80$ $\displaystyle 2$ $\displaystyle 00008$ $\displaystyle 2500000$ $\displaystyle 2023$-$\displaystyle 08$-$\displaystyle 09$ $\displaystyle 60$ $\displaystyle 9.00$ $\displaystyle 3$ $\displaystyle 00001$ $\displaystyle 500000$ $\displaystyle 2025$-$\displaystyle 08$-$\displaystyle 13$ $\displaystyle 48$ $\displaystyle 6.00$ $\displaystyle 4$ $\displaystyle 00003$ $\displaystyle 300000$ $\displaystyle 2026$-$\displaystyle 12$-$\displaystyle 07$ $\displaystyle 36$ $\displaystyle 8.00$ $\displaystyle 5$ $\displaystyle 00004$ $\displaystyle 600000$ $\displaystyle 2026$-$\displaystyle 12$-$\displaystyle 07$ $\displaystyle 60$ $\displaystyle 6.00$
Note : The tables may contain more records than shown here. The management of the Finance House needs certain reports from you. Write the queries to extract the following data to create the reports :(i)Number of records from LOANS table where Rate of Interest (ROI) is above 7.0.(ii)Names of the customers whose loan amount (L_Amt) is above 1000000.(iii)C_ID, C_Name and Terms of all those records where Loan Date (L_Date) is after $\displaystyle 31^{\text {st }}$ December, 2024.(iv)Details of all the loans in the descending order of RoI.C_ID and average term for each C_ID from the LOANS table.
Assume that you are the Manager of the Loans department of a Finance House. To keep track of the loans you have created two tables : CUSTOMERS and loans. The sample data in these tables is given below : Table: CUSTOMERS
Table: LOANS
Note : The tables may contain more records than shown here. The management of the Finance House needs certain reports from you. Write the queries to extract the following data to create the reports :
| C ID | C Name | Phone |
| $\displaystyle 00001$ | Raj Malhotra | $\displaystyle 1234567890$ |
| $\displaystyle 00003$ | David Xavier | $\displaystyle 3456789012$ |
| $\displaystyle 00004$ | Damini Iyer | $\displaystyle 3156789012$ |
| $\displaystyle 00008$ | Abdul | $\displaystyle 2345678901$ |
| SNo | C ID | L Amt | L Date | Terms | RoI |
| $\displaystyle 1$ | $\displaystyle 00003$ | $\displaystyle 200000$ | $\displaystyle 2025$-$\displaystyle 12$-$\displaystyle 06$ | $\displaystyle 60$ | $\displaystyle 7.80$ |
| $\displaystyle 2$ | $\displaystyle 00008$ | $\displaystyle 2500000$ | $\displaystyle 2023$-$\displaystyle 08$-$\displaystyle 09$ | $\displaystyle 60$ | $\displaystyle 9.00$ |
| $\displaystyle 3$ | $\displaystyle 00001$ | $\displaystyle 500000$ | $\displaystyle 2025$-$\displaystyle 08$-$\displaystyle 13$ | $\displaystyle 48$ | $\displaystyle 6.00$ |
| $\displaystyle 4$ | $\displaystyle 00003$ | $\displaystyle 300000$ | $\displaystyle 2026$-$\displaystyle 12$-$\displaystyle 07$ | $\displaystyle 36$ | $\displaystyle 8.00$ |
| $\displaystyle 5$ | $\displaystyle 00004$ | $\displaystyle 600000$ | $\displaystyle 2026$-$\displaystyle 12$-$\displaystyle 07$ | $\displaystyle 60$ | $\displaystyle 6.00$ |
(i)
Number of records from LOANS table where Rate of Interest (ROI) is above 7.0.
(ii)
Names of the customers whose loan amount (L_Amt) is above 1000000.
(iii)
C_ID, C_Name and Terms of all those records where Loan Date (L_Date) is after $\displaystyle 31^{\text {st }}$ December, 2024.
(iv)
Details of all the loans in the descending order of RoI.
C_ID and average term for each C_ID from the LOANS table.
Marking-scheme solution
(i)
SELECT COUNT(*) FROM LOANS
WHERE RoI > 7.0;(ii)
SELECT C_Name
FROM CUSTOMERS
JOIN LOANS ON CUSTOMERS.C_ID = LOANS.C_ID
WHERE L_Amt > 1000000;SELECT C_Name
FROM CUSTOMERS, LOANS
WHERE CUSTOMERS.C_ID = LOANS.C_ID
AND L_Amt > 1000000;SELECT C_Name
FROM CUSTOMERS
NATURAL JOIN LOANS
WHERE L_Amt > 1000000;SELECT C_Name
FROM CUSTOMERS
JOIN LOANS ON CUSTOMERS.C_ID = LOANS.C_ID
WHERE L_Amt > 1000000
GROUP BY C_Name;SELECT C_Name
FROM CUSTOMERS
JOIN LOANS ON CUSTOMERS.C_ID = LOANS.C_ID
GROUP BY C_Name
HAVING SUM(L_Amt) > 1000000;Any other correct SQL Command
(iii)
SELECT L.C_ID, C_NAME, TERMS
FROM CUSTOMERS C, LOANS L
WHERE C. C_ID = L.C_ID AND L_DATE > '2024-12-31';SELECT CUSTOMERS.C_ID, C_Name, Terms
FROM CUSTOMERS
JOIN LOANS ON CUSTOMERS.C_ID = LOANS.C_ID
WHERE L_Date > '2024-12-31';SELECT CUSTOMERS.C_ID, C_Name, Terms
FROM CUSTOMERS, LOANS
WHERE CUSTOMERS.C_ID = LOANS.C_ID
AND L_Date > '2024-12-31';SELECT C.C_ID, C_NAME, TERMS
FROM CUSTOMERS C NATURAL JOIN LOANS
WHERE L_DATE > '2024-12-31';SELECT C.C_ID, C.C_Name, L.Terms
FROM CUSTOMERS C, LOANS L
WHERE C.C_ID = L.C_ID
AND L.L_Date > '2024-12-31';Any other correct SQL Command
(iv)
SELECT * FROM LOANS
ORDER BY RoI DESC;Any other correct SQL Command
SELECT C_ID, AVG(TERMS) FROM LOANS
GROUP BY C_ID;Any other correct SQL Command
Structured Query LanguageAggregate Functions (max, min, avg, sum, count)Applycase_study
More from Structured Query Language
- Ms. Zoya is a Production Manager in a factory which packages mineral water. She decides to create a table in…2026
- Abhishek has created a table, named STOCK, with a set of records to maintain the data of packaged milk in his…2026
- Which aggregate function in SQL returns the smallest value from a column in a table?2026
- What will be the output of the query? SELECT MACHINE ID, MACHINE NAME FROM INVENTORY WHERE QUANTITY <= 100;2026
CBSE Class 12 Computer Science past-paper question from the 2026board exam, with the answer as CBSE’s own marking scheme gives it. Where our answers come from.