3,113 questions
891
votes
15
answers
537k
views
What's the difference between identifying and non-identifying relationships?
I haven't been able to fully grasp the differences. Can you describe both concepts and use real world examples?
276
votes
7
answers
217k
views
What's the longest possible worldwide phone number I should consider in SQL varchar(length) for phone
What's the longest possible worldwide phone number I should consider in SQL varchar(length) for phone.
considerations:
+ for country code
() for area code
x + 6 numbers for Extension extension (so ...
185
votes
24
answers
122k
views
What should I name a table that maps two tables together? [closed]
Let's say I have two tables:
Table: Color
Columns: Id, ColorName, ColorCode
Table: Shape
Columns: Id, ShapeName, VertexList
What should I call the table that maps color to shape?
Table: ???
Columns:...
167
votes
8
answers
138k
views
What is the most efficient way to store tags in a database?
I am implementing a tagging system on my website similar to one stackoverflow uses, my question is - what is the most effective way to store tags so that they may be searched and filtered?
My idea is ...
120
votes
8
answers
68k
views
Crow's Feet - One vs One And Only One [closed]
What is the difference between
ONE:
ONE AND ONLY ONE:
98
votes
3
answers
27k
views
How to implement has_many :through relationships with Mongoid and mongodb?
Using this modified example from the Rails guides, how does one model a relational "has_many :through" association using mongoid?
The challenge is that mongoid does not support has_many :through as ...
74
votes
8
answers
27k
views
What are design patterns to support custom fields in an application?
We develop a commercial application. Our customers are asking for custom fields support. For instance, they want to add a field to the Customer form.
What are the known design patterns to store the ...
66
votes
9
answers
25k
views
Should OLAP databases be denormalized for read performance? [closed]
I always thought that databases should be denormalized for read performance, as it is done for OLAP database design, and not exaggerated much further 3NF for OLTP design.
PerformanceDBA in various ...
63
votes
2
answers
10k
views
Data modeling in Datomic
I've been looking into Datomic, and it looks really interesting. But while there seems to be very good information on how Datomic works technically, I have not seen much on how one should think about ...
61
votes
9
answers
43k
views
Is it good database design to have admin users in the same table as front-end users?
I have users who can login on a front-end page, and admins who can login on an admin page.
Should both users and admins be "Users" with different roles, or should they be split in different tables?
52
votes
2
answers
65k
views
What is an "order line"?
I listen a number of podcasts. Often I hear the expression "Order line" in the context of database or business object modelling. It seems to be the canonical example of something. I just don'...
48
votes
4
answers
53k
views
How to map OO inheritence to a relational database scheme?
I have a canonical data model. Some fields are related to the pricing of a product. It inherits certain attributes from the product table. I want to model this inheritance in a MySQL relational ...
47
votes
6
answers
24k
views
What is the best way to represent "Recurring Events" in database?
I am trying to develop a scheduler- and calendar-dependent event application in C#, for which a crucial requirement is to represent recurring events in the database.
What is the best way to represent ...
45
votes
4
answers
30k
views
Where should I store a foreign key?
If I have a relationship between two tables (both tables have their own primary keys) what should guide my decision as to which table should store the foreign key? I understand that the nature of the ...
43
votes
8
answers
2k
views
Do you use Styrofoam balls to model your systems? [closed]
[Objective-C]
Do you still use Styrofoam balls to model your systems, where each ball
represents a class?
Tom Love: We do, actually. We've also done a 3D animation version of
it, which ...
42
votes
4
answers
44k
views
What's the difference between Data Modelling and Domain Modelling?
By the way - with reference to data modelling I'm referring to logical or conceptual data models - not physical ones.
The question came up during a discussion at work; naturally I leapt to Wikipedia ...
37
votes
6
answers
54k
views
A good database modeling tool for PostgreSQL? [closed]
PostgreSQL comes with the excellent pgAdmin-tool for managing the database but lacks GUI data-modeling utility?
I found this list: http://www.databaseanswers.org/modelling_tools.htm
but don't have ...
35
votes
3
answers
32k
views
How to *really* write UML cardinalities?
I would like to know once and for all how to write UML cardinalities, since I very often had to debate about them (so proofs and sources are very welcome :)
If I want to explain that a Mother can ...
34
votes
3
answers
20k
views
Data modeling practices in Redis? [closed]
I've recently been getting into Redis and find it very appealing. I'd like to see how far I can push it's limits as a database. I read the Retwis tutorial and found it very interesting. I'm wondering ...
31
votes
5
answers
15k
views
single fixed table with multiple columns vs flexible abstract tables
I was wondering if you have a website with a dozen different types of listings (Shops, Restaurants, Clubs, Hotels, Events) that require different fields, is there a benefit of creating a table with ...
29
votes
6
answers
10k
views
Avoid exposing primary keys in the source of a web app?
I often come across web applications that expose internal database primary keys through forms like select boxes. And occasionally I see javascript matching against an int or guid magic value that ...
24
votes
12
answers
17k
views
Best way to model Customer <--> Address
Every Customer has a physical address and an optional mailing address. What is your preferred way to model this?
Option 1. Customer has foreign key to Address
Customer (id, phys_address_id, ...
23
votes
5
answers
47k
views
Database design for a recursive relationship
Consider this case where I'm trying to model a database for a company:
Entities: Employees, Managers, Departments.
An Employee works in only 1 Department while a Department may have many Employees ...
21
votes
2
answers
45k
views
What's the difference between data model and object model?
CWM is data modeling
UML is object modeling.
Can someone explain the difference that a layman can understand?
20
votes
8
answers
5k
views
Determine Event Recurrence Pattern for a set of dates
I am looking for a pattern, algorithm, or library that will take a set of dates and return a description of the recurrence if one exits, i.e. the set [11-01-2010, 11-08-2010, 11-15-2010, 11-22-2010, ...