Sunday, 29 September 2013

AGGREGATE FUNCTION SQL 2012 query unable to construct select statement

AGGREGATE FUNCTION SQL 2012 query unable to construct select statement

Im failry New to this and Im a SQL beginner. i have been assigned 10
scenerios to tackle but i have struggled with the Last 3 qsns. they are
the following:
Write a SELECT statement that returns one row for each category that has
products with these columns: The CategoryName column from the Categories
table The count of the products in the Products table The list price of
the most expensive product in the Products table Sort the result set so
the category with the most products appears first.
9.(5 points) Write a SELECT statement that returns one row for each
customer that has orders with these columns: The EmailAddress column from
the Customers table A count of the number of orders The total amount for
each order (Hint: First, subtract the discount amount from the price.
Then, multiply by the quantity.) Return only those rows where the customer
has more than than 1 order. Sort the result set in descending sequence by
the sum of the line item amounts.
Please, If anyone can assist me in how to tackle these problem i would
truly appreciate it

No comments:

Post a Comment