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
, andSELECT
operations on thePlayers
,Teams
, andRosters
tables. 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
spTableNameSelectAll
for displaying all records fromPlayers
,Teams
, andRosters
tables 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
vwPlayerRosters
combining data fromPlayers
,Rosters
, andTeams
.
- A view named
-
Team Roster Stored Procedures:
spTeamRosterByID
andspTeamRosterByName
for displaying team rosters based on ID and name.
-
Player Count View:
- A view
vwTeamsNumPlayers
showing the number of players registered on each team.
- A view
-
Player Count Function:
- A function
fncNumPlayersByTeamID
to return player counts based on team ID.
- A function
-
Game Schedule View:
vwSchedule
for displaying detailed game schedules.
-
Game Schedule Stored Procedures:
spSchedUpcomingGames
andspSchedPastGames
for showing upcoming and past games.
-
Standings Calculation:
spRunStandings
for 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
SERVEROUTPUT
is set ON for proper execution ofDBMS_OUTPUT
. - Please refer to inline comments within the
.sql
file for detailed implementation notes and guidelines.