1.) What are the Joins Concepts in SQL Server ?
Joins are the concepts which are used to get the related data from more than one table in SQL Server.That is basically used to get the more than one related tables data by a single sql command.
2.) What are the types of Joins used in SQL Server ?
Joins are the concepts which are used to get the related data from more than one table in SQL Server.That is basically used to get the more than one related tables data by a single sql command.
2.) What are the types of Joins used in SQL Server ?
- Inner Join
- Outer Join
- Self Join
- Cross Join
3.) What is Inner Join and why we use it in SQL Server ?
In Inner Join , we get values from those table which have at least one column same.If no column value is same then we can't use inner join concepts on those tables.
If we want to get only those tables records whose values are same in all the joined tables.
select sid,sname,cname from studentdetails join scourse
on id=sid
4.) What is Outer Join in SQL Server ?
5.) What are the types of Outer Join in SQL Server?
- Left Outer Join
- Right outer join
- Full outer join
6.) What is Left Outer Join in SQL Server?
If we want to show matched and unmatched records from left side table and matched record only right side table,then we can use left outer join concepts.
Ex.
select sid,sname,course_name,sage from scourse c Left join studentdetails s on c.id=s.sid
7.) What is right Outer Join in SQL Server?
if we want to show matched ,unmatched records from right side table and matched records only left side table ,then we can use Right outer join concepts.
Ex.
select sid,sname,course_name from scourse c Right join studentdetails s
on c.id=s.sid
8.) What is Full Outer Join in SQL Server?
If we want to display all matched and unmatched records from left and right side table then ,we can use full outer join concepts.
Ex.
select sid,sname,course_name from scourse c full outer join studentdetails s on c.id=s.sid
9.) What is Self Join concepts in SQL Server?
When the related data exist within the same table then we can implement self join concepts in SQL Server.
Ex.
Select s.sid,s.sname,T.sid ,T.sname from students s join students T on s.sid =T.sid
10.) What is Cross Join concepts in SQL Server?
Ex.
select sid,sname,course_name from scourse c cross join students s
11.) What are the two sql commands that are used to get the same records form two or more tables?
- Select*from students,scourse
- select sid,sname,course_name from scourse c cross join students s
0 comments:
Post a Comment