WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Could you check the SQL query and let me know if there are any errors?

Minizerg

New member

0

0%

Status

Offline

Posts

51

Likes

0

Rep

0

Bits

265

3

Months of Service

0%
Hello, I have written some SQL queries, but my computer does not support the necessary editor to check these queries. Could you please help me by confirming if I have written them correctly as I think there may be errors, but I'm not sure where or how. Additionally, I couldn't solve the 9th question, can you help me? :) Table structure: 4) How many products were sold on the day when the most products were sold? 5) Which customers shopped on the day with the least sales? 6) List the customers who shopped on the day with the most sales in descending order of age. 7) On the day with the most sales, which product was sold the most? 8) How much worth of goods are currently in stock in the warehouse? 9) Who is the customer that spent the most money? Query for question 4: `select top 1 Amount, SaleDate from Sales order by Amount desc` Query for question 5: `select Customers.Name, Customers.LastName from Customers inner join Sales on Customers.CustomerID = Sales.CustomerID where SaleDate = min(Sales.SaleDate)` Query for question 6: `select Customers.Name, Customers.LastName from Customers inner join Sales on Customers.CustomerID = Sales.CustomerID where SaleDate = max(Sales.SaleDate) order by Customers.BirthDate asc` Query for question 7: `select Products.ProductName from Products inner join Sales on Products.ProductID = Sales.ProductID where Amount = max(Sales.Amount)` Query for question 8: `select sum(Price*Stock) as total from Products`
 

249

6,622

6,642

Top