Congratulations on completing "Importing Relational Data into Neo4j".
You have worked through the entire process of migrating data from a relational database into Neo4j:
-
Analyzing relational schemas and understanding table relationships
-
Designing a graph data model from relational tables
-
Mapping foreign keys to graph relationships
-
Planning constraints and indexes for data integrity
-
Using the Neo4j Data Importer to import data
-
Validating and querying your imported graph
Apply This to Your Own Relational Data
If you want to migrate your own relational database (PostgreSQL, BigQuery, Snowflake, or any SQL source) to Neo4j, follow these steps:
Phase 1: Analyze Your Schema
The following SQL uses standard information_schema; adapt syntax as needed for your database (PostgreSQL, MySQL, SQL Server, BigQuery, etc.).
-
Document your tables - List all tables in your database using:
-
Identify foreign keys - Find all relationships between tables:
-
Categorize your tables using the framework from Lesson 2.2:
-
Entity tables become nodes
-
Junction tables become relationships
-
Lookup tables become properties or small nodes
-
Audit tables: evaluate if needed in graph
Phase 2: Design Your Graph Model
-
Create a visual model using Arrows.app
-
Define node labels — Use singular PascalCase names such as Customer and Order
-
Define relationship types — Use UPPER_SNAKE_CASE verbs such as PLACED and CONTAINS
-
Plan properties - Decide which columns become properties and apply camelCase naming
-
Identify constraints - Determine unique identifiers for each node type
Phase 3: Prepare Your Import
-
Create constraints first - Adapt the constraint script from Lesson 2.5:
-
Plan import order - Follow the dependency chain:
-
Independent nodes without foreign keys
-
Dependent nodes that reference other nodes
-
Relationships
Phase 4: Execute the Import
-
Connect your relational database or upload CSV files to the Data Importer; see Lesson 1.2
-
Map tables to nodes following your graph model design
-
Set unique identifiers for each node type
-
Create relationships by mapping foreign key columns
-
Run the import and monitor for errors
Phase 5: Validate Your Import
-
Run node count queries - Compare with source table counts
-
Run relationship count queries - Compare with foreign key counts
-
Check for orphan nodes - Find nodes missing expected relationships
-
Spot-check sample records - Verify data accuracy
-
Test your use case queries - Confirm the graph model supports your requirements
Quick Reference Checklist
Use this checklist when migrating your own data:
Continue Your Learning Journey
You can continue your Neo4j learning on GraphAcademy with the following courses:
Additional Resources
You may also find these resources helpful:
Lessons to Bookmark
The following lessons contain reference material you will return to in future projects. Bookmark them now:
-
Lesson 1.1: Comparing relational and graph data - The relational-to-graph mapping table
-
Lesson 2.2: Identifying Nodes from Tables - The mapping table and misconception corrections
-
Lesson 2.3: Mapping Relationships - The four common misconceptions about foreign key transformation
-
Lesson 2.5: Planning Constraints and Indexes - Constraint and index creation scripts
-
Lesson 3.5: Handling Complex Data Scenarios - The nine best practices checklist
-
Lesson 4.1: Validating Imported Data — The validation test plan and queries
-
Lesson 4.2: Validate Your Import — The hands-on validation challenge
-
Lesson 4.3: SQL and Cypher: Query Efficiency Comparison — The performance comparison summary table
Recommended Query Folder Structure in Neo4j Aura
When working in Neo4j Aura, organize your saved queries using this folder structure. The numbered prefixes indicate execution order:
This structure applies to any import project. Adapt the specific queries for your source data.
Check Your Understanding
Course Completion
Which of the following are benefits of migrating relational data to a graph database? Select all that apply.
-
✓ Relationships become explicit and first-class citizens
-
✓ Complex JOIN queries are replaced by simple traversals
-
✓ The data model can evolve more flexibly
-
❏ All data must be normalized to third normal form
Hint
Graph databases store relationships explicitly and support constant-time traversal; relational databases use foreign keys and JOINs computed at query time. Benefits include explicit relationships, traversals replacing complex JOINs, and a more flexible schema.
Solution
The benefits of migrating to a graph database include:
-
Relationships become explicit - Unlike foreign keys, graph relationships are stored directly and can have properties
-
Simple traversals replace JOINs - Following relationships is a constant-time operation
-
Flexible schema - Graph databases allow the model to evolve without rigid schema changes
Graph databases do not require normalization - in fact, some denormalization can improve query performance.
Summary
This course has provided the foundational skills for migrating relational data into Neo4j. You can now analyze relational schemas, design appropriate graph models, execute imports, and validate the results. These skills apply to any relational-to-graph migration project, regardless of the source database or domain.