Computer Science, asked by zubairmatin4085, 1 year ago

Consider table a with 3 records with id column primary key with values 1, 2, 3. Consider table b with 6 records with a_id as foreign key with values 1, 2, 3, 3, 3, 3. How many records b left join a and a left join b query would return?


nikitapadalwar: Consider table A with 3 records with id column primary key with values 1, 2, 3. Consider table B with 6 records with a_id as foreign key with values 1, 2, 3, 3, 3, 3. How many records B left join A and A left join B query would return?

Answers

Answered by lovingheart
0

Left join would always return all the records from the left side table and matching records from the right side table. There will be a null value of the right side table if no matches are found.

Syntax:

SELECT list of columns

FROM table1

LEFT JOIN table2

ON table1.col_name = table2.col_name;

Case 1: All the records from b would be displayed; the values with matches will have value fetched from both the tables. The rows which are not common will be displayed from the left-side table (b) and a null for columns in table (a).

Case 2: All the records from “a” would be displayed; the values with matches will have value fetched from both the tables. The rows which are not common will be displayed from the left-side table (a) and a null for columns in table (b).

Answered by jollykumari9168
0

Answer:

6 6

Explanation:

Similar questions