Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Riya PatelDevSocial team70.9K reputationPosted May 19, 2025, 6:12 AM EDT
Tables store actual data in the database, while Views are virtual tables that show data from one or more tables without storing it themselves. Views are used to simplify complex queries or hide specific columns for security.
Nitin PanditRank #22 · 45.4K reputationPosted May 19, 2025, 5:18 AM EDT
A table is a physical structure within a database that stores data in rows and columns, while a view is a virtual table that provides a simplified or customized presentation of data from one or more underlying tables.
Sangeetha SRank #212 · 11.4K reputationPosted May 19, 2025, 5:23 AM EDT
CREATE VIEW IT_Employees AS
SELECT Name FROM Employees WHERE Department = 'IT';
CREATE TABLE Employees (
ID INT,
Name VARCHAR(100),
Department VARCHAR(50)
);
Alpesh ManiyaRank #832 · 2.7K reputationPosted May 19, 2025, 8:26 AM EDT
A table stores the actual data, while a view is the combination of one or more tables logically. It simplifies the use and security. if we don't want to expose the columns directly from the table, then we can prepare the view, and it will be accessible in the same way as the table.
Kritika42 reputationPosted May 22, 2025, 12:40 AM EDT
In a database, a table is like a container where actual data is stored. It has rows and columns, like an Excel sheet. You can add, change, or delete data in a table directly. A view, on the other hand, is not a real table. It just shows data from one or more tables, based on a saved query. Views are helpful when you want to see only part of the data or want to make complex queries easier. You can use a view like a table, but you usually can’t change data through a view.
Table:
View:
Sandhiya PriyaRank #26 · 43.2K reputationPosted Oct 27, 2025, 1:00 AM EDT
What is a Table?
A table is a physical structure in a database that stores data permanently in rows and columns.
Example:
CREATE TABLE Employees ( EmpID INT PRIMARY KEY, EmpName VARCHAR(100), Department VARCHAR(50), Salary DECIMAL(10,2) );Here,
Employeesis a table that physically stores data.Key Points:
Stores actual data.
Consumes physical storage space.
Can have indexes, primary/foreign keys, constraints.
Data can be modified directly (
INSERT,UPDATE,DELETE).What is a View?
A view is a virtual table based on the result of a SELECT query.
It doesn’t store data physically; it just displays data from one or more tables.
Example:
CREATE VIEW EmpDetails AS SELECT EmpName, Department, Salary FROM Employees WHERE Department = 'HR';Here,
EmpDetailsis a view that shows filtered data fromEmployees, but the data actually resides in the Employees table.Key Points:
Virtual table (no physical data storage).
Stores only the query, not data.
Used to simplify complex queries.
Provides security by restricting access to certain columns/rows.
You can read/update data (in some cases) through views if based on a single table.
Difference Between Table and View
Example Scenario
Suppose you have a table:
SELECT * FROM Employees;Now, if you want only HR department details:
CREATE VIEW HR_Employees AS SELECT EmpID, EmpName, Salary FROM Employees WHERE Department = 'HR';Now you can query:
SELECT * FROM HR_Employees;— which is much simpler and more secure (hides other departments).
Interview Tip: A table holds data physically, while a view provides a virtual, logical representation of data derived from one or more tables.
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Oct 28, 2025, 8:31 AM EDT
Hello Baibhav,
Table
A table is a physical storage structure in a database that holds data in rows and columns.
Key Features:
Stores actual data.
Can be modified directly (INSERT, UPDATE, DELETE).
Has indexes for performance optimization.
Data persists until explicitly deleted.
Example:
?? View
A view is a virtual table based on the result of a SQL query. It does not store data itself.
Key Features:
Does not store data; it displays data from one or more tables.
Acts as a saved query.
Can simplify complex queries.
May or may not be updatable (depends on the SQL dialect and view definition).
Useful for security (restricting access to specific columns/rows).
Example:
?? Summary Table
Thanks