# Test tables and data
Tables are created and fake data are inserted when you run the "npm run seed" command. You can find the whole data seed file here.
Whenever you rerun the "npm run seed", the tables will be recreated and data will be reinserted.
# Tables
This is the table schema:

Diagram is generated from dbdiagram
TIP
Notice that foreign key constraint is not actually enforced when tables are really created. This is intentional in the example to demo some null cases.
# Data
chance is used to generate the fake data.
Here are some high level information about the data:
- 10 countries are created.
- 20 companies are created.
- 50 authors are created.
- 200 posts are created.
- 200 reviews are created.
- 200 author-review "many to many" relations are created.
- Some author may not have company_id; some post may not have author_id. This is intentional to test null case.
- Some company may have multiple authors; some author may have multiple posts.
← Introduction Queries →