Friday, January 26, 2024

Create table in SQL

Create Table in postgre SQL

It is always advisable to make small tables in SQL to practice queries. Below is an explanation of How to make a simple table in SQL.


CREATE command is used to create a new table in the database


Syntax: create table TABLE_NAME (COLUMN_NAME data type[,....]);

INSERT  command is used to create a new table in the database

Syntax: insert into TABLE_NAME (col1, col2, col3,.... col N) values (value1, value2, value3,... valueN);


Example table ;





QUERY ; 

  Syntax:

create table Table_1 (A varchar); Insert into Table_1 (A)

values ('x'),('x'),('y'),('z');

select * from Table_1;








No comments:

Post a Comment