PitchHut logo
University DB
A modern MariaDB sample database tailored for learning SQL.
Pitch

University DB is a comprehensive sample database designed specifically for MariaDB 11.7+. It offers extensive features, including support for advanced data types like JSON and VECTOR, a complete normalization to 3NF, and an array of tables and queries for users to practice and explore SQL functionalities effectively.

Description

University DB

University DB is an innovative and modern MariaDB 11.7+ sample database designed to offer a comprehensive learning experience in SQL, created as an alternative to the outdated Sakila database. This repository provides a rich dataset that encompasses various MariaDB data types—including VECTOR and JSON—and features a structure that is fully normalized to 3NF, making it suitable for both beginners and advanced users.

Key Features

  • Robust Structure: Comprises 16 tables that facilitate lookup, domain, transactional data, and two extensive analytic tables.
  • Comprehensive Data Types: Supports all major MariaDB types: INT, BIGINT, TINYINT, CHAR, VARCHAR, TEXT, MEDIUMTEXT, DECIMAL, DATE, DATETIME, TIMESTAMP, TIME, YEAR, ENUM, SET, BOOLEAN, JSON, and VECTOR(1536).
  • Full-Text Search Capabilities: Enable robust text searches on courses and publications, enhancing querying capabilities.
  • Advanced Query Support: Offers a 3-level department hierarchy (Faculty → Department → Sub-department) as well as complex analytical queries demonstrating the practical use of recursive Common Table Expressions (CTEs).
  • Dynamic Data Generation: The database setup includes 4 levels of example queries guiding users from basic SELECT statements to advanced EXPLAIN ANALYZE commands and window functions.
  • Docker Integration: Supports a Docker-first setup workflow providing an efficient way to initialize the database with a single command.

Comparison with Sakila

FeatureSakilaUniversity DB
Designed forMySQL 5.xMariaDB 11.7+
JSON supportNoYes (5 columns)
VECTOR supportNoYes VECTOR(1536)
FULLTEXT indexesNoYes (2 indexes)
Analytical big tableNoYes (120,000 rows)
Recursive CTEs demoNoYes
Stored procedures36
Triggers67
Views77

Schema Overview

The database includes essential tables such as departments, faculty, students, and grade_events, with notable features including:

  • Department Structure: Self-referential relationships enable complex hierarchical data manipulation.
  • Diverse Data Models: Incorporates JSON columns to manage complex data structures easily, enhancing the functionality and flexibility of data entries.

Database Objects

The University DB supports various database objects like views, stored procedures, and triggers that streamline data management and querying processes:

  • Views: Enable easy access to complex queries, such as weighted GPAs or student faculty workloads.
  • Stored Procedures: Validate and manage enrollments, compute GPAs, and maintain integrity across data entries.
  • Triggers: Automatically enforce business rules during data modifications, ensuring data accuracy and integrity.

Learning Path

Users can progressively enhance their SQL skills by working through a structured learning path provided in the repository, from basic selections to more complex database operations:

In summary, University DB serves as an essential resource for anyone looking to master SQL with a focus on modern MariaDB features. The comprehensive structure, combined with extensive learning materials, enables users to engage with and understand complex database concepts effectively.

0 comments

No comments yet.

Sign in to be the first to comment.