WRITTEN BY: supportmymoto.com STAFF
Hello All,
Everyone knows about Joins and idea .
Lets do it in HANA studio and canopy under factors :
- Overview of HANA studio
- Joins idea
- Creating Schema
- Creating Tables
- Insert Values into Tables
- Utilizing SQL to grasp under Joins in HANA Studio
– Inside Be part of
– Left Outer Be part of
– Proper Outer Be part of
– Full Outer Be part of
First lets create Schema during which tables can be created for Evaluation
We’re writing code to create Schema – Joins_Demo, refer under display shot for identical.
We’re going to create under two tables in Schema which can be used for explaining the Joins
Consult with under SQL code which is used for creating desk “Employee_Table” in Schema which we created earlier
Consult with under display shot which is used for inserting values into desk which we created simply now
Proper Click on on desk and choose open content material, you will note the entries into desk simply now
Now lets create second desk “Booking_Details”, consult with under code for creating desk and inserting values
Proper Click on on the desk simply created and choose open content material, this may show entries which we inserted in earlier step
Lets begin with Joins now as we’ve Schema and two tables created
Inside Be part of –
Inside Be part of selects the set of information that match in each the tables
SQL Code
SELECT A2.“Booking_ID”, A1.“Employee_ID”, A1.“Employee_Name”, A2.“Product_ID”, A2.“Total_Units”
FROM “Employee_Table” AS A1
INNER JOIN “Booking_Details” AS A2
Left Outer Be part of –
The Left Outer Be part of selects the entire set of information from first desk , with the matching information (the place obtainable) in second desk . If there is no such thing as a match, the proper aspect will comprise null
SQL Code –
SELECT A2.“Booking_ID”, A1.“Employee_ID”, A1.“Employee_Name”, A2.“Product_ID”, A2.“Total_Units”
FROM “Employee_Table” AS A1
LEFT OUTER JOIN “Booking_Details” AS A2
ON A1.“Employee_ID” = A2.“Employee_ID”
Proper Outer Be part of –
The Proper Outer Be part of selects the entire set of information from second desk , with the matching information (the place obtainable) in first desk . If there is no such thing as a match, the left aspect will comprise null.
SQL Code-
SELECT A2.“Booking_ID”, A1.“Employee_ID”, A1.“Employee_Name”, A2.“Product_ID”, A2.“Total_Units”
FROM “Employee_Table” AS A1
RIGHT OUTER JOIN “Booking_Details” AS A2
ON A1.“Employee_ID” = A2.“Employee_ID”
FULL OUTER JOIN –
The INNER JOIN selects the set of information that match in each the Tables.
SQL Code –
SELECT A2.“Booking_ID”, A1.“Employee_ID”, A1.“Employee_Name”, A2.“Product_ID”, A2.“Total_Units”
FROM “Employee_Table” AS A1
FULL OUTER JOIN “Booking_Details” AS A2
ON A1.“Employee_ID” = A2.“Employee_ID”;
See You Quickly with extra Blogs and Paperwork. Please present suggestions