1- Display contact First name and contact Last name for customers after sorting the customers by their contact Last name in ascending order.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
1- Display contact First name and contact Last name for customers after sorting the customers
by their contact Last name in ascending order.
2- selects the order line items (orderNumber, orderlinenumber) from the “orderdetails” table.
Also, display the subtotal (quantityOrdered * priceEach) for each line item and sorts the result
set based on the subtotal descending .
3- Display unique last names from employees table ordered by last name.
4- Display customerNumber, customerName and creditLimit for getting the top five customers
who have the highest creditLimit.
5- Find customer Name, customer country, sales representative employee number from
customers who do not have a sales representative.
6- For each order status, display status and count of orders have this status.
7- For Each order number in order details table, Display order number, sum of quantity ordered
(itemsCount) and sum of (priceEach * quantityOrdered) as total. With condition “total”
greater than 1000.
8- Display product code, product name and text description for product.
9- Find customer number, customer name, order status and order number, for customer with
their orders (handle customers that don’t have orders also).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
2- selects the order line items (orderNumber, orderlinenumber) from
the “orderdetails” table. Also, display the subtotal (quantityOrdered * priceEach) for each
line item and sorts the result set based on the subtotal descending .
3- Display unique last names from employees table ordered by last name.
4- Display customerNumber, customerName and creditLimit for getting the top five customers
who have the highest creditLimit.
5- Find customer Name, customer country, sales representative employee number from
customers who do not have a sales representative.
6- For each order status, display status and count of orders have this status.
7- For Each order number in order details table, Display order number, sum of quantity
ordered (itemsCount) and sum of (priceEach * quantityOrdered) as total. With condition
“total” greater than 1000.
8- Display product code, product name and text description for product.
9- Find customer number, customer name, order status and order number, for customer
with their orders (handle customers that don’t have orders also)