Hey {{full_name}},

Welcome to dbdiagram.io, a free tool that helps you design database easily. Here are a few tips to help you get started.

1- How to use dbdiagram.io

The tool is simple: you write code, it renders the ER diagram 👌. You can then export to PDF, PNG or generate SQL code with it ⭐️.

Dbdiagram demo.8ac4de1
(turn on image to see an automated screenshot of dbdiagram)

2- About our markup language syntax (DBML)

We use DBML (database markup language), a markup language to define and document database schemas.

See below for an example code that defines an ecommerce site, go ahead and copy and paste this into the editor to see the final diagram

Table orders {
  id int [pk]
  user_id int [not null, unique]
  status varchar
  created_at varchar [note: "When order created"]
}

Table order_items {
  order_id int [ref: > orders.id]
  product_id int
  quantity int
}

// You can define relationship inline or separate
Ref: order_items.product_id > products.id

Table products {
  id int [pk]
  name varchar
  merchant_id int [not null]
  price int
  status varchar
  created_at varchar
}

Table users {
  id int [primary key]
  full_name varchar
  email varchar [unique]
  gender varchar
  date_of_birth varchar
  created_at varchar
  country_code int [ref: > countries.code]
}

Table merchants {
  id int [primary key]
  merchant_name varchar
  country_code int [ref: > countries.code]
  created_at varchar
  admin_id int
}

Table countries {
  code int [primary key]
  name varchar
  continent_name varchar
}

Ref: products.merchant_id > merchants.id
Ref: merchants.admin_id > users.id

For a full documentation on the syntax, please see the our DBML project page.

3- Stay updated, give feedback and contribute

❤️ Follow our Twitter (@dbdiagram) for latest updates.
❤️ Check out our Release Notes
❤️ To give feedback and suggestions, use our community forum, this feedback form, or simply reply to this email.

And lastly, if you enjoy the tool, please share it with your friends by forwarding this email, or tweet about it! ✌️

Have fun building!
Cheers, dbdiagram.io Team