Difference between Simple and Complex View in SQL Last Updated : 11 Apr, 2023 Comments Improve Suggest changes Like Article Like Report A View in SQL as a logical subset of data from one or more tables. Views are used to restrict data access. A View contains no data of its own but it is like a window through which data from tables can be viewed or changed. The table on which a View is based is called BASE Tables. There are 2 types of Views in SQL: Simple View and Complex View. Simple views can only contain a single base table. Complex views can be constructed on more than one base table. In particular, complex views can contain: join conditions, a group by clause, order by clause. Working of views:When call view in SQL query it refers to database and finds definition of views which is already stored in database.Then the DBMS convert this call of view into equal request on the base tables of the view and carries out the operations written in view definition and returns result set to query from which view is called. The key differences between Simple and Complex types of Views are as follows: S. No.Simple ViewComplex View1.Contains only one single base table or is created from only one table. Contains more than one base table or is created from more than one table.2.We cannot use group functions like MAX(), COUNT(), etc. We can use group functions.3.Does not contain groups of data. It can contain groups of data.4.DML operations could be performed through a simple view. DML operations could not always be performed through a complex view.5.INSERT, DELETE and UPDATE are directly possible on a simple view. We cannot apply INSERT, DELETE and UPDATE on complex view directly.6.Simple view does not contain group by, distinct, pseudocolumn like rownum, columns defined by expressions. It can contain group by, distinct, pseudocolumn like rownum, columns defined by expressions.7.Does not include NOT NULL columns from base tables. NOT NULL columns that are not selected by simple view can be included in complex view.8.In simple view, no need to apply major associations because of only one table.In complex view, because of multiple tables involved general associations required to be applied such as join condition, group by or a order by clause.9. Example: CREATE VIEW Employee ASSELECT Empid, EmpnameFROM EmployeeWHERE Empid = '030314'; Example: CREATE VIEW EmployeeByDepartment AS SELECT e.emp_id, d.dept_id, e.emp_name FROM Employee e, Department d WHERE e.dept_id=d.dept_id; Comment More infoAdvertise with us Next Article Difference between Simple and Complex View in SQL A akanshgupta Follow Improve Article Tags : Misc Technical Scripter DBMS Difference Between SQL +1 More Practice Tags : Misc Similar Reads Difference between View and Cursor in SQL 1. View : A view is a virtual table that not actually exist in the database but it can be produced upon request by a particular user. A view is an object that gives the user a logical view of data from a base table we can restrict to what user can view by allowing them to see an only necessary colum 3 min read Difference between SQL and T-SQL SQL (Structured Query Language) is the standard language for managing and manipulating relational databases, enabling operations like querying, updating, and deleting data. T-SQL (Transact-SQL), an extension of SQL developed by Microsoft, adds advanced features and procedural capabilities specifical 4 min read Difference between JOIN and UNION in SQL Pre-requisites: JOIN, UNION JOIN in SQL is used to combine data from many tables based on a matched condition between them. The data combined using the JOIN statement results in new columns. Consider the two tables: Boys Girls Example: sql> SELECT Boys.Name, Boys.Age, Girls.Address, FROM Boys INN 2 min read Difference between T-SQL and PL-SQL 1. Transact SQL (T-SQL) : T-SQL is an abbreviation for Transact Structure Query Language. It is a product by Microsoft and is an extension of SQL Language which is used to interact with relational databases. It is considered to perform best with Microsoft SQL servers. T-SQL statements are used to pe 3 min read Difference Between View and Table In the world of database management systems (DBMS), views and tables are fundamental concepts that help in storing and managing data efficiently. While both terms are used frequently, they serve distinct purposes within a relational database. Understanding the difference between a view and a table i 5 min read Like