Introduction
Hello, ninjas! You must have encountered terms like table, database, SQL, etc. In this article, we will study the difference between Table and View in a relational database.

SQL(Structured Query Language) is used to access and manipulate databases. Table and View are vital parts of a relational database and have their features.
Let us first study a Table in a Database.
Table
In a relational database, data is stored as ordered rows and columns. That database object is called a Table. The name of a table must be unique in a database. Also, the name of the table must not be a SQL keyword. The table's name is not case-sensitive and should not match any other object's name in the schema.
Each column in a database represents the attribute of that table. Each row in a database represents a set of attribute values of that table. Each column(attribute) has a name and associated data type.
Syntax
Let us look at the syntax for creating a table, inserting values in it and how to view the table.
Creating a Table
CREATE TABLE table_name(
column_declaration_1,
column_declaration_2,
column_declaration_3,
……,
);
Inserting values in a Table
INSERT INTO table_name (column_list) VALUES
(values_row_1),
(values_row_2),
…..
(values_row_n);
Viewing a Table
This syntax is for viewing the whole table.
SELECT * FROM table_name;
This syntax is for viewing specific columns of the table.
SELECT column_1, coumn_2,….. FROM table_name;
Example
Let us look at a table named “univ” shown below:

It is a table with four attributes:-
-
s_no:- It represents the overall numbering of the rows of the table.
-
name:- It represents the name of the student.
-
course:- It represents the name of the course the student is studying.
- roll_no:- It represents the roll number of the student.
If we have to create the table "univ" in a relational database, we will use the following commands:-
CREATE TABLE univ(
s_no int,
name varchar(20),
course varchar(40),
roll_no int);
INSERT INTO univ VALUES
(1, "Michael", "Chemistry", 74),
(2, "Maze", "Physics", 75),
(3, "Priya", "Mathematics", 76),
(4, "Rachel", "Mathematics", 77);
SELECT * FROM univ;
Output

Also see, TCL Commands in SQL