Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Get Product Amount By Category | Joining Tables
Intermediate SQL
course content

Course Content

Intermediate SQL

Intermediate SQL

1. Grouping
2. Nested Subqueries
3. Joining Tables
4. DDL and DML in SQL

Get Product Amount By Category

Great job!

Now the company has a new task for us.

A new supplier contacted us and said that they can supply goods from the categories Meat or Grains cheaply. We need to find out which products in these categories have less than 100 units left in stock.

Just a reminder, we are working with two tables:

product:

category:

Task

Your task is to retrieve the product names and their quantities in stock. To do this, you'll need to join two tables. The category of these products should be Meat or Grains. Keep in mind that you'll need to use the OR operator for this. Also, the quantity of the product should be less than 100. To do this, you'll need to use the AND operator.

Also, you need to sort the result by the name column using the ORDER BY clause.

Note

Keep in mind that you should wrap the string with the OR operation in parentheses and then use the AND operator. Here, the standard order of operations from discrete mathematics applies.

As a result, you should have 2 columns: product_name and amount, so don't forget to set appropriate aliases!

Task

Your task is to retrieve the product names and their quantities in stock. To do this, you'll need to join two tables. The category of these products should be Meat or Grains. Keep in mind that you'll need to use the OR operator for this. Also, the quantity of the product should be less than 100. To do this, you'll need to use the AND operator.

Also, you need to sort the result by the name column using the ORDER BY clause.

Note

Keep in mind that you should wrap the string with the OR operation in parentheses and then use the AND operator. Here, the standard order of operations from discrete mathematics applies.

As a result, you should have 2 columns: product_name and amount, so don't forget to set appropriate aliases!

Everything was clear?

Section 3. Chapter 4
toggle bottom row

Get Product Amount By Category

Great job!

Now the company has a new task for us.

A new supplier contacted us and said that they can supply goods from the categories Meat or Grains cheaply. We need to find out which products in these categories have less than 100 units left in stock.

Just a reminder, we are working with two tables:

product:

category:

Task

Your task is to retrieve the product names and their quantities in stock. To do this, you'll need to join two tables. The category of these products should be Meat or Grains. Keep in mind that you'll need to use the OR operator for this. Also, the quantity of the product should be less than 100. To do this, you'll need to use the AND operator.

Also, you need to sort the result by the name column using the ORDER BY clause.

Note

Keep in mind that you should wrap the string with the OR operation in parentheses and then use the AND operator. Here, the standard order of operations from discrete mathematics applies.

As a result, you should have 2 columns: product_name and amount, so don't forget to set appropriate aliases!

Task

Your task is to retrieve the product names and their quantities in stock. To do this, you'll need to join two tables. The category of these products should be Meat or Grains. Keep in mind that you'll need to use the OR operator for this. Also, the quantity of the product should be less than 100. To do this, you'll need to use the AND operator.

Also, you need to sort the result by the name column using the ORDER BY clause.

Note

Keep in mind that you should wrap the string with the OR operation in parentheses and then use the AND operator. Here, the standard order of operations from discrete mathematics applies.

As a result, you should have 2 columns: product_name and amount, so don't forget to set appropriate aliases!

Everything was clear?

Section 3. Chapter 4
toggle bottom row

Get Product Amount By Category

Great job!

Now the company has a new task for us.

A new supplier contacted us and said that they can supply goods from the categories Meat or Grains cheaply. We need to find out which products in these categories have less than 100 units left in stock.

Just a reminder, we are working with two tables:

product:

category:

Task

Your task is to retrieve the product names and their quantities in stock. To do this, you'll need to join two tables. The category of these products should be Meat or Grains. Keep in mind that you'll need to use the OR operator for this. Also, the quantity of the product should be less than 100. To do this, you'll need to use the AND operator.

Also, you need to sort the result by the name column using the ORDER BY clause.

Note

Keep in mind that you should wrap the string with the OR operation in parentheses and then use the AND operator. Here, the standard order of operations from discrete mathematics applies.

As a result, you should have 2 columns: product_name and amount, so don't forget to set appropriate aliases!

Task

Your task is to retrieve the product names and their quantities in stock. To do this, you'll need to join two tables. The category of these products should be Meat or Grains. Keep in mind that you'll need to use the OR operator for this. Also, the quantity of the product should be less than 100. To do this, you'll need to use the AND operator.

Also, you need to sort the result by the name column using the ORDER BY clause.

Note

Keep in mind that you should wrap the string with the OR operation in parentheses and then use the AND operator. Here, the standard order of operations from discrete mathematics applies.

As a result, you should have 2 columns: product_name and amount, so don't forget to set appropriate aliases!

Everything was clear?

Great job!

Now the company has a new task for us.

A new supplier contacted us and said that they can supply goods from the categories Meat or Grains cheaply. We need to find out which products in these categories have less than 100 units left in stock.

Just a reminder, we are working with two tables:

product:

category:

Task

Your task is to retrieve the product names and their quantities in stock. To do this, you'll need to join two tables. The category of these products should be Meat or Grains. Keep in mind that you'll need to use the OR operator for this. Also, the quantity of the product should be less than 100. To do this, you'll need to use the AND operator.

Also, you need to sort the result by the name column using the ORDER BY clause.

Note

Keep in mind that you should wrap the string with the OR operation in parentheses and then use the AND operator. Here, the standard order of operations from discrete mathematics applies.

As a result, you should have 2 columns: product_name and amount, so don't forget to set appropriate aliases!

Section 3. Chapter 4
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt