DBeaver IDE for SQL Queries
Learning Objectives
- Using the DBeaver IDE.
- DuckDB tutorial on DBeaver: https://duckdb.org/docs/guides/sql_editors/dbeaver
Motivation
No job will have you use R Studio to do SQL.
Let’s try out another IDE.
Setup
The instructions here are only for DuckDB. But DBeaver works with other DBMS’s pretty easily.
Download and install DBeaver Community here: https://dbeaver.io/download/
When you open it up, select “DuckDB”
With “Host” selected, navigate to your
flights.duckdb
database. Click “Finish”.Click on the database name “flights.duckdb” in the top right. If you haven’t used it before, it will ask you to install a driver to use connect to a DuckDB database.
You should now see the database. Right click on the connection and create a new SQL file.
Type some SQL and hit the execute button
or just hit Control/Command + Enter.
You can now play around with SQL. When you want to save the data to a CSV file, just hit “Export data”.
There are a lot of features in DBeaver, but we won’t cover them. They are pretty intuitive. Just play with it for awhile.
Exercises
Use DBeaver for all of these exercises.
What is the mean temperature for flights from each airport?
What is the average number of flights from each airport per day in January?
What are the top destinations for each airport?