SQL Database Design Best Practice (Addresses)

You’re on the right track by breaking address out into its own table. I’d add a couple of additional suggestions. Consider taking the Address FK columns out of the Customers/Orders tables and creating junction tables instead. In other words, treat Customers/Addresses and Orders/Addresses as many-to-many relationships in your design now so you can easily support … Read more

Reason why oracle is case sensitive?

By default, Oracle identifiers (table names, column names, etc.) are case-insensitive. You can make them case-sensitive by using quotes around them (eg: SELECT * FROM “My_Table” WHERE “my_field” = 1). SQL keywords (SELECT, WHERE, JOIN, etc.) are always case-insensitive. On the other hand, string comparisons are case-sensitive (eg: WHERE field=’STRING’ will only match columns where … Read more

Database modeling for international and multilingual purposes

Here is the way I would design the database: Visualization by DB Designer Fork The i18n table only contains a PK, so that any table just has to reference this PK to internationalize a field. The table translation is then in charge of linking this generic ID with the correct list of translations. locale.id_locale is … Read more

Signed or unsigned in MySQL

According to section 10.2 of the MySQL 5.1 Manual: In non-strict mode, when an out-of-range value is assigned to an integer column, MySQL stores the value representing the corresponding endpoint of the column data type range. If you store 256 into a TINYINT or TINYINT UNSIGNED column, MySQL stores 127 or 255, respectively. When a … Read more

Alternatives to Entity-Attribute-Value (EAV)?

There is a difference between EAV done faithfully or badly; 5NF done by skilled people or by those who are clueless. Sixth Normal Form is the Irreducible Normal Form (no further Normalisation is possible). It eliminates many of the problems that are common, such as The Null Problem, and provides the ultimate method identifying missing … Read more