This content originally appeared on DEV Community and was authored by Damian Brdej
To create table in SQL you have to use following syntax
CREATE TABLE table_name (
column_1 datatype,
column_2 datatype,
column_3 datatype
);
It's important to place comma after each column definition, and semicolon after whole statement.
Here's real life example:
CREATE TABLE users (
id INT,
name VARCHAR(255),
surname VARCHAR(255),
email VARCHAR(255),
password VARCHAR(255)
);
This statement creates table with 4 columns. First one is of type INT which means integer value. The other 4 columns are of type VARCHAR(255) which means TEXT with maximum length of 255. You can place any number in brackets to define length.
This content originally appeared on DEV Community and was authored by Damian Brdej

Damian Brdej | Sciencx (2021-07-05T17:06:17+00:00) How to create table in SQL?. Retrieved from https://www.scien.cx/2021/07/05/how-to-create-table-in-sql/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.