Table Queries
Operation we will perform on a table are called table queries.
Creating TABLE
syntax.sql
CREATE TABLE table_name (
column1_name column1_datatype,
column2_name column2_datatype,
...
);
💡
The CREATE TABLE
statement is used to create a new table in a database.
Example:
example.sql
CREATE TABLE course(
cid INT,
cname VARCHAR(50),
);
INSERT VALUES
syntax.sql
INSERT INTO table_name (column1, column2, column3, ...);
💡
The INSERT INTO
statement is used to insert new records in a table.
Example:
example.sql
INSERT INTO course (cid, cname) VALUES (1, 'Java'), (2, 'Python');