Design a Database Schema Visually: Tables, Foreign Keys & SQL in DbSchema

Design a Database Schema Visually: Tables, Foreign Keys & SQL in DbSchema


Design a database schema without writing SQL by hand. In under two minutes, you'll create a table on a DbSchema diagram, link it to another table with a foreign key by simply dragging one column onto another, and let DbSchema generate the CREATE TABLE and foreign key statements for PostgreSQL.

What you'll see:
• Creating a table from the diagram's right-click menu
• Adding columns with data types, a primary key and NOT NULL
• Creating a foreign key by drag and drop
• Generating the SQL for the new table and its foreign key

The design in this video is offline: no database connection is needed until you're ready to deploy.

Try DbSchema free at https://dbschema.com/?utm_source=youtube&utm_medium=organic_video&utm_campaign=youtube_channel&utm_content=SN7b3jAPv_w

Chapters:
0:00 Introduction
0:09 Create a table
0:21 Add the columns
0:59 Link with a foreign key
1:15 Generate the SQL
1:31 Summary

#DbSchema #DatabaseDesign #PostgreSQL #SQL #DataModeling #ERDiagram
Closed Caption:

In the next minute, you'll design a new
table, link it with a foreign key, and
let DB Schema write the SQL for you.
Here's a small shop, customers and
products.
Purchases are missing, so right-click
the diagram and pick create table.
Call it purchases.
Now the columns. Click add purchase ID,
a serial, and the primary key.
Buyer ID, an integer that can't be
empty.
And purchased at, a timestamp.
Click okay.
And purchases lands right on the
diagram.
Every purchase has a buyer, and buyers
are [music] customers.
So drag buyer ID onto the key of
customers.
DB Schema fills in the foreign key for
you. Press enter.
And there's the relationship.
Need the SQL?
Right-click purchases and pick build
SQL, then create statement.
There it is.
The create table and the foreign key,
ready for PostgreSQL.
Design it visually and let DB Schema
write the SQL.

Video Length: 01:41
Uploaded By: DbSchema Database Designer
Published: 10/8/2026
View Count: 76

Related Software Products
DbSchema Architect
DbSchema Architect

Published By:
Wise Coders GmbH

Description:
DbSchema Architect: Design a Database Before It Exists, Then Deploy, Document and Version It DbSchema Architect is the top edition of DbSchema, a desktop database designer for Windows, macOS and Linux that works with more than 100 SQL and NoSQL databases. On top of ER diagrams, schema sync, Git collaboration and HTML documentation, Architect adds logical and conceptual modeling and flow diagrams generated from your SQL. A Personal perpetual...


Related Videos
Learn Logical Data Modeling Fast | Visual ER Diagrams with DbSchema
Learn Logical Data Modeling Fast | Visual ER Diagrams with DbSchema

Video Length: 12:33
Uploaded By: DbSchema Database Designer (4/12/2025)
View Count: 8,825

Create and Visualize Database ER Diagrams with DbSchema Tool
Create and Visualize Database ER Diagrams with DbSchema Tool

Video Length: 03:54
Uploaded By: DbSchema Database Designer (3/5/2025)
View Count: 3,867

Logical & Conceptual Database Design using DbSchema
Logical & Conceptual Database Design using DbSchema

Video Length: 02:18
Uploaded By: DbSchema Database Designer (5/30/2024)
View Count: 599

DbSchema in 80 Seconds: Design, Document and Deploy Your Database
DbSchema in 80 Seconds: Design, Document and Deploy Your Database

Video Length: 01:23
Uploaded By: DbSchema Database Designer (10/10/2026)
View Count: 119

Copyright © 2026, Ivertech. All rights reserved.