MagnumDB Engine
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
Supported

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

ParameterTypeDescription
table_nameIdentifierName of the relation to construct.
column_nameIdentifierAttribute identifier.
data_typeType KeywordINT, TEXT, FLOAT, or BOOLEAN.
column_constraintConstraint KeywordPRIMARY 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.