Difference between View and Cursor in SQL Last Updated : 06 Jun, 2022 Comments Improve Suggest changes Like Article Like Report 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 column from the table and hide the other database details. View also permits users to access data according to their requirements, so the same data can be access by a different user in a different way according to their needs. 2. Cursor : A cursor is a temporary work area created in memory for processing and storing the information related to an SQL statement when it is executed. The temporary work area is used to store the data retrieved from the database and manipulate data according to need. It contains all the necessary information on data access by the select statement. It can hold a set of rows called active set but can access only a single row at a time. There are two different types of cursors - 1. Implicit Cursor 2. Explicit Cursor Difference between View and Cursor in SQL : Sr.No.Basis of ComparisonViewCursor1.TerminologyA view is a virtual table that gives logical view of data from base table.A CURSOR (CURrent Set of Records) is a temporary workstation created in the database server when the SQL statement is executed.2.NatureViews are dynamic in nature which means any changes made in base table are immediately reflected in view.Cursor can be static as well as dynamic in nature.3.OperationsWe can perform CRUD operations on view like create, insert, delete and update. There are some steps for creating a Explicit cursor - Declare the cursor in declaration section.Open the cursor in execution section.Fetch the cursor to retrieve data into PL/SQL variable.Close the cursor to release allocated memory. 4. Data retrievalViews are used to fetch or update data.Using cursors, data retrieval from the resultset takes place row by row.4.TypesThere are two types of view i.e. Simple View (created from the single table) and Complex View (created from multiple tables). In simple view, group functions like COUNT(), MIN(), can be used whereas in complex view group functions cannot be used.Cursor has two types i.e. Implicit Cursor (pre-defined) and Explicit Cursor (user defined). Implicit cursor gets automatically created by Oracle whenever DML operations or SQL statement is executed whereas in explicit cursor user need to define them explicitly by giving a name.5.UsageView is a database object similar to table so it can be used with both SQL and PL/SQL.The cursor is defined and used within the block of stored procedure which means it can be only used with PL/SQL.6.SyntaxGeneral Syntax of Creating View : CREATE VIEW "VIEW_NAME" AS "SQL Statement"; General Syntax of Creating Explicit Cursor: CURSOR cursor_name IS select_statement; Comment More infoAdvertise with us Next Article Difference between View and Cursor in SQL M meghasaki Follow Improve Article Tags : DBMS Difference Between SQL DBMS-SQL Similar Reads Difference between Simple and Complex View in SQL 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 o 2 min read Difference between Cursor and Trigger in DBMS A cursor can be referred to as a pointer to the context. The context area is a memory area that Oracle creates when processing the SQL statement. The cursor is thus responsible for holding the rows that the SQL statement has returned. Therefore the PL/SQL controls the context area with the help of t 4 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 Difference between DBMS and SQL 1. Database management system (DBMS) :Database management system (DBMS) is a software that manage or organize the data in a database. We can arrange the data in a tabular form (i.e. in row or column). It helps the user to retrieve the data from the database.Best examples of DBMS are - MYSQL, ORACLE, 2 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 Like