Skip to content

Commit

Permalink
database where id tip + syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
solderq35 committed Aug 31, 2023
1 parent ed09182 commit 3e8cc10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ description: Deep Dive on MySQL Database
- `DELETE`
- You don't have to specify the primary key (usually called `id`) for `INSERT INTO`, but it is good practice
- You can use a range for the primary key like `WHERE ID < 5` if you have to mass delete / insert / update something, but **do so with caution**
- You can also specify a finite range of primary key values with `WHERE ID in (5, 6)` (example)
- We don't have a dev database, so any changes in MySQL workbench hit production right away, so to speak. It can also be a good idea to back up data (e.g. as an Excel table, or at least taking some screenshots of what the database looked like) before performing any operation that could affect a lot of data entries
- If in doubt what a certain database column means or what the database column value should be, it may be a good idea to just copy the same value that previous entries used (e.g. I'm not sure why the `goal` value in `campaign_groups` is historically set to `100.048`, but just keep it the same for new entries)
- Or, just leave the value NULL, e.g. many of the newer buildings leave `building_id` value blank. Use your best judgement and cheeck other (particularly recent) entries
- Or, just leave the value as `NULL`, e.g. many of the newer buildings leave `building_id` value blank. Use your best judgement and cheeck other (particularly recent) entries

## Relationships between Tables

Expand Down

0 comments on commit 3e8cc10

Please sign in to comment.