• 0

Database normalization help [mysql]


Question

My organization is hosting a charity event, and they've asked me to develop a Web-based registration system, using MySQL and PHP. I need some help getting the database structure correct, based on the registration forms they've created on paper. I've made similiar systems for them in the past, but these were never more than one database table in complexity. I took a course in database design in college but I hcan't had do deal with this many tables or db normalization in a long time.

 

Participants (registrants) are either individuals or families, with some fields in common to both types, such as contact info. Each family has multiple members with unique information per person, such as name and t-shirt size. Individual registrants have these fields as well.

Each registrant is supposed to raise money via donors. Donors can sponsor many registrants for any amount each.

 

I'm working in MySQL Workbench for the first time and made an EER diagram of my tables. What I'm particularly confused about is whether I have the individuals correctly set in their own table in addition to their entry in the registrants table.

 

Thanks.

post-1865-0-62349100-1426442254.png

Link to comment
https://www.neowin.net/forum/topic/1250092-database-normalization-help-mysql/
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  On 18/03/2015 at 14:34, briley said:

Have you considered combining the familymembers and individuals table into a single table? It might be easier when creating your app to keep all the "humans" associated with a registration in one place (i.e. to find out how many t-shirts to make).

 

Also, what is the purpose of the donors-donations table?

 

I'm not sure I fully grasp the scenario but on quick glance I would say it makes more sense to combine donors, individuals, and family members into a single "people" or similar table.  That table should also have fname and lname which should not be in the registrants table. (which might be better to call registrations as it is not people).  Likewise I'd have a single addresses table and remove the duplicate fields from donors and registrants.

 

So the donors table might have personid, addressid, and donorid.

registrants might have regid, personid, familyid, and addressid (where each record contained either a personid OR a familyid, this effectively replaces the type enum as well)

familymembers might have familyid and personid (you might also want a families table that has the familyid as a key in between these)

table people might have personid, fname, lname, age, email, phone(cell), and tshirtsize.

table addresses might have addressid, address, city, state, phone(home), and zip.

 

The purpose of the donors-donations table seems to be to allow a many to many relationship between donors and donations.  i.e. a single donor can have many donations and a single donation can come from many donors.

  • Like 1
  • 0

Have you considered combining the familymembers and individuals table into a single table? It might be easier when creating your app to keep all the "humans" associated with a registration in one place (i.e. to find out how many t-shirts to make).

 

Also, what is the purpose of the donors-donations table?

  • 0

for example if registrant is a family, what would you put on the fname of the registrants table?

 

i would get rid of individuals; create a table called members and manage al members on one table, being individual or family

then a registrant with only one record asociated in members is then an individual

 

i would remove fname and lname from registrants and move them to members

This topic is now closed to further replies.
  • Posts

    • But what does Everything bring if you're not interested in search, but browsing files and directories in the classic file explorer sense? It's not always you're interested in searching for something in particular.
    • NWinfo 1.4.2 by Razvan Serea NWinfo is a lightweight tool designed to give a quick look at your computer's key details, from hardware to software specs, without any fuss. You don't need to install it; just download, run, and see everything you need on one screen. It displays essential info about your CPU, memory, disk drives, network, and even the system's operating details. Since it’s portable, you can carry NWinfo on a USB stick and use it on any Windows machine, making it a handy tool for both tech enthusiasts and troubleshooting. NWinfo key features: Lightweight and portable—no installation required Simple, user-friendly interface for easy navigation Displays detailed CPU information, including model and speed Shows memory (RAM) specifications and usage Provides disk information, including storage capacity and usage Lists network adapters and IP addresses Displays motherboard details, including model and manufacturer Shows system uptime and operating system version Detects graphics card information and driver details Includes battery status for laptops Provides monitor specifications, including resolution and refresh rate Displays BIOS version and other firmware details Offers a summary of active processes and services Generates detailed logs for sharing or troubleshooting Open-source and free, allowing for customization and community support NWinfo 1.4.2 changelog: Add Polish language support Add support for EFI key options Refactor EFI boot menu enumeration Add FACS table parsing Add SMBIOS support for types 37-39 and 42 Note: NWinfo might trigger a few antivirus alerts or show up with warnings on VirusTotal due to its low download frequency. If you have any concerns, you're welcome to review the full source code available on the developer’s repository. Download: NWinfo 1.4.2 | 2.2 MB (Open Source) View: NWinfo Website | NWinfo@GitHub | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • TSMC's trade secret meltdown exposed by internal monitoring by Paul Hill Taiwan Semiconductor Manufacturing Co. (TSMC) has detected unauthorized activities using “comprehensive and robust monitoring mechanisms”. The chip maker said that it believes trade secrets have been leaked as a result and has taken disciplinary action against the personnel involved and initiated legal proceedings explaining that it has a zero-tolerance policy for compromising trade secrets or harming company interests. As the case is under judicial review, it is unable to provide further details about the case. While TSMC is not speaking on the matter, the leak allegedly involves critical proprietary information on 2-nanometer chip development and production. Production of the 2-nanometer chip is among the leading-edge manufacturing processes in the semiconductor industry right now, which explains why an actor would want to steal related information. TSMC is one of the world’s leading chip makers, with companies like Apple and Nvidia being among its clients. It is also the world’s biggest chip maker and among the most advanced. After this leak, the company has reaffirmed its commitment to safeguarding its core business competitiveness and the shared interests of all its employees. The jury is still out on the motivations behind the leaking of the trade secrets, but those involved have been fired, according to Nikkei. TSMC, similarly to Nvidia, has found itself in the geopolitical struggle between China and the US in recent years. As you likely know, the last several years have seen America really go hard after Huawei over national security concerns, and in more recent years, the US has sought to limit China’s access to AI hardware. Earlier this year, Neowin reported that TSMC faces a $1 billion fine for breaching export controls against Huawei. TSMC had made a chip for the Chinese firm Sophgo, but that same chip was later discovered to be used in Huawei's high-end Ascend 910B AI processor. This discovery was made by TechInsights, a Canadian company, and as a result, TSMC stopped shipments to Sophgo, and the US added Sophgo to its blacklist to prevent further circumvention along that route. It will certainly be fascinating to learn more about the motivation for the theft of trade secrets as more information comes to light. Via: CNBC | Image via Depositphotos.com
  • Recent Achievements

    • Week One Done
      Zojaji earned a badge
      Week One Done
    • First Post
      Soeaker4thedead earned a badge
      First Post
    • First Post
      kryptickid earned a badge
      First Post
    • First Post
      Nemesis-IV earned a badge
      First Post
    • First Post
      Aidan Helfrich earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      759
    2. 2
      ATLien_0
      187
    3. 3
      +FloatingFatMan
      151
    4. 4
      Xenon
      117
    5. 5
      wakjak
      113
  • Tell a friend

    Love Neowin? Tell a friend!