0% found this document useful (0 votes)
8 views3 pages

ITP15 ADS - BlockNo - Assign01 - Last Name First Name

This document outlines an assignment for students to practice SQL queries using the SELECT statement and its clauses on a Product table. It includes a series of questions requiring SQL commands to retrieve and manipulate data, such as selecting specific columns, filtering by categories, and performing aggregations. The assignment aims to enhance students' understanding of SQL query formulation and data analysis.

Uploaded by

Richjoseph PH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

ITP15 ADS - BlockNo - Assign01 - Last Name First Name

This document outlines an assignment for students to practice SQL queries using the SELECT statement and its clauses on a Product table. It includes a series of questions requiring SQL commands to retrieve and manipulate data, such as selecting specific columns, filtering by categories, and performing aggregations. The assignment aims to enhance students' understanding of SQL query formulation and data analysis.

Uploaded by

Richjoseph PH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: Date:

Section:

ASSIGNMENT NO. 1 – SQL QUERY PRACTICE

Objective: Students will apply their knowledge of the SELECT statement and its
clauses (WHERE, GROUP BY, HAVING, ORDER BY, and LIMIT) to retrieve and
manipulate data from the Product table.

Instructions: Write SQL queries to answer the following questions based on the
Product table.

Note: Refer to and analyze the Product table below or you may execute the queries
from the text file (ITP15-ADS_Act01_PRODUCT TABLE.txt) using the SQL environment
to verify your answer.

1. Retrieve all columns for all products.


ANS: SELECT * FROM Product;

2. Retrieve only the Name, Category, and Price of all products.


ANS:

3. Display distinct product categories.


ANS:

4. Retrieve all products that belong to the Electronics category.


ANS:

5. Retrieve products with a price greater than $500.


ANS:

6. Retrieve products that are currently marked as "Available".


ANS:

7. Retrieve products where the StockQuantity is less than 20.


ANS:

8. Retrieve all products ordered by Price in descending order.


ANS:

9. Retrieve all products ordered by StockQuantity in ascending order.


ANS:

10. Count the number of products in each category.


ANS:

11. Find the average price of products in each category.


ANS:

12. Retrieve categories where the average price of products is greater than $300.
ANS:

13. Retrieve categories that have more than 2 products.


ANS:

14. Retrieve the top 3 most expensive products.


ANS:

15. Retrieve 5 products, skipping the first 2 records.


ANS:

Bonus Challenge:
16. Find the total stock quantity for each category and display only those with a
total stock greater than 50.
ANS:

You might also like