Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 1111

The development of the conceptual schema and/or the logical model and/or the physical settings of a database.

2 votes

Database Design challenge: One (Table)-to-Many (Tables) Relationship?

This seems like a case where you'd want to use inheritance (subtype/supertype), but it isn't. A company that manufactures engines won't necessarily always be an engine manufacturer, and might not on …
Neil McGuigan's user avatar
1 vote

Which of these two methods is standard when creating a 1 to many database relationship?

A few things: An address can exist but no one lives there A person can have multiple addresses (home, job, other job, summer cottage) A company or person could be at an address Two or more people ca …
Neil McGuigan's user avatar
1 vote

Classifieds Database Design

You need to decide if your categories are hierarchical (one parent) or graphical (multiple parents). For example, are "cell phones" in the category "electronics" as well as "communications"? What kin …
Neil McGuigan's user avatar
3 votes

Parent/Child table design?

If a Parent Task and Subtask are essentially identical, save their rank in a hierarchy, then yes, a single table is appropriate. You can use a nullable foreign key to the primary key in the same table …
Neil McGuigan's user avatar
7 votes

Multiple instances of same foreign key in a single table

Pedantically, A table doesn't reference a foreign key, it references a table via a foreign key. It makes sense if it's necessary for the data model. Here's an example. A Sales Order is associated w …
Neil McGuigan's user avatar
2 votes

Choice- or ids-list- field representation

You haven't given us much to work with here, what is the "other table" about? Let's assume it's a Custom Priority for now. To be able to set a foreign key on multiple types, you need to use Table Inh …
Neil McGuigan's user avatar
1 vote

Database design -- companies, employees, individuals

Read up on Table Inheritance. Here's your data model in pseudo-syntax. : means inherits. Indentation means that thing is a property of the type. AbstractParty BirthDate -- companies have "created" …
Neil McGuigan's user avatar
1 vote
Accepted

What does normalization say about storing data from objects that use a decorator pattern?

Normalization says nothing about the Decorator Pattern, as normalization is much older. Check out Table Inheritance though, which I think is more along the lines of what you're talking about. http: …
Neil McGuigan's user avatar
2 votes
Accepted

Scalable Relational Database Design

So you're going to want to store your images on a fast CDN like Cloudfront. Normally I recommend storing pictures in-database, but not 240M of them :) I'd avoid storing the whole URL, as it's likely …
Neil McGuigan's user avatar
6 votes

What is the best practices for storing sales tax rates?

Sales taxes are almost infinitely complicated, so you might want to consider using a rules engine like Drools for this. Sales Tax is a rate or an amount that is charged on the value of an item, or b …
Neil McGuigan's user avatar
3 votes
2 answers
541 views

Is a trade-in its own purchase order, or an adjustment on a sales order?

Let's say you're a car dealer, selling cars. When a customer buys a new car, he often trades in his existing car. What data model makes more sense? A) create a sales order record for the sale, and …
Neil McGuigan's user avatar
5 votes

Need help designing table with list of IDs to store

Do not use a list of ids. You will regret it. Use junction tables. DDL: create table organization ( organization_id bigserial primary key, name text not null ); create table individual ( indi …
Neil McGuigan's user avatar
3 votes

Enforcing database integrity

There are a few times when constraints get in the way: When you need to use Single Table Inheritance (STI). Imagine you sell to both individuals and organizations. You will need a single "Party" tab …
Neil McGuigan's user avatar
0 votes

Managing features for a real estate agency

If you don't need to sort or search features, then using a CLOB might be fine, storing all the features as XML, which you can still query and is easy to format to HTML. If there are business rules or …
Neil McGuigan's user avatar
2 votes

Supertype/Subtype deciding between category: complete disjoint or incomplete overlapping

A product is not inventory. Inventory and products are distinct. A product is really a specification of a product, not a physical thing. The physical thing is an Asset that the company owns (or sto …
Neil McGuigan's user avatar

1
2 3 4 5
7
15 30 50 per page