DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • How to View MongoDB Collections as Diagrams
  • Synchronizing Data in SQL Server
  • Can Redis Be Used as a Relational Database?
  • Schema Change Management Tools: A Practical Overview

Trending

  • Breaking Free From the Cloud With Kamal: Just Enough Orchestration for Your Apps
  • Send Your Logs to Loki
  • AWS Lambda vs. Fargate: The Battle of Cloud Giants
  • 6 Proven Kubernetes Deployment Best Practices for Your Projects
  1. DZone
  2. Data Engineering
  3. Data
  4. Tutorial — Relational Data Browsing

Tutorial — Relational Data Browsing

In this article, navigate bidirectionally through the database by following foreign-key-based or user-defined relationships with Jailer.

Ralf Wisser user avatar by
Ralf Wisser
·
Nov. 14, 19 · Tutorial
Like (3)
Save
Tweet
Share
12.06K Views

Join the DZone community and get the full member experience.

Join For Free

Image title

Relational Data Browsing

Navigate bidirectionally through the database by following foreign-key-based or user-defined relationships with Jailer.

The Jailer tool can be found at:

  • https://github.com/Wisser/Jailer
  • https://sourceforge.net/projects/jailer
You might also like:  Why You Should Use a Relational Database Instead of NoSQL for Your IoT Applications

1. Connect With the Database

Start the Data Browser (JailerDataBrowser.exe or jailerDataBrowser.bat on windows platform)

$ sh jailerDataBrowser.sh

and create a new data model. Press New and enter "Tutorial" as the name for the new model. 

A data model holds information about the tables in the database and all associations between them.

Most of the information can be retrieved automatically by analyzing the database schema.

Click on Analyze Database.

You will be asked for the database connection information.

Image title

Create a new connection.

Image title

Select the DBMS you are using from the displayed list and fill out the following form:

Image title

Finally, click on Connect. Jailer finds seven tables and five associations:

Two associations are still missing:

  • an employee is classified into a salary grade depending on his salary
  • employees may receive bonuses
Add the definitions manually (Add-Button under Associations):

Image title

The data model is now complete.

2. Browse a Table

Select the menu item "Open Table" from "File" and choose "EMPLOYEE" as the table you want to browse.

A Table Browser appears showing the rows of table EMPLOYEE.

Image title

3. Browse Related Rows

Select the "Children" item from the "Related Rows" drop-down menu and choose "EMPLOYEE on inverse-BOSS".

Another Table Browser appears showing the subordinates of each Employee (the inverse of the "BOSS" relationship).

4. Generate SQL-Query

Within each table browser, a SQL-Query can be generated which selects exactly the browser's content.
Essentially it's a join of all the tables in the navigation chain.

Close the second "EMPLOYEE" browser, navigate from EMPLOYEE to PROJECT_PARTICIPATION, and from there to PROJECT.

Choose "Query Builder" item from the "SQL/Query" menu in the "PROJECT" browser:

Image title

The Query Builder form lets you save the query into a file, copy it to the clipboard or even execute it.
Choose "Execute" to get a query-result browser:


Within this query-result browser, you can edit the query anyway you want.

Thanks for reading!

Further Reading

From Relational to Graph: A Developer’s Guide

Relational database Database connection Data (computing)

Published at DZone with permission of Ralf Wisser. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to View MongoDB Collections as Diagrams
  • Synchronizing Data in SQL Server
  • Can Redis Be Used as a Relational Database?
  • Schema Change Management Tools: A Practical Overview

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: