What’s the best way to model recurring events in a calendar application? [closed]

I would use a ‘link’ concept for all future recurring events. They are dynamically displayed in the calendar and link back to a single reference object. When events have taken place the link is broken and the event becomes a standalone instance. If you attempt to edit a recurring event then prompt to change all … Read more

DB design to use sub-type or not?

Maybe a bit different approach — supertype/subtype is usually used when you have very specific columns for each subtype, like in Person supertype with Patient and Doctor subtypes. Person holds all data common to people and Patient and Doctor hold very specific columns for each one. In this example your book_notes and article_notes are not … Read more

single fixed table with multiple columns vs flexible abstract tables

Certain issues need to be clarified and resolved before we can enter into a reasonable discussion. Pre-requisite Resolution Labels In a profession that demands precision, it is important that we use precise labels, to avoid confusion, and so that we can communicate without having to use long-winded descriptions and qualifiers. What you have posted as … Read more

What mysql database tables and relationships would support a Q&A survey with conditional questions? [closed]

Survey Database Design Last Update: 5/3/2015 Diagram and SQL files now available at https://github.com/durrantm/survey If you use this (top) answer or any element, please add feedback on improvements !!! This is a real classic, done by thousands. They always seems ‘fairly simple’ to start with but to be good it’s actually pretty complex. To do … Read more

How to Model a “likes” voting system with MongoDB

No matter how you structure your overall document there are basically two things you need. That is basically a property for a “count” and a “list” of those who have already posted their “like” in order to ensure there are no duplicates submitted. Here’s a basic structure: { “_id”: ObjectId(“54bb201aa3a0f26f885be2a3”) “photo”: “imagename.png”, “likeCount”: 0 “likes”: … Read more

How to do Inheritance Modeling in Relational Databases?

Martin Fowler discusses this extensively in his book Patterns of Enterprise Application Architecture book. Get this book and look into: Single Table Inheritance Class Table Inheritance Concrete Table Inheritance The Website should give you some idea. You might also want to read the section on inheritance mappers. Each of the different approaches have their pros … Read more