Re: Which is best way of creating a database for each or one table in a database in MySQL?
Posted by: William Edward
Date: October 29, 2024 12:44AM

Your structure is close, but a few adjustments could improve normalization and simplify queries.

Remove Weekend_ID from PARTICIPANTS: Since participants can attend multiple weekends, this creates redundancy. Use PARTICIPANTS_JOBS to track their involvement in each weekend.

Remove PJ_ID from WEEKENDS_JOBS: It's unnecessary since PARTICIPANTS_JOBS already links participants, jobs, and weekends.

Revised Structure:

WEEKENDS: Weekend_ID, Weekend_Date, Location
JOBS: Job_ID, Job_NAME
PARTICIPANTS: Participant_ID, First_Name, Last_Name, Email
PARTICIPANTS_JOBS: Participant_ID, Job_ID, Weekend_ID
Queries:

Participants by Job: Query PARTICIPANTS_JOBS joined with PARTICIPANTS and JOBS tables.
Weekend with Job Assignments: Query PARTICIPANTS_JOBS joined with WEEKENDS and JOBS.
This structure improves normalization and query efficiency.

Options: ReplyQuote


Subject
Written By
Posted
Re: Which is best way of creating a database for each or one table in a database in MySQL?
October 29, 2024 12:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.