Names of the customers whose loan amount (L_Amt) is above 1000000.
Names of the customers whose loan amount (L_Amt) is above 1000000.
SQL Query:
``sql
SELECT C_Name FROM CUSTOMERS, LOANS
WHERE CUSTOMERS.CID = LOANS.CID AND L_Amt > 1000000;
``
This joins CUSTOMERS and LOANS on the common column C_ID and returns only the names of customers whose loan amount exceeds ₹10,00,000.
Marking Scheme
- 11 mark for the complete correct query with the join condition CUSTOMERS.C_ID = LOANS.C_ID and the filter L_Amt > 1000000; marks deducted if the join condition is missing.
Hint
Two-table questions need a join condition (common column) ANDed with the actual filter condition.
Quick Oral Answer
I join CUSTOMERS and LOANS on C_ID and then filter for L_Amt above 1000000, selecting only C_Name from the matched rows.
Analysis & Explanation
Since customer names live in CUSTOMERS but the loan amount lives in LOANS, the two tables must be joined before filtering.
Concept
- The join condition CUSTOMERS.CID = LOANS.CID matches each loan to its owning customer.
- The AND L_Amt > 1000000 condition then restricts the joined rows to high-value loans only.
Exam trap
- Forgetting the join condition produces a Cartesian product, matching every customer with every loan regardless of ownership — a serious logical error.
Common Mistakes
- 1Omitting the join condition CUSTOMERS.C_ID = LOANS.C_ID, which produces every possible customer-loan combination instead of matched pairs.
- 2Forgetting that C_Name exists only in CUSTOMERS, not LOANS, and trying to select it without joining the tables.
Interesting Facts
A join without a matching condition is called a Cartesian product and can return N x M rows for tables of size N and M — a classic accidental-query mistake in real databases.
This comma-style implicit join is the classic-SQL equivalent of writing 'FROM CUSTOMERS INNER JOIN LOANS ON CUSTOMERS.C_ID = LOANS.C_ID', which CBSE also accepts.
Spotted a mistake or something unclear?
Tell us — we fix reported answers fast.
Frequently Asked Questions
Why can't C_Name be selected directly from LOANS?
Because C_Name is a column in CUSTOMERS, not in LOANS; the two tables must be joined on C_ID before C_Name can be retrieved alongside loan details.
What happens if the join condition is left out?
SQL performs a Cartesian product, pairing every row of CUSTOMERS with every row of LOANS, which is both logically wrong and can return an enormous, meaningless result set.