Ga naar inhoud

Header

Introduction to SQL

Introduction

In this module, we will look at the following:

  • What is a database?

  • What is SQL?

  • Executing SQL queries

  • What are SQL dialects?




1. What is a database?

  • An organized collection of data.

  • There are many different types.

  • In this training, we work with so-called relational databases.

  • In these, data is stored in tables with columns and rows.

  • A database is usually located on a server.


Header




2. What is SQL?

  • SQL is an abbreviation that stands for Structured Query Language.

  • Developed since 1970 and has been around for more than 50 years.

  • Still in development.

  • It is a database language:

    • For interaction with databases.
    • Interactions such as:
      • Requesting data from tables in a database.
      • Grouping, merging, filtering, etc.
      • Creating and modifying tables.
      • Etc.


Header


  • As a user, you make a connection to a database.

    • You establish this connection from a session and connection.
    • You may need to authenticate for this.
      • With a username and password.
  • With the SQL language, you can execute queries (commands) on the database.

  • For example, you can request data from a table.




3. Executing SQL queries

  • There are different tools (database management software/tools) to work with SQL.

  • With such a tool, you can, for example:

    • Connect to a database.

    • Execute SQL queries on the database.

  • Examples of such tools are:


Header


  • During this training, we work with DbGate.

  • An open source tool for different SQL dialects.


Header





4. What are SQL dialects?

  • There are different variants within SQL.

  • These are called dialects.

  • There are some small differences between the dialects.

  • For example in how you work with dates.


Header


  • During the training, we work with PostgreSQL.

  • An open source dialect that is widely used.




5. IMDb database

In this training, we mainly work with a database containing movie data.

The IMDb (International Movie Database) database.

This database contains multiple tables with data about movies, genres, roles, and actors.

Header




Summary

  • A database is an organized collection of data.

    • Tables with columns and rows.
  • SQL is an abbreviation that stands for Structured Query Language.

    • A database language to execute queries (commands).

    • Such as retrieving data from a table.

  • There are different database management tools, such as:

    • MS SQL Management Studio / SQL Server

    • Sequel Pro

    • DbGate

  • There are different SQL dialects, such as:

    • MS SQL

    • Oracle

    • PostgreSQL