Suggest an editImprove this articleRefine the answer for “How do you create a table in SQL?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To create a table in SQL, use the `CREATE TABLE` command: it defines the table's name, its fields, their data types, and constraints (such as a primary key). **Key point:** once this query runs, the table is created in the database and ready to have data added with `INSERT`.Shown above the full answer for quick recall.Answer (EN)ImageTo create a table in SQL, use the `CREATE TABLE` command. It defines the table's name, its fields, their data types, and constraints (such as a primary key). ### Syntax ```sql CREATE TABLE table_name ( field1 data_type constraints, field2 data_type constraints, ... PRIMARY KEY (field1) ); ``` ### Example: creating an Employees table ```sql CREATE TABLE Employees ( id INT PRIMARY KEY, -- unique identifier name VARCHAR(50) NOT NULL, -- employee name, required age INT, -- age department_id INT -- reference to a department ); ``` ### Explanation - `id INT PRIMARY KEY` is the primary key, unique for every record. - `name VARCHAR(50) NOT NULL` is a text field up to 50 characters, required. - The remaining fields can be filled in or left empty. Once this query runs, the table is created in the database and ready to have data added with `INSERT`.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.