Skip to content
Question 25 of 29

Q.(a) Consider the following tables - LOAN and BORROWER: Table: LOAN LOAN_NO B_NAME AMOUNT L-170 DELHI 3000 L-230 KANPUR 4000 Table: BORROWER CUST_NAME LOAN_NO JOHN L-171 KRISH L-230 RAVYA L-170 How many rows and columns will be there in the natural join of these two tables?

(OR)
(b) Write the output of the queries
(i) to
(iv) based on the table, WORKER given below: TABLE: WORKER W_ID F_NAME L_NAME CITY STATE 102 SAHIL KHAN KANPUR UTTAR PRADESH 104 SAMEER PARIKH ROOP NAGAR PUNJAB 105 MARY JONES DELHI DELHI 106 MAHIR SHARMA SONIPAT HARYANA 107 ATHARVA BHARDWAJ DELHI DELHI 108 VEDA SHARMA KANPUR UTTAR PRADESH
(i) SELECT F_NAME, CITY FROM WORKER ORDER BY STATE DESC;
(ii) SELECT DISTINCT(CITY) FROM WORKER;
(iii) SELECT F_NAME, STATE FROM WORKER WHERE L_NAME LIKE '_HA%';
(iv) SELECT CITY, COUNT(*) FROM WORKER GROUP BY CITY;
Punjab PsebCBSE Class XII Board 2023Subjective· 3mImportance★★★★★
86% · 25/29 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Part (a): the natural join of LOAN and BORROWER has 2 rows and 4 columns.

Part (b): (i) 6 rows ordered by STATE descending; (ii) 4 distinct cities; (iii) four rows — KHAN, SHARMA, BHARDWAJ, SHARMA match _HA%; (iv) per-city counts KANPUR 2, ROOP NAGAR 1, DELHI 2, SONIPAT 1.

Part (a)

A natural join joins two tables on their commonly named column(s), keeps only matching rows, and shows the shared column just once. The common column is LOAN_NO.

  • L-170 is in both tables -> one joined row.
  • L-230 is in both tables -> one joined row.
  • L-171 appears only in BORROWER, so it has no match and is excluded. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.