MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
When you select data from 2 tables, you are creating a ____
A
JOIN
B
PRIMARY KEY
C
FOREIGN KEY
D
INDEX
Explanation: 

Detailed explanation-1: -The join is done by the JOIN operator. In the FROM clause, the name of the first table ( product ) is followed by a JOIN keyword then by the name of the second table ( category ). This is then followed by the keyword ON and by the condition for joining the rows from the different tables.

Detailed explanation-2: -Different Types of SQL JOINs (INNER) JOIN : Returns records that have matching values in both tables. LEFT (OUTER) JOIN : Returns all records from the left table, and the matched records from the right table. RIGHT (OUTER) JOIN : Returns all records from the right table, and the matched records from the left table.

Detailed explanation-3: -SQL Join statement is used to combine data or rows from two or more tables based on a common field between them.

Detailed explanation-4: -In SQL we can retrieve data from multiple tables also by using SELECT with multiple tables which actually results in CROSS JOIN of all the tables. The resulting table occurring from CROSS JOIN of two contains all the row combinations of the 2nd table which is a Cartesian product of tables.

There is 1 question to complete.