What are best practices for multi-language database design? [closed]

What we do, is to create two tables for each multilingual object. E.g. the first table contains only language-neutral data (primary key, etc.) and the second table contains one record per language, containing the localized data plus the ISO code of the language. In some cases we add a DefaultLanguage field, so that we can … Read more

What’s the longest possible worldwide phone number I should consider in SQL varchar(length) for phone

Assuming you don’t store things like the ‘+’, ‘()’, ‘-‘, spaces and what-have-yous (and why would you, they are presentational concerns which would vary based on local customs and the network distributions anyways), the ITU-T recommendation E.164 for the international telephone network (which most national networks are connected via) specifies that the entire number (including … Read more

First-time database design: am I overengineering? [closed]

Some more answers to your questions: 1) You’re pretty much on target for someone who is approaching a problem like this for the first time. I think the pointers from others on this question thus far pretty much cover it. Good job! 2 & 3) The performance hit you will take will largely be dependent … Read more

Schema for a multilanguage database

What do you think about having a related translation table for each translatable table? CREATE TABLE T_PRODUCT (pr_id int, PRICE NUMBER(18, 2)) CREATE TABLE T_PRODUCT_tr (pr_id INT FK, languagecode varchar, pr_name text, pr_descr text) This way if you have multiple translatable column it would only require a single join to get it + since you … Read more

What’s wrong with foreign keys?

Reasons to use Foreign Keys: you won’t get Orphaned Rows you can get nice “on delete cascade” behavior, automatically cleaning up tables knowing about the relationships between tables in the database helps the Optimizer plan your queries for most efficient execution, since it is able to get better estimates on join cardinality. FKs give a … Read more

What does principal end of an association means in 1:1 relationship in Entity framework

In one-to-one relation one end must be principal and second end must be dependent. Principal end is the one which will be inserted first and which can exist without the dependent one. Dependent end is the one which must be inserted after the principal because it has foreign key to the principal. In case of … Read more

Max length for client ip address [duplicate]

There’s a caveat with the general 39 character IPv6 structure. For IPv4 mapped IPv6 addresses, the string can be longer (than 39 characters). An example to show this: IPv6 (39 characters) : ABCD:ABCD:ABCD:ABCD:ABCD:ABCD:ABCD:ABCD IPv4-mapped IPv6 (45 characters) : ABCD:ABCD:ABCD:ABCD:ABCD:ABCD:192.168.158.190 Note: the last 32-bits (that correspond to IPv4 address) can need up to 15 characters (as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)