Ga naar inhoud

Header

Introduction DbGate

Introduction

DbGate is a SQL management tool.

You can use it to:

  • Execute SQL queries.

  • View the contents of tables in a database.

  • View a schema of the database structure.

Header




1. Viewing Tables

To view a table in a database, do the following:

  1. Click on Database connections in the menu.

  2. Select a database.

    • Here: database imdb: a database with movie data.
  3. Click on one of the tables:


Header


  • We click on table movies:


Header


Here you can:

  1. Filter, make selections, sort.

  2. See how many rows there are.




2. Viewing Database Structure

To view the structure of a database, do the following:

  1. Right-click on the database.

  2. Click on Show diagram.

  3. You will see the different tables in the database:


Header


  • The arrows indicate how the tables are connected.

  • A database consisting of tables with interrelationships is called a relational database.

    • We will discuss this in more detail later.




3. Executing a Query

To execute a query:

  1. Click on the menu.

  2. Go to File.

  3. Click on New query.

  4. A new tab for a query will open.


Header


  1. Write a query (you don't need to understand this yet).

  2. Execute the query with:

    • (A) The play button.
    • (B) The execute button.
    • Keyboard shortcut CTRL + Enter (Windows), or Cmd + Enter (Mac).
  3. View the result of your query.


Header


4. Saving a Query

To save a query:

  1. Click on Save at the bottom of the screen.

  2. Click on Save As.

  3. Choose a filename and save the query.


Header


To open a saved query:

  1. Click on Favorites & Saved files.

  2. Click on a query file.


Header





Summary

With DbGate we can now:

  • View tables.

  • View database structure.

  • Write and execute queries.

  • Save and open queries.