Return to course: Structured Query Language(SQL)
Divex Consult
Previous Lesson
Previous
Next
Next Lesson
Structured Query Language(SQL)
Welcome to Divex Consult!
Welcome Video
Welcome Quiz
Introduction to SQL
SQL 1 - Intro
SQL 1 -Introduction to SQL
SQL 1 -Understanding Databases in SQL
SQL 1 -Setting up SQL
SQL 1 - Outro
SQL 1 - Quiz
SQL 1 - Assignment
ACCESS TO SUBMODULE 2
Creating Records
SQL 2 - Intro
SQL 2 - Data Manipulation
SQL 2 - Modifying Records P.1
SQL 2 - Modifying Records P. 2
SQL 2 - Deleting and Removing Statements
SQL 2 - Data Cleaning
SQL 2 - Outro
SQL 2 - Quiz
SQL 2 -Assignment
ACCESS TO SUBMODULE 3
SQL Syntax
SQL 3 - Introduction to SQL Syntax
SQL 3 - SQL Syntax and Structure
SQL 3 -Filtering Data in SQL
SQL 3 - Outro
SQL 3 - Quiz
SQL 3 - Assignment
ACCESS TO SUBMODULE 4
Aggregation and Grouping Functions in SQL
SQL 4 - Intro
SQL 4 - Aggregation and Grouping
SQL 4 - Group Data
SQL 4 - Filter Groups
SQL 4 - Outro
SQL 4 - Quiz
SQL 4 - Assignment
ACCESS TO SUBMODULE 5
Types of Keys and Joins in SQL
SQL 5 - Intro
SQL 5 -Working with Multiple Data
SQL 5 - JOINs 1
SQL 5 -JOINs 2
SQL 5 - Outro
SQL 5 - Quiz
SQL 5 - Assignment
ACCESS TO SUBMODULE 6
SQL Practices and Concepts
SQL 6 -Intro
SQL 6 - SQL Practices and Concepts
SQL 6 - Outro
Mentorship with Elizabeth
Mentorship
SQL 4 – Quiz
1. Which SQL function is used to count the number of rows in a table?
*
A) SUM()
B) COUNT()
C) TOTAL()
D) ADD()
2. What does the following SQL query return?
SELECT COUNT(*) FROM Orders WHERE Status = 'Shipped';
*
A) The total number of orders in the Orders table
B) The number of customers who have placed orders
C) The number of orders that have been shipped
D) The sum of all shipped orders
3. What does the SUM() function do?
*
A) Counts the total number of records in a table
B) Adds up the values in a specified column
C) Returns the highest value in a column
D) Returns the average value in a column
4. What will this query return?
SELECT SUM(Total_Amount) FROM Orders WHERE Status = 'Delivered';
*
A) The number of delivered orders
B) The total amount of all orders
C) The total revenue from delivered orders
D) The number of customers with delivered orders
5. What does AVG() do in SQL?
*
A) Returns the total sum of a column
B) Finds the middle value in a dataset
C) Finds the lowest value in a column
D) Returns the average value of a numeric column
6. What will this query return?
SELECT AVG(Price) FROM Products WHERE Category = 'Laptops';
Answer: C
*
A) The total price of all laptops
B) The lowest price of a laptop
C) The average price of all laptops
D) The number of laptops in stock
7. Why do we use GROUP BY in SQL?
*
A) To filter records based on conditions
B) To group rows that have the same values in specified columns
C) To combine duplicate rows into one row
D) To sort the results in ascending order
8. What will this query return?
SELECT Category, COUNT(*) FROM Products GROUP BY Category;
*
A) The number of products in each category
B) The total number of products
C) The total count of all products
D) The highest-priced product in each category
9. What is the purpose of the HAVING clause?
*
A) It counts the number of unique values in a column
B) It is used to filter individual rows in a table
C) It changes the order of grouped results
D) It is used to filter groups based on aggregate functions
10. What will this query return?
SELECT Customer_ID, COUNT(Order_ID)
FROM Orders
GROUP BY Customer_ID
HAVING COUNT(Order_ID) > 5;
*
A) Customers who have placed more than 5 orders
B) The total number of orders in the database
C) Orders where the quantity is more than 5
D) Customers who have placed exactly 5 orders
Previous Lesson
Next Lesson