Skip to content

ReCoded-Org/curriculum-backend-sql-queries-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

SQL Queries Practice

The objectives of this assignment are:

  1. Practicing basic, intermediate and advanced SQL using MySQL
  2. Learning to query relational databases directly before doing the same in Node.js code

Context

To practice SQL, you could always start by installing MySQL on your local machine, creating a database with a few tables and then trying out different queries on your tables. However, the best learning happens when you have a pre-loaded database because SQL is a very practical field. With access to more data, and if possible real data, you get the chance to experience the different possiblities of using SQL to read, manipulate and manage the data.

As a beginner or even to refresh your SQL skills, there are many online resources where you can practice SQL queries. Take a look at this list of resources.

In this assignment, we will practice SQL together on the HackerRank SQL track. If you're not familiar with HackerRank, it is a popular online platform where programmers from all over the world can learn and practice on different topics and tracks and improve their technical skills. The platform is also used by many tech companies, looking to hire developers, for assessing technical skills through hackathons, contests and hiring challenges.

Getting Started

This will be a group assignment, as you will start working on this with a partner as an in-class activity. The instructions are quite straight-forward:

  1. Create an account on HackerRank, if you haven't already done so.
  2. Open the SQL track on HackerRank.
  3. Start working on the challenges on-by-one.
  4. To solve a challenge, all you have to do is: Read the problem statement, write the query and click on "Run Code". If your query passes the sample test case, then click on "Submit Code".

Please Note : Always make sure that "MySQL" is chosen as the database on each challenge. You will find a dropdown for this on the top right corner when you open a challenge.

Important instructions for group work

  1. In your breakout rooms, take turns to share your screen and work on the challenges. For example, the first team member can share their screen and solve the first 5 challenges on their HackerRank account. Then the next team member shares their screen and solves the next 5 challenges on their HackerRank account and so on.
  2. While solving challenges, keep a note of the solutions on your HackerRank account and share them with your partner so that they can add it on their account as well.
  3. If you don't finish all the challenges in class, you can work on the remaining individually. If you get stuck on any challenge, you can work it with your partner.

Please Note : Don't work on Easy queries for too long, so that you get a chance to work on Intermediate queries with your partner and trainers in class.

HackerRank will show you filter options between Easy-Medium-Hard and Basic-Intermediate-Advanced. After trying a few Easy queries, use the filters to move on to Medium queries. Similarly, first try some Basic queries and then move on to Intermediate.

Submission

Once you have finished all the SQL challenges, you will receive a badge on HackerRank! This badge will be visible on your HackerRank profile.

To mark this assignment as submitted, all you need to do is:

  1. Click on the blue button that says "Start Assignment".
  2. Open your HackerRank profile and copy the profile URL.
  3. Paste the URL in the website URL box provided below.
  4. Click on "Submit Assignment".

Further Practice

If you want to spend some more time practicing SQL on your own, here are some resources:

  1. You can explore this SQL Tryit Editor by W3Schools. It will load a database with many related tables such as Customers, Employees, Orders, Products, etc. on your browser. And then you can try out different queries on the online query terminal.
  2. You can also follow this tutorial on the MySQL reference manual. You will first have to install MySQL on your local machine. The tutorial includes a collection of examples of common queries.

Conclusion

After this assignment, you will be familiar with many different types of SQL queries. In an upcoming assignment of this module, we will explore and learn how to connect and interact with a MySQL database within Node.js code, which will prepare us to write complete APIs that perform the required operations with data persistence.

About

SQL Queries Practice

Topics

Resources

Stars

Watchers

Forks