Skip to content

Commit

Permalink
missing values
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Aug 15, 2024
1 parent b9815f3 commit fa48684
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sqlite/examples/missing-integer-value.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE qa (
question TEXT,
answer INTEGER
);

INSERT INTO qa (question, answer) VALUES ('2+2', 4);
INSERT INTO qa (question, answer) VALUES ('2-2', 0);
INSERT INTO qa (question) VALUES ('Meaning of life?');
SELECT * from qa;

10 changes: 10 additions & 0 deletions sqlite/examples/missing-text-value.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE qa (
question TEXT,
answer TEXT
);

INSERT INTO qa (question, answer) VALUES ('Language?', 'SQL');
INSERT INTO qa (question, answer) VALUES ('Database?', 'SQLite');
INSERT INTO qa (question) VALUES ('Meaning of life?');
SELECT * from qa;

21 changes: 21 additions & 0 deletions sqlite/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ $ sqlite3 demo.db < autoincrement.sql
$ rm -f demo.db
```

## Missing value
{id: missing-value}

![](examples/missing-text-value.sql)

```
$ sqlite3 demo.db < missing-text-value.sql ; rm -f demo.db
Language?|SQL
Database?|SQLite
Meaning of life?|
```

![](examples/missing-integer-value.sql)

```
$ sqlite3 demo.db < missing-integer-value.sql ; rm -f demo.db
2+2|4
2-2|0
Meaning of life?|
```

## Field with DEFAULT value
{id: field-with-default-value}

Expand Down

0 comments on commit fa48684

Please sign in to comment.