Copyright © 2024 SingChun Lee Bucknell University. All rights reserved. Sites developed using revealjs.
Command/Query | Example | Meaning |
---|---|---|
.open --new xx.db | .open --new database.db | Create a new database |
.open xx.db | .open database.db | Open a database |
CREATE TABLE table (definition); | CREATE TABLE users (name TEXT); | Create a table with a schema |
SELECT fields FROM table; | SELECT name FROM users; | Query data from a table |
UPDATE table SET field1=value1, ...; | UPDATE users SET name="abc"; | Update fields in a table |
INSERT INTO table (fields) VALUES (values); | INSERR INTO table (name) VALUES ("abc"); | Add data to a table |
XXXXX WHERE condition; | SELECT * FROM users WHERE name="abc"; | Conditions to filter data |