The short answer
- A data table holds one kind of thing, with a row for each field.
- Join tables from the field that holds the link, and set each end to one or many.
- Paste SQL to draw a database you already have, and copy the agreed model back out as code.
A finished example
This is what the Data model template can look like once it is filled in. This one is for a bakery’s online orders.
Read the example as words
- On the board
- Customer: id, number, main ID; name, text; email, text
- Order: id, number, main ID; customer_id, number, links to another table; placed, date; total, money
- Product: id, number, main ID; name, text; price, money
- Order line: id, number, main ID; order_id, number, links to another table; product_id, number, links to another table; quantity, number; price_paid, money
- Questions
- An order, even if a product is removed
- The price paid at the time
- How the boxes are joined
- Customer places Order, one to many
- Order has Order line, one to many
- Product is on Order line, one to many
Why a database belongs on a shared board
A database is a set of decisions about what a system remembers. Which things does it keep records of? What does it keep about each? How do they connect? Those decisions shape every screen and report that comes later.
They are often made by one person, in a code editor, where nobody else can see them. The people who know the work find out what was decided when something they need cannot be done.
A database diagram puts those decisions where a whole team can read them. It is sometimes called an entity relationship diagram, or ERD. Each table is a box with its fields listed inside. Lines between the boxes show how the tables join.
On doodleboard the diagram sits on the same board as everything around it. The notes from the customer call, the sketch of the screen and the open questions can sit beside the tables they are about. That is the difference from a diagram kept in a developer tool. The model and the reasons for it stay together.
Adding a data table and its fields
Open the More menu and choose Data table. A table appears with three starter fields, and a form opens so you can make it your own.
- Give the table a name, in the singular, in the words your team uses: Customer, not tbl_cust.
- Give each field a name and a type. The type is the kind of information, such as text, number or date.
- Set the key for a field where it has one. Main ID (PK) is the field that tells one row from another. Links to a table (FK) is a field that points at another table.
- Use Add a field for each fact you need to keep. Use the arrow to move a field up, or the cross to remove it.
Select Save table when you have finished. Double-click the table at any time to open it again.
The table grows a row for each field, so a long table is tall. Drag a corner to make it larger or smaller, and the rows scale with it. To group tables, select a table and change its colour. You might use one colour for everything about billing.
Joining tables with one and many ends
Choose the connector tool and drag from a field in one table to a field in another. The line holds on to those two rows, so it is clear which fields make the link. Move a table and the line follows.
A connector between two data tables starts as one to many, the most common kind of link. One customer places many orders. Each order belongs to one customer.
To change an end, select the connector. The bar above it has a list for the start of the line and one for the end. After the arrowheads you will find four choices in words: One, One or none, Many, and One or many. The marks drawn on the line are the ones database diagrams have long used. A single bar means one. A fork with three prongs means many. A small circle means the link may be empty.
If you use a keyboard or a screen reader, open Items as a list and choose Connect on a table. The same bar then has Start field and End field lists. They choose which row each end holds, so you never need to drop a line on a small target.
Label the line with a verb, such as "places" or "contains". Then read it aloud as a sentence. If it sounds wrong, the model is wrong.
Bringing in a database you already have
Many teams draw the diagram after the database exists. Typing 40 tables by hand would be slow, so doodleboard reads them from code.
Open the More menu and choose Data tables from SQL or Mermaid. Paste the CREATE TABLE statements for your database and choose Add to the board. Each table is drawn with its fields, types and main ID. Each link to another table becomes a connector from the right field, with its ends set.
You can also paste the code straight onto the board. If the text starts with CREATE TABLE, or with erDiagram for Mermaid, doodleboard draws the tables for you.
Tables that others point at are placed on the left, and the tables that point at them on the right. So the diagram reads from the "one" side to the "many" side. Move anything you like afterwards.
The code is only read, never run. It stays in your browser until the tables are on the board. One paste can hold up to 60 tables. For a larger database, paste one area at a time, such as everything about orders, and give each area its own frame.
Agreeing the model and taking it back out
A diagram earns its place when people use it to decide something. Invite the people who know the work, not only the people who will build it. Then test the model with real cases.
Take an awkward example from last month and walk it through the tables. A customer with two addresses. An order that was part refunded. If a fact has nowhere to go, add a field or a table while everyone is watching. Write open questions on sticky notes beside the table they are about, and leave comments for anyone who could not join.
The Data model template gives you a worked sample to start from: four joined tables for a small shop, with a frame for questions.
When the model is agreed, select the tables and choose Copy as code. You get the same tables as SQL, ready for a database, and as Mermaid, ready for a document that shows diagrams. Names a database would not accept as they are, such as names with spaces, are wrapped in quote marks for you.
Data tables are on every doodleboard plan, including Free. Solo and Team add the doodler academy, which has a Software path with a lesson on sketching a data model.
Questions people ask
Do I need to know SQL to draw a database diagram?
No. You can add each data table from the More menu and fill in its fields in a form. SQL is there for people who already have a database and want it drawn, or who want to copy the finished model out.
What do PK and FK mean on a data table?
PK is short for primary key, the field that identifies each row, which doodleboard calls the main ID. FK is short for foreign key, a field that holds the main ID of a row in another table and so links the two.
Which kinds of SQL can doodleboard read?
It reads standard CREATE TABLE statements. Primary keys and foreign keys can be written on the field or as a separate line. It also reads ALTER TABLE lines that add a foreign key. Other statements in the paste, such as inserts, are skipped.
Can I turn the diagram back into a database?
Yes. Select the tables and choose Copy as code to get CREATE TABLE statements with their links. Treat it as a first draft for a developer to check. A real database also needs choices a sketch leaves out, such as how to make searches fast.
Are data tables on the free plan?
Yes. Data tables, the one and many ends, pasting SQL or Mermaid and Copy as code are on every doodleboard plan, including Free. The doodler academy lessons that teach data modelling come with Solo and Team.
