Navigate
JavaScript Tutorial for Beginners
The Ultimate CSS Tutorial for Beginners
Data Structure Tutorial for Beginners
ReactJS Tutorial for Beginners
Java Tutorial for Beginners
Node.js Tutorial for Beginners
SQL Tutorial for Beginners
Content
- Creating a Table
- Altering a Table
- Dropping a Table
- Activity
- Quiz
- Updated on 10/09/2024
- 450 Views
Creating a Table
Use the CREATE TABLE statement to define a new table and its columns.
Altering a Table
Use the ALTER TABLE statement to modify an existing table structure.
Dropping a Table
Use the DROP TABLE statement to remove a table and all its data.
Activity
Create a new table named customers, add a column for email, and then delete the table.
Quiz
What is the SQL command used to create a new table?
- CREATE TABLE
- NEW TABLE
- ADD TABLE
- MAKE TABLE
How do you add a new column to an existing table?
- ALTER TABLE ADD COLUMN
- UPDATE TABLE ADD COLUMN
- CREATE TABLE ADD COLUMN
- MODIFY TABLE ADD COLUMN
What does the DROP TABLE command do?
- Deletes the table and its data
- Adds a new column to the table
- Renames the table
- Updates existing records
Which SQL command would you use to change the data type of a column?
- MODIFY TABLE
- ALTER TABLE
- CHANGE TABLE
- UPDATE TABLE
How can you make a column the primary key of a table?
- Use PRIMARY KEY in the CREATE TABLE statement
- Use ALTER TABLE to add PRIMARY KEY
- Use UPDATE TABLE to set PRIMARY KEY
- Use INSERT INTO to designate PRIMARY KEY