Recall & Review
beginner
What is the purpose of the CREATE TABLE statement in SQL?
The CREATE TABLE statement is used to make a new table in a database where data can be stored in rows and columns.
Click to reveal answer
beginner
Which keyword is used to define a column's data type in a CREATE TABLE statement?
The data type of a column is defined right after the column name, for example:
column_name INT means the column stores integers.Click to reveal answer
intermediate
What does the PRIMARY KEY constraint do in a CREATE TABLE statement?
PRIMARY KEY ensures that each row in the table has a unique and not null value in that column, helping to identify each record uniquely.
Click to reveal answer
beginner
Write the basic syntax to create a table named 'Students' with columns 'ID' as integer and 'Name' as text.
CREATE TABLE Students (ID INT, Name TEXT);
Click to reveal answer
intermediate
Can you add a NOT NULL constraint to a column in CREATE TABLE? What does it mean?
Yes, adding NOT NULL means the column must always have a value; it cannot be left empty when inserting data.
Click to reveal answer
Which SQL command is used to create a new table?
✗ Incorrect
CREATE TABLE is the command used to make a new table in the database.
In the statement
CREATE TABLE People (Age INT);, what does INT specify?✗ Incorrect
INT specifies that the Age column will store integer numbers.
What does the PRIMARY KEY constraint ensure?
✗ Incorrect
PRIMARY KEY makes sure each value in the column is unique and not empty.
Which of these is a valid CREATE TABLE syntax?
✗ Incorrect
The correct syntax includes the table name followed by columns in parentheses.
What does NOT NULL mean when used in a column definition?
✗ Incorrect
NOT NULL means the column cannot be left empty when inserting data.
Explain the basic structure of a CREATE TABLE statement and what each part does.
Think about how you tell the database to make a new box with labeled sections.
You got /5 concepts.
Describe how constraints like PRIMARY KEY and NOT NULL affect the data stored in a table.
Constraints are rules that keep the data clean and organized.
You got /4 concepts.