Welcome to the SQL Playground. This space allows for learning SQL through exercises, coding challenges, and hands-on practice.
SQL (Structured Query Language) is a powerful language used to interact with relational databases. Whether you are a beginner or an experienced developer, SQL is an essential skill for …
To retrieve data from a SQL database, we use SELECT
statements, which are commonly referred to as queries. A query is simply a request that tells the database what data we need, where to find it, and optionally, how to process it before returning the results. Queries follow a specific …
✅ Tables are the main structures in the relational database. Each table always represents a single specific subject. The logical order of rows and columns within the table is of absolutely no importance. Every table contains at least one column, known as a primary key, that uniquely identifies each of its …
In the previous lesson, we explored how to retrieve data using the SELECT
statement. Now it’s time to make our queries smarter by filtering the data to return only the rows we’re interested in. This is where the WHERE
clause comes into play.
Imagine you’re working with a large dataset …
If rows in a given table can be associated in some way with rows in another table, the tables are said to have a relationship between them. The manner in which the relationship is established depends on the type of relationship. Three types of relationships can exist between a pair …
In previous lessons, we learned how to retrieve data from a database using the SELECT
statement and apply conditions using WHERE
. Now, let’s dive into more ways to refine your query results by:
Eliminating duplicate rows
Sorting data in a meaningful order
Returning just a portion of the results …