Which of the following are correct SQL statements for creating a table?
I. CREATE TABLE table_name (column1 datatype, column2 datatype);
II. CREATE TABLE table_name (column1, column2, column3);
III. CREATE TABLE table_name (column1 INT PRIMARY KEY, column2 VARCHAR (50));
IV. CREATE table_name (column1 datatype, column2 datatype);
Explanation
To create a new table in a database using SQL, the mandatory syntax rules are:
It must start with the standard keywords: CREATE TABLE.
The table name must be specified.
Inside the parentheses, each column name must be explicitly followed by its corresponding data type (and optional constraints).
Let us analyze each statement based on these rules:
Statement I is correct: It represents the generic syntax blueprint for creating a table with explicit columns and data types:
CREATE TABLE table_name (column1 datatype, column2 datatype);
Statement II is incorrect: It lists column names but completely omits their mandatory data types (e.g., INT, VARCHAR). A database cannot allocate structural space without knowing data types.
Statement III is correct: It is a perfectly valid implementation of the syntax, supplying standard definitions (INT and VARCHAR (50)) alongside a PRIMARY KEY constraint:
CREATE TABLE table_name (column1 INT PRIMARY KEY, column2 VARCHAR (50));
Statement IV is incorrect: It omits the mandatory keyword TABLE right after CREATE. The command CREATE table_name is syntactically invalid in standard SQL processing.
Therefore, because only statements I and III strictly follow the structural rules of Data Definition Language, choice (c) is the right answer.