WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

Oracle Database · Basic · question 9 of 100

What is the difference between a table and a view in an Oracle database?

📕 Buy this interview preparation book: 100 Oracle Database questions & answers — PDF + EPUB for $5

In Oracle database, a table is a physical storage structure that contains rows and columns, where the data is stored permanently. On the other hand, a view is a virtual table that is derived from one or more tables or views in the database. A view does not store any data, rather it displays the data from one or more underlying tables or views as if they were a single table.

Let’s look at some of the differences between a table and a view in Oracle database:

1. Data storage: A table is a physical storage structure where the data is stored permanently on the disk. Whereas, a view is a logical structure that does not store any data on the disk, instead, it retrieves the data from the underlying tables or views.

2. Definition: A table has a distinct name and unique set of columns with a fixed data type and size. The columns in a table can be modified using Data Manipulation Language (DML) statements like INSERT, UPDATE, and DELETE. Whereas, a view is defined by a query that retrieves data from one or more tables or views. The columns in a view are not fixed and can be changed by modifying the underlying query. However, DML statements cannot be used directly on a view, and any changes to the data require modifying the underlying tables or views.

3. Data Access: Tables are used to store and manipulate data, whereas views are used to simplify data retrieval by abstracting the complexity of the underlying tables or views. A view can be used to hide certain columns or rows from the user based on their permission levels or business requirements.

4. Performance: A view may improve the performance of a query if it contains complex joins or aggregations that require significant computation. By storing the results of the computation in a view, the data can be accessed faster than by performing the computation each time the query is run. However, creating too many views may degrade the performance of the database as it requires more system resources.

In conclusion, tables and views in Oracle database serve different purposes. Tables are used for storing, modifying and managing data while views are used for querying and manipulating data from one or more underlying tables or views. A table is a physical structure, and a view is a logical structure. Understanding the differences between the two and their respective use cases will help in designing efficient and scalable database systems.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Oracle Database interview — then scores it.
📞 Practice Oracle Database — free 15 min
📕 Buy this interview preparation book: 100 Oracle Database questions & answers — PDF + EPUB for $5

All 100 Oracle Database questions · All topics