0% found this document useful (0 votes)
34 views1 page

25 MSSQL Questions Using Data Tables Customers-Products-Suppliers

The document contains 25 MSSQL questions categorized into Basic Queries, Filtering and Conditions, Sorting and Aggregation, Joins, and Subqueries, using W3Schools' data tables. It covers various SQL operations such as retrieving records, filtering data based on conditions, sorting results, performing aggregations, and joining tables. Each question is designed to help users practice and enhance their SQL skills using practical examples from the Customers, Orders, Products, and Suppliers tables.

Uploaded by

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

25 MSSQL Questions Using Data Tables Customers-Products-Suppliers

The document contains 25 MSSQL questions categorized into Basic Queries, Filtering and Conditions, Sorting and Aggregation, Joins, and Subqueries, using W3Schools' data tables. It covers various SQL operations such as retrieving records, filtering data based on conditions, sorting results, performing aggregations, and joining tables. Each question is designed to help users practice and enhance their SQL skills using practical examples from the Customers, Orders, Products, and Suppliers tables.

Uploaded by

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

Here are 25 MSSQL questions using W3Schools' data tables (Customers, Orders,

Products, Suppliers, etc.):

Basic Queries

1.​ Retrieve all records from the Customers table.


2.​ Select only the CustomerName and City from the Customers table.
3.​ Find customers located in "London".
4.​ Retrieve the distinct cities from the Customers table.
5.​ Count the number of customers in the Customers table.

Filtering and Conditions

6.​ List customers whose Country is either "Germany" or "France".


7.​ Find orders placed after "2022-01-01" in the Orders table.
8.​ Retrieve products with prices between 10 and 50 from the Products table.
9.​ Show customers whose names start with the letter "A".
10.​Retrieve products with no SupplierID (NULL values).

Sorting and Aggregation

11.​List all products sorted by Price in descending order.


12.​Find the maximum price of products in the Products table.
13.​Calculate the average price of products in the Products table.
14.​Retrieve the total number of orders in the Orders table.
15.​Group customers by Country and count how many customers are in each country.

Joins

16.​Write a query to join the Orders and Customers tables and display the OrderID,
OrderDate, and CustomerName.
17.​Join the Products and Suppliers tables to get the ProductName and
SupplierName.
18.​Find all orders where the CustomerName is "Alfreds Futterkiste".
19.​List all products along with their supplier information.
20.​Display all customers who have not placed any orders.

Subqueries

21.​Find the product with the highest price using a subquery.


22.​Retrieve customers who placed orders worth more than 1000 using a subquery.
23.​List suppliers who provide products with a price above the average product price.
24.​Find customers who are located in the same city as any supplier.
25.​Retrieve the names of products ordered by customers from "USA"

You might also like