You have a SQL database dump in .sql or .csv format and need to move its structured data into Notion for team collaboration. Notion does not accept SQL files directly, so you must convert the dump into a format Notion can import, such as CSV, and then split the data into separate databases that mirror the original relational structure. This article explains how to extract tables from a SQL dump, convert each to CSV, and import them into Notion as linked databases.
Notion’s import tool supports CSV files but cannot handle foreign key relationships automatically. You will need to manually rebuild those connections using Notion relations after the import. The process involves three main stages: preparing the SQL dump, converting each table to CSV, importing into Notion, and linking the databases.
This guide covers the entire workflow for a MySQL or PostgreSQL dump. You will learn how to handle multiple tables, preserve data types, and set up relational links between your new Notion databases.
Key Takeaways: Importing a SQL Database Dump Into Notion
- Export each table as a separate CSV file: Use a database tool or command-line export to generate one CSV per table from your SQL dump.
- Import CSV files into Notion using the Import > CSV option: Each CSV becomes a new Notion database with columns matching the original table fields.
- Rebuild foreign keys with Relation properties: After import, add Relation columns in each database to link records across tables manually.
Why a SQL Dump Cannot Be Imported Directly Into Notion
A SQL dump is a text file containing SQL statements such as CREATE TABLE and INSERT INTO. Notion’s import system only accepts CSV, TSV, HTML, and Markdown files. The SQL syntax is not parsed by Notion, so the dump must be converted into a flat file format that preserves the data structure.
The core challenge is that a SQL dump often contains multiple tables with foreign key relationships. Notion imports each CSV as a standalone database. Foreign keys between tables — for example, an orders table linking to a customers table — are not automatically converted into Notion’s Relation property. You must create those connections manually after the import.
Another limitation is data type mapping. SQL types like TIMESTAMP, DECIMAL, and TEXT become plain text in Notion. Date and number fields must be reformatted during CSV export to match Notion’s expected formats: ISO 8601 for dates and plain numbers without commas or currency symbols.
Steps to Convert a SQL Dump to CSV and Import Into Notion
Step 1: Extract Each Table From the SQL Dump
If your SQL dump file contains multiple tables, you need to separate them. Use a database administration tool such as MySQL Workbench, pgAdmin, or a command-line tool to restore the dump into a temporary database first. This gives you individual tables that can be exported to CSV.
- Restore the dump into a temporary database
For MySQL, run:mysql -u username -p temp_database_name < dump.sql. For PostgreSQL, use:psql -U username -d temp_database_name -f dump.sql. This recreates all tables and their data. - List all tables in the restored database
RunSHOW TABLES;in MySQL or\dtin PostgreSQL. Note each table name. You will export each one separately. - Export each table to CSV
For MySQL, use:SELECT INTO OUTFILE '/tmp/table_name.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM table_name;. For PostgreSQL, use:COPY table_name TO '/tmp/table_name.csv' DELIMITER ',' CSV HEADER;. The HEADER option includes column names as the first row.
Step 2: Prepare CSV Files for Notion Import
Notion expects specific formatting in CSV files. Ensure your CSV files meet these requirements before importing.
- Check date and number formats
Dates must be in ISO 8601 format (YYYY-MM-DD). Numbers should not contain thousand separators or currency symbols. Use a text editor or spreadsheet tool to reformat as needed. - Remove any special characters or line breaks within cells
Notion may misinterpret multi-line cells. Replace internal line breaks with spaces. Ensure all text fields are enclosed in double quotes and commas inside fields are escaped with a preceding double quote. - Save each CSV with a descriptive filename
Use the table name as the filename, for examplecustomers.csvandorders.csv. This helps you identify which CSV belongs to which table later.
Step 3: Import CSV Files Into Notion
Notion allows you to import a CSV file directly into a new database page. Repeat this process for each CSV file.
- Open Notion and navigate to the workspace where you want the databases
Click the workspace name in the top-left corner. Choose the page or create a new parent page for your databases. - Click the Import button in the bottom-left sidebar
Select Import > CSV from the menu. A file picker dialog opens. - Select the first CSV file and click Open
Notion creates a new database page with the same name as the CSV file. It automatically maps each column to a property type. Review the imported data to ensure all rows and columns are present. - Repeat for each remaining CSV file
Import each table’s CSV as a separate Notion database. After import, you will have multiple database pages, one per table from the original SQL dump.
Step 4: Rebuild Relational Links Between Databases
To recreate the foreign key relationships from the original SQL schema, add Relation properties in Notion. This step is manual because Notion cannot infer relationships from CSV data alone.
- Open the database that should contain a relation
For example, if orders references customers, open the orders database. - Add a new column of type Relation
Click the + button to the right of the last column header. Select Relation from the property type list. In the dialog that appears, choose the related database — for example, customers. - Link each record to its related record
Click into the Relation cell for a row. A list of records from the related database appears. Select the matching record. Repeat for every row. This step can be time-consuming for large datasets; consider using Notion’s API or a third-party automation tool to speed up bulk linking. - Optionally create a Rollup property
If you need to display aggregated data from the related database — such as total order amount per customer — add a Rollup column. Configure it to sum, count, or average values from the linked database.
Common Issues When Importing SQL Dumps Into Notion
CSV Import Shows Only One Column or Missing Data
This usually happens when the CSV delimiter is not a comma. Notion expects commas as column separators. If your SQL export used a semicolon or tab, open the CSV in a text editor and replace the delimiter with commas. Also verify that all rows have the same number of columns.
Date Fields Appear as Plain Text After Import
Notion recognizes dates only in ISO 8601 format. If your dates are in a different format — for example, MM/DD/YYYY or DD-MON-YYYY — they become text. Reformat the date column in your CSV before importing. Use a spreadsheet tool to apply the YYYY-MM-DD format to all date cells.
Foreign Key Values Are Not Linked Automatically
Notion does not process foreign key columns during CSV import. The numeric IDs or references from the original SQL tables are imported as plain text. You must manually create Relation properties and link each record. For databases with hundreds of rows, consider using Notion’s API to automate the linking process by matching ID values.
SQL Table vs Notion Database: Key Differences After Import
| Feature | SQL Table | Notion Database |
|---|---|---|
| Data types | Strict types (INT, VARCHAR, TIMESTAMP) | Flexible property types (Text, Number, Date) |
| Relationships | Foreign keys enforced by the database engine | Relation properties, manually configured |
| Indexing | Automatic indexes on primary keys | No automatic indexing; sorting is available |
| Import format | SQL dump or direct connection | CSV, TSV, HTML, Markdown |
| Bulk linking | JOIN queries for related data | Manual linking or API automation |
This table summarizes the structural differences you will encounter. Plan your Notion database design accordingly, especially for large datasets where manual linking is impractical.
You can now convert a SQL database dump into multiple Notion databases by exporting each table as a CSV file, importing those files into Notion, and manually recreating relational links with the Relation property. For large imports, consider using Notion’s API to automate the linking of records based on matching ID columns. A practical next step is to set up a Rollup property that aggregates data from a linked database, such as counting the number of orders per customer.