Creating Tables in SQLite: A Quick Guide
Q: How do you create a table in SQLite?
- SQL Lite
- Junior level question
Explore all the latest SQL Lite interview questions and answers
ExploreMost Recent & up-to date
100% Actual interview focused
Create SQL Lite interview for FREE!
To create a table in SQLite, you can use the CREATE TABLE statement. This statement will create a new table with the specified name and column definitions.
For example, if we wanted to create a table called "Cars" with three columns, "Manufacturer", "Model", and "Year", we could use the following statement:
CREATE TABLE Cars (
Manufacturer TEXT,
Model TEXT,
Year INTEGER
);
This statement creates a new table called "Cars" with three columns - "Manufacturer" (which is a text field), "Model" (also a text field), and "Year" (an integer field).
Once the table is created, you can add data to it using the INSERT statement. For example, if we wanted to add a row with a car made by Ford in 2020, we could use the following statement:
INSERT INTO Cars (Manufacturer, Model, Year)
VALUES ('Ford', 'Mustang', 2020);
The above statement will add a new row to the Cars table with the specified values.
Finally, you can query the data in the table using the SELECT statement. For example, if we wanted to get all cars made by Ford, we could use the following statement:
SELECT *
FROM Cars
WHERE Manufacturer = 'Ford';
This statement will return all rows from the Cars table where the Manufacturer field is equal to "Ford".
For example, if we wanted to create a table called "Cars" with three columns, "Manufacturer", "Model", and "Year", we could use the following statement:
CREATE TABLE Cars (
Manufacturer TEXT,
Model TEXT,
Year INTEGER
);
This statement creates a new table called "Cars" with three columns - "Manufacturer" (which is a text field), "Model" (also a text field), and "Year" (an integer field).
Once the table is created, you can add data to it using the INSERT statement. For example, if we wanted to add a row with a car made by Ford in 2020, we could use the following statement:
INSERT INTO Cars (Manufacturer, Model, Year)
VALUES ('Ford', 'Mustang', 2020);
The above statement will add a new row to the Cars table with the specified values.
Finally, you can query the data in the table using the SELECT statement. For example, if we wanted to get all cars made by Ford, we could use the following statement:
SELECT *
FROM Cars
WHERE Manufacturer = 'Ford';
This statement will return all rows from the Cars table where the Manufacturer field is equal to "Ford".


