Академический Документы
Профессиональный Документы
Культура Документы
Introduction
• MS SQL Server is a database server
• Product of Microsoft
• Enables user to write queries and other
SQL statements and execute them
• Consists of several features. A few are:
– Query Analyzer
– Profiler
– Service Manager
– Bulk Copy Program (BCP)
Profiler
• Monitoring tool
• Used for performance tuning
• Uses traces – an event monitoring
protocol
If I put
Select A.Id, B.Id from A,B
This generates output as
A1
B1
C1
A2
B2
C2
Self Join
There is a table called Emp with the following structure:
empid ename mgrid
1 A null
2 B 1
3 C 1
4 D 2
If I want to print all managers using self join, I should write quey as:
Employee
Eid EName Mid
1 ABC 1
2 DEF 3
Machine
Mid ManufacturerName
1 Zenith
2 HP
Left Outer Join
I want to print the employee name and machine name.
If I write a query using inner join, then the second employee will
not be displayed as the mid in his record is not avilable with the second
table.
Machine
Mid ManufacturerName
1 Zenith
2 HP
Right Outer Join
If I want to find which machine is unallocated, I can use right outer join.