Working With Data: Creating Tables Using CREATE Command
Working With Data: Creating Tables Using CREATE Command
In this module, we'll delve into how to work with data in SQL, using our 'Bookstore Inventory'
database as a practical example. We'll cover creating tables, inserting, updating, deleting data,
and altering table structures.
Purpose: The CREATE TABLE command is used to create a new table in the database.
Example:
This creates a new table named 'Publishers' with three columns: PublisherID, Name, and
Address.
Purpose: The INSERT INTO command is used to add new rows (records) to a table.
Example:
Example:
Example:
Purpose: The ALTER TABLE command is used to modify the structure of an existing table,
such as adding, deleting, or modifying columns.
Adding a column:
Modify a column:
Delete a Column:
Practice Questions
Note: you don’t need to submit these practice questions, it’s just for practicing purposes, if you
face any doubts, feel free to ask in the discord server.