This repository contains various SQL queries demonstrating different SQL concepts and operations, ranging from basic to advanced, on hypothetical tables representing sales, people, products, and geographical locations.
- SaleDate: Date of the sale
- Amount: Amount of the sale
- Boxes: Number of boxes in the sale
- Customers: Number of customers in the sale
- GeoID: Geographical ID representing the location of the sale
- PID: Product ID representing the product in the sale
- SPID: Salesperson ID representing the salesperson in the sale
- Salesperson: Name of the salesperson
- Team: Team name to which the salesperson belongs
- SPID: Salesperson ID, unique identifier for each salesperson
- Product: Name of the product
- PID: Product ID, unique identifier for each product
- Geo: Name of the geographical location
- GeoID: Geographical ID, unique identifier for each geographical location
- Selecting data from tables
- Using WHERE clause to filter data
- Ordering data using ORDER BY
- Working with dates
- Using SQL functions like YEAR() and WEEKDAY()
- Using SQL operators like BETWEEN, IN, LIKE
- Creating calculated columns and renaming them using AS
- Using CASE for branching logic
- Grouping data using GROUP BY
- Joining tables using JOIN
These queries are meant for educational purposes to understand and learn SQL concepts and are to be run on a SQL-compatible database system with the corresponding tables and data.
To Chandoo YouTube Channel video on Learning SQL Queries in 1 hour.