Querying

Intermediate SQL

Querying

🙋 Need help? Ask an expert now!

Querying Data

Let's Take a Deeper Look into Querying Data

We have dove into querying a little in the third chapter to select, create and insert data with SQL, now let's take deeper look.

An import thing to remember is we need to understand our data.

  • How is it structured?

  • What does it represent?

We can do different types of querying to figure these out!

Selecting Data

When we query this isn't actually changing the database. You're just choosing what and how to look at the data.

Functions

Very similar to using excel, in SQL we can use functions to help us understand our data.

Here are a few examples:

SUM() `SELECT SUM(XYZ) FROM XYZ`

MAX() `SELECT X, Y, Z FROM XYZ`

MIN() `SELECT X, Y, Z FROM XYZ`

AVG() `SELECT XYZ FROM XYZ`

COUNT() `SELECT COUNT(*) FROM XYZ`
Edit Me on GitHub!