> Code Storage: cross join

Code Storage

A Technical blog for those who want to gain knowledge about SQL,MySQL,Data Science and real time query

Responsive Ads Here

Advertisement

Showing posts with label cross join. Show all posts
Showing posts with label cross join. Show all posts

Monday, February 17, 2020

SQL JOIN ? TYPE OF JOIN IN SQL

SQL JOIN:-

SQL join and type of join 

SQL join clause is used to combine rows from the two or more tables or joins in SQL are used to retrieve data from two or more related tables.In general tables are related to each other using foreign key constraint.

In SQL there are different types of joins
  1. Inner join
  2. Outer join 
  3. Cross join

1.Inner join:- 

                       Inner join keywords select the records that have matching in both the table. 

2.Outer join:-

                      Outer join keywords select records that does not have match in both the table.

3.Cross join:-

                      Cross join is join of tables without specifying of join condition the query would return                          all possible combination of the tables in the SQL query.

EXAMPLE:-

  • Order table
1.Order table

  • Customer Table
        

2.Customer table

         Query:-

            SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
            FROM Orders
            JOIN Customers ON Orders.CustomerID=Customers.CustomerID;

  Output:-


SEVER TYPE IN SSMS ( Sql Server Managment studio)

When you install the SQL Server management studio and then you want to connect with the SQL Server then there are four types of SQL servers ...