This project focuses on enhancing the SportLeagues database by developing various PL/SQL objects. These enhancements aim to facilitate basic CRUD operations and other functionalities within the database. This is a group undertaking completed in collaboration with Siripa Purinruk and Huu Linh Nguyen.
Here is an ERD about the database on which we will create enhancements:
Scripts/DocumentEnhancements.sql: Contains the PL/SQL code developed for the project.
- PL/SQL Programming: Mastery in writing, debugging, and optimizing PL/SQL code.
- CRUD Operations: In-depth knowledge of implementing Create, Read, Update, and Delete operations in a database context.
- Error Handling: Proficiency in managing SQL exceptions using error codes for more robust database operations.
- Database Design: Enhanced understanding of database structures and relationships, particularly in sports league management systems.
- Problem Solving: Developed a strong ability to tackle complex challenges encountered in database programming and design.
- Analytical Thinking: Advanced skills in analyzing requirements and implementing efficient database solutions.
- Stored Procedures Creation: Hands-on experience in designing and implementing Stored Procedures for a range of database functionalities.
- Data Retrieval Techniques: Experience in advanced data retrieval methods, including returning table data as part of Stored Procedure outputs.
- Views and Functions Development: Practical skills in creating and using views and user-defined functions to enhance data accessibility and manipulation in the database.
- Teamwork: Valuable experience gained in working collaboratively within a group, contributing effectively to a complex database project.
- Project Management: Experience in managing different aspects of a database project, from initial design to implementation and testing.
-
CRUD Stored Procedures:
- Implementation of Stored Procedures for
INSERT,UPDATE,DELETE, andSELECToperations on thePlayers,Teams, andRosterstables. Each SP is designed to handle specific CRUD operations, with appropriate error handling and return values.
- Implementation of Stored Procedures for
-
Display Content Stored Procedures:
- Stored Procedures named
spTableNameSelectAllfor displaying all records fromPlayers,Teams, andRosterstables usingDBMS_OUTPUT.
- Stored Procedures named
-
Advanced Data Retrieval Procedures:
- Stored Procedures returning table data as part of their output (
spPlayersSelectTable,spTeamsSelectTable,spRostersSelectTable), demonstrating advanced data retrieval techniques.
- Stored Procedures returning table data as part of their output (
-
View for Player Rosters:
- A view named
vwPlayerRosterscombining data fromPlayers,Rosters, andTeams.
- A view named
-
Team Roster Stored Procedures:
spTeamRosterByIDandspTeamRosterByNamefor displaying team rosters based on ID and name.
-
Player Count View:
- A view
vwTeamsNumPlayersshowing the number of players registered on each team.
- A view
-
Player Count Function:
- A function
fncNumPlayersByTeamIDto return player counts based on team ID.
- A function
-
Game Schedule View:
vwSchedulefor displaying detailed game schedules.
-
Game Schedule Stored Procedures:
spSchedUpcomingGamesandspSchedPastGamesfor showing upcoming and past games.
-
Standings Calculation:
spRunStandingsfor updating standings in a temporary table.
-
Standings Update Trigger:
- A trigger to automate the execution of
spRunStandings.
- A trigger to automate the execution of
-
Additional Custom Database Object:
- A unique database object developed by the group to enhance the database's functionality.
For detailed information about the PL/SQL objects, including required input parameters, expected outputs, potential error codes, purpose, and example code, please refer to the User Guide.
- The project uses specific error codes for exception handling across different Stored Procedures. These codes include:
-1: No data found-2: Many rows returned-3: No row inserted/updated/deleted-4: VALUE_ERROR-5: Others-6: Invalid cursor
- Ensure
SERVEROUTPUTis set ON for proper execution ofDBMS_OUTPUT. - Please refer to inline comments within the
.sqlfile for detailed implementation notes and guidelines.