A mini-project SQL project completed during training at Sparta Global.
An introduction to SQL basics and intermediate queries. Mainly focusing on DDL and DML commands, this project had been completed within a working week and had consisted of numeral topics. Data had been exported and visually represented in the PDF file (you can also view the respective Excel files). This repository contains a SQL file that was used in Microsoft Azure and the documentation. The Northwind database was used for this project.
View the SQL file or view the PDF file.
- Basic Syntax
- Concatenation
- Ordering
- Conditions
- Joins
- Grouping
- Aggregate Functions
SELECT CONCAT(e.FirstName,' ',e.LastName) AS "Employee Name", CONCAT(emp.FirstName,' ',emp.LastName) AS "Reports To"
FROM Employees e
LEFT JOIN Employees emp ON e.ReportsTo = emp.EmployeeID
SELECT ProductName
FROM Products
WHERE QuantityPerUnit LIKE'%bottle%'
SELECT TOP 10 c.CompanyName, SUM((1-od.Discount)*od.Quantity*od.UnitPrice) AS "Value of Orders Shipped" FROM Customers c
INNER JOIN Orders o ON c.CustomerID = o.CustomerID
INNER JOIN [Order Details] od ON o.OrderID = od.OrderID
WHERE YEAR(o.OrderDate) = YEAR((SELECT TOP 1 OrderDate FROM Orders ORDER BY OrderDate DESC))
AND o.ShippedDate IS NOT NULL
GROUP BY c.CompanyName
ORDER BY 2 DESC