Complex Views in SQL Server – SQL Server Tutorial

Complex Views in SQL Server:-

Views are based on more than one table and also based on

  • Group by clause
  • Having clause
  • Distinct clause
  • Aggregate   function
  • Expression.

Then view is said to be “complex view”.

Difference between simple view and complex view in sql:

Simple view

  • It is updatable  {updatable means allow DML operations}

complex view

  • but complex views are not updatable.    

Example : 

Create view v5 as select e.empno, e.ename, e.sal, d.deptno ,d.dname from  e.emp , d.dept.

  • Query fired on view takes more times than query fired on base table.

                      Views degrades performance

  • Select * from information_schema.views ( This maintains information about the views created by user)

Leave a Reply

Your email address will not be published. Required fields are marked *