/  21
 
1.
What are the different types of Joins?
Ans.
 
Joins
as used to combine the contents of two or more tables and produce a result setthat incorporates rows and columns from eachtable. Tables are typically joined using datathat they have in common Join conditions canbe specified in either the FROM or WHEREclauses; specifying them in the FROM clauseis recommended. WHERE and HAVING clauses canalso contain search conditions to furtherfilter the rows selected by the join conditions.Joins can be categorized as:
Inner joins
- (the typical join operation, whichuses some comparison operator like = or <>). Aninner join is a join in which the values in thecolumns being joined are compared using acomparison operatorInner joins use a comparison operator to matchrows from two tables based on the values incommon columns from each table.
Equi Join
- It returns all the columns in bothtables, and returns only the rows for whichthere is an equal value in the join column( SELECT * FROM authors AS a INNER JOINpublishers AS p ON a.city = p.city ORDERBY a.au_lname DESC )
Self Join
- A table can be joined to itself in a self-join
 
Patni GE Confidential
1
 
Outer joins
- Outer joins can be a left,right, or full outer join. Outer joins arespecified with one of the following sets of keywords when they are specified in the FROMclause:
LEFT JOIN or LEFT OUTER JOIN
-The result set of a left outer join includesall the rows from the left table specified inthe LEFT OUTER clause, not just the ones inwhich the joined columns match. When a row inthe left table has no matching rows in theright table, the associated result set rowcontains null values for all select listcolumns coming from the right table.
RIGHT JOIN or RIGHT OUTER JOIN
-A right outer join is the reverse of a leftouter join. All rows from the right table are returned.Null values are returned for the left table any timea right table row has no matching row in the lefttable.
FULL JOIN or FULL OUTER JOIN
-A full outer join returns all rows inboth the left and right tables. Any time a rowhas no match in the other table, the selectlist columns from the other table contain nullvalues. When there is a match between the tables,the entire result set row contains data valuesfrom the base tables.
Patni GE Confidential
2
 
Cross joins
- Cross joins return all rows fromthe left table, each row from the left tableis combined with all rows from the right table.Cross joins are also called Cartesian products.
2.
What is diff. between left and Rightouter Join?
Ans.
The result set of a left outer joinincludes all the rows from the left tablespecified in the LEFT OUTER clause , while in caseof Right outer join all the rows from theright table are returned in the result set.
3.
Why we use Unicode In Sql server?
Ans.
Using Unicode data types, a column can storeany character that is defined by the UnicodeStandard, which includes all of the charactersthat are defined in the various character sets.Unicode data types take twice as much storagespace as non-Unicode data types.Unicode data is stored using the nchar, nvarchar,and ntext data types in SQL Server. Use thesedata types for columns that store charactersfrom more than one character set. The SQL ServerUnicode data types are based on the NationalCharacter data types in the SQL-92 standard
4.
What is
Fill Factor
and its value when theindex is created.
Ans.
An option used when creating an index toreserve free space on each page of the index.FILLFACTOR accommodates future expansion of 
Patni GE Confidential
3

Share & Embed

More from this user

Add a Comment

Characters: ...