Technical Specification Manual
SQL Reference Manual
Formal parameter specifications, syntax definitions, and execution behavior for MagnumDB v0.4.8 SQL dialect.
CREATE TABLE
Category: Data Definition
Description
Defines a new relation schema in the database and allocates an initial B+ Tree root page.
Syntax
SYNTAX
sql
CREATE TABLE table_name (
column_name data_type [column_constraint ...],
...
);Parameters
| Parameter | Type | Description |
|---|---|---|
| table_name | Identifier | Name of the relation to construct. |
| column_name | Identifier | Attribute identifier. |
| data_type | Type Keyword | INT, TEXT, FLOAT, or BOOLEAN. |
| column_constraint | Constraint Keyword | PRIMARY KEY, UNIQUE, NOT NULL, DEFAULT val. |
Practical Examples
Basic Table Creation
SQL INPUT
sql
CREATE TABLE users (id INT PRIMARY KEY, username TEXT NOT NULL UNIQUE, age INT DEFAULT 18);EXPECTED OUTPUT
CREATE TABLE
Technical Notes & Constraints:
PRIMARY KEY columns act as UNIQUE indexes. FOREIGN KEY syntax is parsed by the lexer, but referential integrity is not enforced.