Skip to content

md-sawrab/SQL-Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Tables Involved

1. Sales

  • 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

2. People

  • Salesperson: Name of the salesperson
  • Team: Team name to which the salesperson belongs
  • SPID: Salesperson ID, unique identifier for each salesperson

3. Products

  • Product: Name of the product
  • PID: Product ID, unique identifier for each product

4. Geo

  • Geo: Name of the geographical location
  • GeoID: Geographical ID, unique identifier for each geographical location

SQL Concepts Demonstrated

  • 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

Usage

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.

Acknowldegments

To Chandoo YouTube Channel video on Learning SQL Queries in 1 hour.

Course: Learn SQL for Data Analysis in one hour

About

Hands On SQL Exercises. Chandoo YouTube Channel video on Learning SQL Queries in 1 hour.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published