The world’s leading publication for data science, AI, and ML professionals.

Learning SQL? Learn How to Practice SQL With a Complex Database

SQL

Learn how to find and start using a complex Database to practice SQL

Image by Caspar Camille Rubin. Source: Unsplash
Image by Caspar Camille Rubin. Source: Unsplash

Nowadays, SQL has become one of the top skills for professionals. Every day, more companies start using relational databases. For this reason, professionals who want to grow in their careers understood that learning SQL is a must. Even professionals using SQL for a few years (like myself) could get confused with all the SQL commands and know that they need to practice. The other scenario problem is that multiple relational database management systems and many essential commands are not the same.

Here’s the problem. There are hundreds of online courses that can teach how to use SQL. However, most of them use either simple databases that the students create during the course. Some courses might use a database that you can download, but they were often kind of basic. The truth here is that these databases are far from reality. You will not work with basic databases in the professional world. Thus, even if you practice SQL every day, if it’s a simples database, you do not understand the full potential of SQL.

Luckily, someone made the world a better place and made available the Employees database. The Employees database is the best possible choice for laying the foundations of SQL. Its complexity offers challenging tasks and all you need to level up your skills.

The Employees can be found on GitHub in [this link](https://www.dropbox.com/s/znmjrtlae6vt4zi/employees.sql?dl=0). However, the guys from 365 DataScience made the database available in an easy-to-download file in this link. The database has roughly 89 MB, and just by the size, we can see that we are dealing with a huge dataset.

Now, you need to add the database to your RDBMS. If you are using MySQL Benchwork, you can click on the icon shown below and follow the steps. I should be just as simple with other RDBMSs. Now, you are ready to practice SQL like a PRO. Let’s explore the database a bit.

Image by the author
Image by the author

First, let’s take a look at the database diagram. To find the diagram on MySQL Benchwork, you just need to go to database > reverse engineer... and follow the steps.

Ok, we have multiple tables to explore. We have tables with information about the employees, departments, salaries, managers, titles, etc. We can check how many rows the database contains by typing SELECT COUNT(*) FROM employees;.

Image by the author
Image by the author

Over 300K rows. That’s impressive! You can basically do any queries with a database of this size. And the best part is that it’s complex enough even for professionals who work using SQL for years. The awesome guys from w3resource create 114 questions for you to practice SQL with the Employees database. You can find them on this link.

You now have all you need to become a PRO SQL user. Cheers!


Related Articles