Tag Info

New answers tagged

0

There's no need to have one table Users and another table Persons. I've never seen a social network that allows a single user to create more than one profile. True, there are people that keep multiple profiles, but these are done by opening multiple accounts (sometimes against the TOS). You could use this model: Table users: user_id (PK) username (IDX, ...


0

I'll make an assumption first. A real world person could have more than one user in your system? If a real world person (persons table) can have (and should have) only one user, why do you allow a one to many relationship between those two tables? Or I've misunderstood your model or I would create in the Logical Data Model only one table for users AND ...


1

I would create a distinct emails table and use a surrogate key to instantiate the reference of the email address to the person and to the user. The model would look like this: This handles the need to associate the email address with the users as well as the persons, but eliminates the redundancy of using the actual email address text to instantiate the ...


2

Normalization is the formal process for removing redundancy from relations by taking projections which when joined back form the original relational and thus eliminate some redundancy without data loss. It is the science underlying database design. The first three normal forms, and BCNF, deal specifically with eliminating redundancy due by ensuring that ...


1

No, you aren't mistaken. In fact 3NF does have update anomalies. BCNF is the lowest level of normalization with no update anomalies.


1

Let us address first normal form and second normal form distinctly. First Normal Form (1NF) You cannot say a table is or is not in 1NF because no two rows contain repeating information. By repeating information you may be thinking that BOOK doesn't look like this: BOOK { BookTitle, AuthorName1, AuthorName2, AuthorName3, BookType, ListPrice, AuthorAffil, ...


0

For what it's worth, the USPS has databases available which can be used to disabiguate and check addresses in this country -- which zipcodes cover which towns in which state, which streets (and which street addresses) exist within each zipcode, all the way down to which side of the street the address is on and within which block, and these days probably ...


2

I think that @datagod's answer is good, but I would tweak it a little based on your stated requirements: Address Table AddressLine1 varchar(255) -- If using SQL Server I would go with NVARCHAR instead. You don't seem to need unicode support but why not support it since things will often be converted to unicode in the application layer by default anyway, ...


1

I tried a while back to normalize zipcodes, and it does not really work, because there can be multiple zip codes for a city. So, while you can normalize City and State, Zip code just has to be put in the table. I suppose you could normalize on city+zipcode, such that you might have a table with something like 1 | "Indianapolis 46422", and 2 | ...


1

I deal with millions of existing international addresses. The following design works for my project: Address Table AddressLine1 varchar(255) AddressLine2 varchar(255) City varchar(50) PostalCode varchar(20) State varchar(50) CountryID int (FK to Country table) Avoid the temptation to normalize postal codes and states, unless you really do have a ...



Top 50 recent answers are included