CompTIA DataSys+ (DS0-001)Database FundamentalsEasy
A database administrator is designing a new database for a small business. They need to store customer information, including a unique customer ID, name, and address. Which SQL keyword would be used to define the structure of the `Customers` table, including data types and constraints for these fields?
- AINSERT
- BCREATE TABLE
- CSELECT
- DALTER TABLE
Show answer & explanationAnswer & explanation
Correct answer: B. CREATE TABLE
The CREATE TABLE statement is used to define a new table in a database, specifying its name, columns, data types, and constraints. This is the fundamental command for structuring data storage.
Why the other options are wrong
- A. INSERT is used to add new rows of data into an existing table, not define its structure.
- C. SELECT is used to retrieve data from one or more tables, not to create tables.
- D. ALTER TABLE is used to modify the structure of an existing table, not to create a new one.
CREATE TABLE
A SQL Data Definition Language (DDL) command used to define a new table in a relational database.
- Specifies table name, column names, and data types.
- Allows definition of constraints like PRIMARY KEY, UNIQUE, NOT NULL.
- Foundation for structuring data storage.
Memory trick: DDL: Define, Design, Destroy, Develop.