Northwind database queries

hi pls i need urgent support to complete my sql assignment i need queries for northwind database

  1. Write a script to output a unique list of customers across customers and suppliers tables. Display
    Customername, Contactname and City. Sort your outcome by Customername Desc.
  2. Write a script to output Total, Average, Min and Max Freight by ShipCountry, order by Maximum freight
    desc.
  3. For each product, display the Total sales amount (including discount), order by the highest sales
    amount.

i would be glad if i get help
ifefasinaatgmaildotcom

SQLTeam is not a free query writing service.

At a minimum you need to post what you have tried.

i have tried to write but its not organised

SELECT DISTINCT Customers
FROM Customers,Suppliers
ORDER BY CustomerName,ContactName,City
SORT CustomerName DESC

I would suggest you start here:

SQL Tutorial (w3schools.com)

1 Like

SELECT SUM(Freight) FROM table_name;
SELECT AVG(Freight) FROM ShipCountry;
SELECT MIN(Freight) FROM ShipCountry;
SELECT MAX(Freight) FROM ShipCountry;
ORDER BY MAX Freight

hi pls i need support to answer a few northwind sql queries

  1. Write a script to output a unique list of customers across customers and suppliers tables. Display
    Customername, Contactname and City. Sort your outcome by Customername Desc.

SELECT DISTINCT Customers
FROM Customers,Suppliers
ORDER BY CustomerName,ContactName,City
SORT CustomerName DESC

  1. Write a script to output Total, Average, Min and Max Freight by ShipCountry, order by Maximum freight
    desc.

SELECT SUM(Freight) FROM table_name;
SELECT AVG(Freight) FROM ShipCountry;
SELECT MIN(Freight) FROM ShipCountry;
SELECT MAX(Freight) FROM ShipCountry;
ORDER BY MAX Freight DESC.

  1. For each product, display the Total sales amount (including discount), order by the highest sales
    amount.

SELECT productid, SUM(UnitPrice * (1 - Discount) * Quantity)
FROM [Order Details]
ORDER BY Sales DESC

Only one query. Also:

1 Like