0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 6
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
To create a new table in a database, use the CREATE TABLE
statement followed by the name of the table and the fields you want in the table.
CREATE TABLE employees (id INTEGER, name TEXT, age INTEGER, is_manager BOOLEAN, salary INTEGER);
Each field name is followed by its datatype. We'll get to data types in a minute.
It's also acceptable and common to break up the CREATE TABLE
statement with some whitespace like this:
CREATE TABLE employees(
id INTEGER,
name TEXT,
age INTEGER,
is_manager BOOLEAN,
salary INTEGER
);
Let's begin building a table for CashPal database! Create the people
table with the following fields:
Integer
Text
Text
Integer
Integer
boolean
Use INTEGER
instead of INT
before submitting your code.
While both types are functionally identical, INTEGER
is the full standard-compliant keyword.
We prefer INTEGER
in this course for clarity, consistency, and better portability across SQL dialects.
PRAGMA TABLE_INFO(TABLENAME);
command in the test file returns information about a table and its fields.Focus Editor
Alt+Shift+]
Next Tab
Alt+Shift+[
Login to Submit
Login to Run
Login to view solution