Skip to content

Commit 26d3538

Browse files
committed
some fixes based on review
1 parent 2d5bc8c commit 26d3538

File tree

2 files changed

+15
-3
lines changed
  • module2-database-technologies

2 files changed

+15
-3
lines changed

module2-database-technologies/r1-introduction-to-databases/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,13 @@ want to persist data for future use. For example, in a web application, when a
66
user writes something in a text box, this data will be lost when the page is
77
refreshed -- unless this data is persisted in a database.
88

9-
Databases are a ubiquitous and foundational part of backend technology.
9+
Databases are a ubiquitous and foundational part of backend technology. One
10+
would use databases instead of local storage or cookies, for example, when the
11+
information being persisted needs to be available to any possible client. For
12+
example, information stored in [local
13+
storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) is not automatically synchronized
14+
across browsers. For example, if you were to store information about user
15+
settings in local storage, then those settings would no longer be available on a
16+
different browser -- but if you store them in a database, the user can access
17+
them from any client.
1018

module2-database-technologies/r2.2-sql-queries/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ examples, we will be using MySQL.
77

88
Suppose you have an existing MySQL database. To create the `customer` table (we
99
will now lowercase the table names by convention), you would use the `CREATE
10-
TABLE` statement. Note that every column has a type.
10+
TABLE` statement. Note that every column has a data type and can also be given additional definition rules.
11+
1112
[`AUTO_INCREMENT`](https://www.guru99.com/auto-increment.html) is used to
12-
automatically generated the IDs.
13+
automatically generated the IDs; when inserting a row, you do not need to
14+
provide the ID, it is automatically generated by incrementing the previous ID. We will see this in our example queries later. `NOT NULL` means that the user cannot provide a `NULL` value for values in this column. `PRIMARY KEY` is used to denote a column as the primary key field, and it is often used in conjunction with `AUTO INCREMENT` for databases with numeric IDs.
1315

16+
There are many options when creating columns. Refer to the [`CREATE TABLE`
17+
documentation](https://dev.mysql.com/doc/refman/8.0/en/create-table.html).
1418
```sql
1519
CREATE TABLE IF NOT EXISTS customer (
1620
task_id INT AUTO_INCREMENT PRIMARY KEY,

0 commit comments

Comments
 (0)