Tuesday, 28 October 2014

Complex View



        If we create a view on more than one table then the view is complex view.

Example:
            Below link is having sample table creation:
                        Employee table
                        Department table

            View Creation:
CREATE VIEW Sample_Comp_View
AS
SELECT
      E.ID
      ,E.FirstName
      ,E.LastName
      ,E.Gender
      ,E.Designation
      ,E.ManagerID
      ,E.Dept_ID
      ,E.Salary
      ,E.Commission
      ,E.HireDate
FROM EMPLOYEE E
JOIN DEPT D ON E.DEPT_ID = D.DeptID

No comments:

Post a Comment