database-normalization

Normalization in plain English

巧了我就是萌 提交于 2019-11-27 00:14:43
I understand the concept of database normalization, but always have a hard time explaining it in plain English - especially for a job interview. I have read the wikipedia post, but still find it hard to explain the concept to non-developers. "Design a database in a way not to get duplicated data" is the first thing that comes to mind. Does anyone has a nice way to explain the concept of database normalization in plain English? And what are some nice examples to show the differences between first, second and third normal forms? Say you go to a job interview and the person asks: Explain the

Understanding Normalization & Duplicates - I Guess I Don't - Adding Artist & Title Ids [closed]

一世执手 提交于 2019-11-26 23:33:59
问题 I began with a table listing the top 100 songs by date for the years 1958 through 1980. For each date, there are 100 records. Obviously many will be duplicates as a song changes position from week to week. Also, the artists will be duplicated (think Elvis) numerous times. There are ~ 116,000 records in the table. This table had the following fields uniq, date, artist, title, position To eliminate duplicates (normalization as I understand it) I have modified the table so that it now looks like

What exactly does database normalization do?

拈花ヽ惹草 提交于 2019-11-26 23:08:16
问题 New to database and so no to get upset with simple questions. As far as my googled and gathered knowledge normalization reduces redundancy of data and increase the performance. But really, I didn't understand what exact reason for dividing the master table into other small tables, applying relationship among them, retrieving the data using all possible unions,subqueries,joins etc., Why can't we have all the data in a single table and retrieve them as on required. I'm little confused. 回答1: The

What is the best way to implement Polymorphic Association in SQL Server?

微笑、不失礼 提交于 2019-11-26 22:13:56
问题 I have tons of instances where I need to implement some sort of Polymorphic Association in my database. I always waste tons of time thinking through all the options all over again. Here are the 3 I can think of. I'm hoping there is a best practice for SQL Server. Here is the multiple column approach Here is the no foreign key approach And here is the base table approach 回答1: The two most common approaches are Table Per Class (i.e. a table for the base class and another table for each subclass

Difference between 3NF and BCNF in simple terms (must be able to explain to an 8-year old)

最后都变了- 提交于 2019-11-26 19:15:00
I have read the quote : data depends on the key [1NF], the whole key [2NF] and nothing but the key [3NF] . However, I am having trouble understanding 3.5NF or BCNF as it's called. Here is what I understand : BCNF is stricter than 3NF left side of any FD in the table must be a superkey (or at least a candidate key) So why is it then, that some 3NF tables are not in BCNF? I mean, the 3NF quote explicitly says "nothing but the key" meaning that all attributes depend solely on the primary key. The primary key is, after all, a candidate key until it is chosen to be our primary key. If anything is

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

自古美人都是妖i 提交于 2019-11-26 18:42:06
问题 Background I'm a first year CS student and I work part time for my dad's small business. I don't have any experience in real world application development. I have written scripts in Python, some coursework in C, but nothing like this. My dad has a small training business and currently all classes are scheduled, recorded and followed up via an external web application. There is an export/"reports" feature but it is very generic and we need specific reports. We don't have access to the actual

Facebook database design?

梦想与她 提交于 2019-11-26 17:59:34
I have always wondered how Facebook designed the friend <-> user relation. I figure the user table is something like this: user_email PK user_id PK password I figure the table with user's data (sex, age etc connected via user email I would assume). How does it connect all the friends to this user? Something like this? user_id friend_id_1 friend_id_2 friend_id_3 friend_id_N Probably not. Because the number of users is unknown and will expand. Keep a friend table that holds the UserID and then the UserID of the friend (we will call it FriendID). Both columns would be foreign keys back to the

What is combining repeating sets of row information into new entities called when doing database normalization?

♀尐吖头ヾ 提交于 2019-11-26 14:50:10
问题 I'm a bit confused about a certain piece of database normalization and thought I'd ask StackOverflow: Imagine you have the following relations that relate products to colors. Notice that Product 1 and Product 2 both use the same set of colors (Blue and Green). Product_Color Color +-------------+-------------+ +-------------+-------------+ | Product* | Color* | | ColorId* | Name | +-------------+-------------+ +-------------+-------------+ | 1 | 1 | | 1 | Blue | | 1 | 2 | | 2 | Green | | 2 | 1

What to do with null values when modeling and normalizing?

自古美人都是妖i 提交于 2019-11-26 13:51:11
I'm new in SQL(still learning) and I have to create a database for a venue. A client book for a room for an event. The problem is that the clients don't always provide their name, their email, and their phone number. Most of the time it's either name and email or name and phone. It's rarely all 3 but it happens. I need to store each of these in their respective attribute (name, email, phone). But the way they give me their info, I have a lot of null values. What can I do with these nulls? I've been told that it's better to not have nulls. I also need to normalize my table after that. Any

Database Normalization

℡╲_俬逩灬. 提交于 2019-11-26 12:31:01
问题 I\'m new to database design and I have been reading quite a bit about normalization. If I had three tables: Accommodation, Train Stations and Airports. Would I have address columns in each table or an address table that is referenced by the other tables? Is there such a thing as over-normalization? Thanks 回答1: Database Normalization is all about constructing relations (tables) that maintain certain functional dependencies among the facts (columns) within the relation (table) and among the