Junior — Middle
What type of SQL join is used to retrieve all elements present in both tables?
sobes.tech AI
Answer from AI
To retrieve all elements present in both tables, INNER JOIN is used. This type of join returns only those rows that have matching values in both tables based on the specified join condition.
Example SQL query:
SELECT *
FROM table1
INNER JOIN table2 ON table1.id = table2.id;
As a result, only the records with matching id values in both tables will be obtained.