Database / SQLite Interview questions
How do you create a table in SQLite?
Tables are created with standard SQL CREATE TABLE syntax, specifying column names and their
declared types (which determine type affinity), along with any constraints.
CREATE TABLE person ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, age INTEGER, email TEXT UNIQUE );
Running this via the sqlite3 command-line shell, or through any SQLite client library, creates
the table's schema entry and B-tree structure inside the database file immediately. Unlike some databases,
you don't need to specify a storage engine or tablespace — there's exactly one storage mechanism, and it
always lives in the single database file you're connected to.
More Related questions...