In this practice, you will use an online tool to create a diagram for a simple relational database.
Before you begin, go to dbdiagram.io. Click "Create a diagram" (or the equivalent button to open the application). Find the "Sign in" button (upper right), and login using your GitHub account. (If this is your first time using this tool, you will need to create an account.)
Next, click the "? Help" button in the upper right of the diagram application.
Read through the instructions to learn how to
- Specify a table
- Define a relationship
Type code into the left panel to create a "kids" table with three fields
id- number and the primary keyname- stringage- number
Next, create the table "toys" containing
id- number and the primary keyname- stringkid_id- number (so it matches theidin thekidstable)
Then, set up a relationship reference so the kid_id field in the toys
table connects to the id field in the kids table.
Finally, drag the tables around in the diagram area to make them easy to read and understand the relationship.
The result should look something like this:
