TABLE

SQL TABLE Keyword

The TABLE keyword is used in several SQL statements such as CREATE TABLE, ALTER TABLE, DROP TABLE, and TRUNCATE TABLE. These commands allow you to create, modify, and delete tables in a database.

SQL CREATE TABLE Syntax

SQL

Tutorials dojo strip

SQL CREATE TABLE Example

This query creates a new table named Rooms with four columns.

SQL

SQL CREATE TABLE Using Another Table Syntax

SQL

SQL CREATE TABLE Using Another Table Example

This query creates a new table DoctorsBackup that copies data from Doctors.

SQL

SQL ALTER TABLE Syntax

SQL
SQL

SQL ALTER TABLE ADD COLUMN Example

This query adds a new column room_color to the Rooms table.

SQL

SQL ALTER TABLE DROP COLUMN Example

SQL

SQL DROP TABLE Syntax

SQL

SQL DROP TABLE Example

This query deletes the Rooms table.

SQL

SQL TRUNCATE TABLE Syntax

SQL

SQL TRUNCATE TABLE Example

SQL

Note: This syntax does not work in TechKubo playground. SQLite does not support the TRUNCATE TABLE command. Use DELETE FROM table_name; instead if needed.

SQL TABLE Labs

Tutorials dojo strip