Skip to content

ishimweegide23/ishimwe_pl_sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 

Repository files navigation

⚽ Premier League Database Management System

Oracle Database License

πŸ“– Project Overview

This project implements a comprehensive Football Database Management System using Oracle PL/SQL. The database is designed to manage Premier League teams, players, matches, statistics, and standings with proper relational structure and data integrity.

πŸ—οΈ Database Architecture

πŸ“Š Entity Relationship Diagram

Teams (1) ←→ (N) Players
Teams (1) ←→ (N) Matches (Home/Away)
Players (1) ←→ (N) PlayerStats
Teams (1) ←→ (1) Standings

πŸ—„οΈ Database Schema

πŸ† Teams Table

  • TeamID (Primary Key)
  • TeamName - Club name
  • Stadium - Home stadium
  • Coach/ManagerName - Current manager
  • FoundedYear - Year the club was founded

πŸ‘₯ Players Table

  • PlayerID (Primary Key)
  • PlayerName - Player's full name
  • Position - Playing position
  • Nationality - Player's nationality
  • DateOfBirth - Birth date
  • TeamID (Foreign Key β†’ Teams)

⚽ Matches Table

  • MatchID (Primary Key)
  • HomeTeamID (Foreign Key β†’ Teams)
  • AwayTeamID (Foreign Key β†’ Teams)
  • MatchDate - Date of the match
  • HomeTeamGoals - Goals scored by home team
  • AwayTeamGoals - Goals scored by away team

πŸ“ˆ PlayerStats Table

  • StatID (Primary Key)
  • PlayerID (Foreign Key β†’ Players)
  • MatchesPlayed - Total matches played
  • GoalsScored - Total goals scored
  • Assists - Total assists

πŸ… Standings Table

  • TeamID (Foreign Key β†’ Teams)
  • Points - Total points earned
  • Wins - Number of wins
  • Losses - Number of losses
  • Draws - Number of draws
  • GoalDifference - Goal difference

πŸš€ Features Implemented

βœ… Core Functionality

  • Table Creation with proper constraints
  • Foreign Key Relationships for data integrity
  • Data Insertion with sample Premier League data
  • Table Alterations (adding columns dynamically)
  • Data Updates and modifications
  • Data Deletion operations
  • Inner Joins for related data retrieval
  • Left Joins for comprehensive data views
  • Transaction Management (COMMIT/ROLLBACK)

πŸ” Query Examples

  1. Player-Team Relationships: Display players with their respective teams
  2. Team Rosters: Show all teams with their players (including teams without players)
  3. Match Results: Track game outcomes and statistics
  4. League Standings: Monitor team performance and rankings

πŸ“‹ Sample Data

The database includes sample data for popular Premier League teams:

  • βšͺ Liverpool (Anfield) - Arne Slot
  • πŸ”΅ Manchester City (Etihad Stadium) - Pep Guardiola
  • πŸ”΅ Chelsea (Stamford Bridge) - Enzo Maresca
  • πŸ”΄ Arsenal (Emirates Stadium) - Mikel Arteta

πŸ› οΈ Installation & Setup

Prerequisites

  • Oracle Database 11g or higher
  • SQL Developer or similar Oracle client
  • Basic understanding of PL/SQL

Setup Instructions

  1. Clone the repository

    git clone https://github.com/ishimweegide23/ishimwe_pl_sql.git
    cd ishimwe_pl_sql
  2. Connect to Oracle Database

    -- Connect to your Oracle instance
    sqlplus username/password@database
  3. Execute the SQL Script

    @PLSQL_WORK.sql

πŸ’» Usage Examples

Basic Queries

-- View all teams and their stadiums
SELECT TeamName, Stadium, ManagerName 
FROM Teams;

-- Get player information with team details
SELECT p.PlayerName, p.Position, t.TeamName
FROM Players p
INNER JOIN Teams t ON p.TeamID = t.TeamID;

-- Check current league standings
SELECT t.TeamName, s.Points, s.Wins, s.Draws, s.Losses
FROM Teams t
INNER JOIN Standings s ON t.TeamID = s.TeamID
ORDER BY s.Points DESC;

πŸ”§ Advanced Operations

Transaction Management

-- Safe data modification
BEGIN
    UPDATE Teams SET ManagerName = 'New Manager' WHERE TeamID = 1;
    -- Verify changes
    SELECT * FROM Teams WHERE TeamID = 1;
    -- Commit if satisfied
    COMMIT;
    -- Or rollback if needed
    -- ROLLBACK;
END;

πŸ“Š Database Statistics

  • 4 Core Tables with proper relationships
  • Sample Data for 4 Premier League teams
  • Foreign Key Constraints ensuring data integrity
  • Flexible Schema supporting future expansions

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

πŸ“ Future Enhancements

  • Add Seasons table for historical data
  • Implement Views for complex queries
  • Add Stored Procedures for common operations
  • Create Triggers for automatic data updates
  • Add Indexes for performance optimization
  • Implement User roles and permissions

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Ishimwe Egide

πŸ™ Acknowledgments

  • Oracle Corporation for PL/SQL documentation
  • Premier League for inspiration
  • Football community for the passion that drives this project

⭐ Star this repository if you found it helpful! ⭐

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors