This is my solution to Sylvia moestl vasilik SQL practice problems
The SQL practice problems consist of 57 select statement problems which ranges from beginners level select statement to advanced level select statement. Getting practice on real life data can be hard without working as a data analyst, engineer or programmer and the best way to learn is by practicing, so this book was written to introduce data enthusiasts to real life data problems.
A modified northwind database was used for this book. But the solution here is based on Microsoft sample Northwind database.
- Which shippers do we have?
- Certain fields from Categories
- Sales Representatives
- Sales Representatives in the United States
- Orders placed by specific EmployeeID
- Suppliers and ContactTitles
- Products with “queso” in ProductName
- Orders shipping to France or Belgium
- Orders shipping to any country in Latin America
- Employees, in order of age
- Showing only the Date with a DateTime field
- Employees full name
- OrderDetails amount per line item
- How many customers?
- When was the first order?
- Countries where there are customers
- Contact titles for customers
- Products with associated supplier names
- Orders and the Shipper that was used
- Categories, and the total products in each category
- Total customers per country/city
- Products that need reordering
- Products that need reordering, continued
- Customer list by region
- High freight charges
- High freight charges - 2015
- High freight charges with between
- High freight charges - last year
- Inventory list
- Customers with no orders
- Customers with no orders for EmployeeID 4
- High-value customers
- High-value customers - total orders
- High-value customers - with discount
- Month-end orders
- Orders with many line items
- Orders - random assortment
- Orders - accidental double-entry
- Orders - accidental double-entry details
- Orders - accidental double-entry details, derived table
- Late orders
- Late orders - which employees?
- Late orders vs. total orders
- Late orders vs. total orders - missing employee
- Late orders vs. total orders - fix null
- Late orders vs. total orders - percentage
- Late orders vs. total orders - fix decimal
- Customer grouping
- Customer grouping - fix null
- Customer grouping with percentage
- Customer grouping - flexible
- Countries with suppliers or customers
- Countries with suppliers or customers, version 2
- Countries with suppliers or customers - version 3
- First order in each country
- Customers with multiple orders in 5 day period
- Customers with multiple orders in 5 day period, version 2