Skip to content

SQL practice environment based on the Sakila sample database (MySQL) for learning and experimenting with SQL queries; containerized with Docker Compose for seamless setup.

Notifications You must be signed in to change notification settings

Kinetics20/Sql_notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Below is the updated README file:


SQL Notes

This repository contains SQL practice exercises using the Sakila database. It serves as an educational resource where you can write, test, and refine SQL queries on a realistic dataset.

About the Sakila Database

The Sakila database is a sample database originally maintained by MySQL for learning and demonstration purposes. In this repository, only the MySQL version is used, specifically extracted from the jOOQ Sakila repository. The repository includes the following SQL files:

  • mysql-sakila-schema.sql – Contains the schema definition.
  • mysql-sakila-insert-data.sql – Contains the data insertion script.

Purpose

The aim of this repository is to provide a robust database environment for exploring various SQL commands, writing complex queries, and learning effective database manipulation techniques. The Sakila database serves as a sandbox for experimenting with joins, subqueries, transactions, and more.

Getting Started

Prerequisites

Setup Instructions

  1. Place Files in Your Working Directory

    Make sure you have the following files in your working directory:

    • mysql-sakila-schema.sql
    • mysql-sakila-insert-data.sql
    • A properly configured docker-compose.yaml file that sets up the MySQL container.
  2. Start the MySQL Container with Docker Compose

    Open a terminal in the directory where your files are located and run:

    docker compose up

    This command will launch the MySQL database container. The container configuration should be set up to run the provided SQL files to create the database schema and insert sample data automatically.

  3. Connect Using Your Database Client

    Once the container is running, use your preferred database client (e.g., DataGrip or PyCharm Professional) to connect to the MySQL instance. Make sure to use the connection details specified in your docker-compose.yaml configuration.

    Example connection details might include:

    • Host: localhost (or the Docker container's IP/hostname)
    • Port: Typically 3306
    • User: As configured in the docker-compose file (e.g., root)
    • Password: As set in your configuration
    • Database: sakila (if the SQL files automatically create this database)

    Adjust these settings as necessary based on your local configuration.

Usage

With the Sakila database up and running, you can now experiment with various SQL queries. Use this environment as a playground for writing, testing, and refining your SQL code. Explore data retrieval, complex queries, data manipulation, and other database functionalities to strengthen your SQL skills.


💬 Feedback

Contributions and suggestions are welcome!

👤 Author: Piotr Lipiński
🗓 Date: April 2025

About

SQL practice environment based on the Sakila sample database (MySQL) for learning and experimenting with SQL queries; containerized with Docker Compose for seamless setup.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published