Tag Info

New answers tagged

1

Sorry, this may not be An Answer, but I couldn't add a comment. This is surely a 'solved problem' in that hotel and reservation systems are available commercially 'off the shelf'? Why develop your own? Even if you do decide for good reason that you need to, it might well be worth investigating the data models underlying a few commercial products, if you can ...


4

The relationship between normalization and performance is complicated. Sometimes the pursuit of normalization and the pursuit of high performance lead in the same direction, sometimes in opposite directions. You have to look at each case carefully. More importantly, there is more than one measure of "goodness" in a database. In addition to performance, ...


5

You'd need a many-to-many table that maps people to companies. Something like (I'm guessing at your table definitions) CREATE TABLE employment ( person_id INTEGER REFERENCES person ( person_id ), company_id INTEGER REFERENCES company ( company_id ), CONSTRAINT pk_employment PRIMARY KEY ( person_id, company_id ) );


0

I think the comment in your linked question is referring to the idea that you could be using natural keys instead of generated keys for everything. But I don't think your use of generated keys in this instance is unwarranted; you want a single unique key that can reference a single row of data. I do have a question about your choice UUID's, though. They ...


4

The id antipattern is having a unique ID column in each table without requiring (or often discouraging) the application of alternate unique keys. The ID is generated for each new record. Why is this an antipattern? Numeric surrogate keys are fine, including when they are singleton primary keys. However, every time I have seen a schema in which EVERY ...


1

What happens when your customer FOO, Inc. changes its name (gets bought out by another company like Northwest Airlines which is now Delta, or like Accenture which used to be Anderson Consulting)? You have to change all instances of "FOOINC" to something else, and if that's your primary key and there are other tables that have foreign key references to it, ...



Top 50 recent answers are included