Contents
How to find details of customers who ordered?
Please note that I have seen a similar query here, but think my query is different enough to merit a separate question. Now suppose I would like to find the names of all the customers who have ordered more than 10 different types of product, and the number of types of products they ordered.
How to see which product was purchased the most?
SELECT productid , COUNT(*) FROM Sales. SalesOrderDetail GROUP BY ProductID That isn’t ordered, so I can easily add an ORDER BY to see the products sold and the counts. SELECT productid , COUNT(*) FROM Sales. SalesOrderDetail GROUP BY ProductID ORDER BY COUNT(*) DESC That gives me a list, but I really want to just get the top seller.
How to display all products that each customer is buying?
1. Display all of the products that each customer is buying. *I assume that you want get the list of all the product that bought by each customer. 2. Using question (1) display how many customers are from each state from this query. Anyway, the tables don’t fulfill the Normalization.
Do you separate customers, products and orders?
Anyway, the tables don’t fulfill the Normalization. You should separate the into 3 tables, which are Customers, Products and Orders. Don’t store the Products and the Orders into 1 table. Because if you delete the product, then the Orders’ data will be gone too.
Where to put product type in SQL subquery?
The product type “Name” column is the more general name of the product, such as books, dvds, cds, etc. I need to include the product type “Name column in my query not product’s name column. Therefore, the end result should look something like this
How to get customer list in SQL Server?
So I have 3 tables Customers, Product and Product_Purchase with values inserted. Now I want the list of customers who purchased only (Milk, Butter, and Paneer).
What’s the difference between product name and product type?
The difference is that in products table “Name” is the specific name of the product, as shown in my link. The product type “Name” column is the more general name of the product, such as books, dvds, cds, etc. I need to include the product type “Name column in my query not product’s name column.