What is the expected output of below SQL

SELECT dt.DeptNo FROM dept_tbl dt LEFT OUTER JOIN dept_master dm ON dt.DeptNo = dm.DeptNo;

Table Dept _tbl

Dept No

Depart Name

10

Accounting

20

Purchase

30

Sales

50

Marketing

Table Dept_master

DeptNo

DepartName

10

Accounting

20

Purchase

30

Sales

40

Stores

DeptNo---------10203040

DeptNo---------1020304050

DeptNo---------102030

DeptNo---------10203050

Verified Answer
Correct Option - d
Anush said

The SQL query is like a matching game! It's looking for department numbers (DeptNo) in both tables, dept_tbl and dept_master. It will show all the department numbers from dept_tbl, even if there's no match in dept_master. So, the final answer is: 10, 20, 30, and 50! All the department numbers from dept_tbl are shown, no matter what!

To get all Infosys Certified MySQL Associate Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in