Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Aug 16, 2024
1 parent 1d1b9c4 commit 4bd7c89
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sqlite/examples/update.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE people (
name TEXT,
grade INTEGER
);

INSERT INTO people (name, grade) VALUES ('Joe', 40);
INSERT INTO people (name, grade) VALUES ('Jane', 60);
SELECT * from people;
SELECT "";

UPDATE people SET grade = 44 WHERE name = "Joe";
SELECT * from people;
SELECT "";

UPDATE people SET grade = (SELECT grade FROM people WHERE name = "Joe") + 1 WHERE name = "Joe";
SELECT * from people;
SELECT "";

15 changes: 15 additions & 0 deletions sqlite/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,23 @@ Meaning of life?|42
## Transactions
{id: transactions}

![](examples/transaction.sql)

## PRAGMA
{id: pragma}

[PRAGMA](https://sqlite.org/pragma.html)

## UPDATE
{id: update}

![](examples/update.sql)




* TODO: loading a large CSV file into the database and running queries.
* TODO: creating a multi-tabe databas, dumping it and then loading it and running queries against it.
* TODO: FOREIGN KEY - cascading deletition?


0 comments on commit 4bd7c89

Please sign in to comment.