in Databases retagged by
814 views
0 votes
0 votes

A table joined with itself is called

  1. Join
  2. Self Join
  3. Outer Join
  4. Equi Join
in Databases retagged by
by
814 views

2 Answers

3 votes
3 votes

B is correct.

SELF JOIN: As the name signifies, in SELF JOIN a table is joined to itself. That is, each row of the table is joined with itself and all other rows depending on some conditions. In other words we can say that it is a join between two copies of the same table.Syntax:

SELECT a.coulmn1 , b.column2
FROM table_name a, table_name b
WHERE some_condition;

table_name: Name of the table.
some_condition: Condition for selecting the rows.

Example Queries(SELF JOIN):

SELECT a.ROLL_NO , b.NAME
FROM Student a, Student b
WHERE a.ROLL_NO < b.ROLL_NO;

Output:
tableeee

Ref: https://www.geeksforgeeks.org/sql-join-cartesian-join-self-join/

0 votes
0 votes

Answer: B

A self JOIN is a regular join, but the table is joined with itself.

Example:- SELECT A.CustomerName AS CustomerName1, B.CustomerName AS CustomerName2, A.City
FROM Customers A, Customers B
WHERE A.CustomerID <> B.CustomerID
AND A.City = B.City
ORDER BY A.City;

references:- https://www.w3schools.com/sql/sql_join_self.asp

Answer: