normalization

Database Normalization Vocabulary

There is lot or material on Database Normalization available on SC and the Web. However, I still seem to lack on very definite reasons on explaining normalization. For example, for a simple design such as a table Item with a Type field, it makes sense to have the Type as a separate table. The reason I forwarded for that was if in future...

Load data from denormalized file into a normalized table

I receive a denormalized text file that must be loaded into a normalized table. Denormalized table: CustomerID -- Category -- Category2 -- Category3 -- Category4 1 -- A -- B -- C -- D When this is normalized, it should look like: CustomerID -- Category 1 -- A 1 -- B 1 -- C 1 -- D What is the best way to write a T-SQL statement to ac...

How to normalize CodePage to Unicode Form C when diacritic preceds and accent not combining form

I would like to be able to say "Normalize this string by forcing diacritic accents into their combining form". Details: My code is being developed in C# but I don't believe the issue to be language specific. There are two problems with my data (1) the diacritic is preceding the base character in this data (it needs to follow the base ...

Normalize SQL table

Can we furthur Normalize this Sql Table Structue is Primary key is ID,Date,NAme,Type ID Date Name Type Value ----------------------------------------------------- 1 08/15/2010 Rating A+ 10 1 08/15/2010 Rating A- 10 1 08/15/2010 ...

Normalizing a database with "chained" entries

I'm new to database design, and I haven't found a definitive way to structure my vocabulary database. Irrelevant fields aside, the data I want to store is conceptually something like this: Word 1 Meaning 1 (1-n of these) Example 1 (0-n of these) Example 2 ... Meaning 2 ... Word 2 ... Now, a Word is identified by three attributes:...

How to design DB with parent-child relationships?

If I needed to represent, say, locations (e.g. countries, states/provinces/regions, cities, etc.) in a database, how would I do so in such a way that it would be easiest to query, scale the most, etc.? I plan to use this for an application that will allow users to select multiple locations and associate them to their profile. The soluti...

Normalization of an existing SQL database

I have a single-table database I inherited and migrated to SQL Server, and then I normalized it by creating, linking, and filling a whole bunch of lookup-type tables that represented items in the main table. I now want to replace those items in the original table with their foreign keys. Am I stuck writing a bunch of queries or UDF's a...

File.listFiles() mangles unicode names with JDK 6 (Unicode Normalization issues)

I'm struggling with a strange file name encoding issue when listing directory contents in Java 6 on both OS X and Linux: the File.listFiles() and related methods seem to return file names in a different encoding than the rest of the system. Note that it is not merely the display of these file names that is causing me problems. I'm mainl...

Extract Normal Form from XML

<Historic> -----<ReturnData Year="2010"> ----- -----<ReturnHistory> ----- -----<Return StoreDate="2010-07-31" Type="1"> ----- -----<EndDate>2010-01-31</EndDate> ----- -----<ReturnDetail TimePeriod="1"> ----- ----- -----<Value>2.83</Value> -...

Efficient Array Normalization of Approximate Values

I'm looking for the efficient way of replacing approximate values (ushort[100]) for their target values. There are two target values (ushort x, 2x), each value in the ushort[] approximates one of these two. ...

Is storing a comma separated list in a database column really that bad?

Imagine a web form with a set of checkboxes (any or all can be selected). I chose to save them in a comma separated list of values stored in one column of the database table. Now, I know that the correct solution would be to create a second table and properly normalize the database. One reason was laziness, my SQL knowledge is very limi...

how to determine if NSString is normalized in NFD

Hi, i need to determine if a given NSString is in NFD form. how do i do that ? Context : the file path i get from mac OS (in form of NSString) is in canonical decomposed form ( NFD ) .. this is true especially when the filesystem is HFSPlus. http://developer.apple.com/mac/library/technotes/tn/tn1150.html#CanonicalDecomposition i nee...

Are there existing python modules for dealing with / normalizing units of time represented as strings?

I am new to python and am doing an export and import to a new db. I have a column on my export (to be imported) of strings for units of time, "20 minutes" "1.5 hours" "2 1/2 hours", etc. I tried googling but couldn't really find any good phrases and kept coming up with information more related to datetime units rather than just units ...

unnecessary normalization

My friend and I are building a website and having a major disagreement. The core of the site is a database of comments about 'people.' Basically people can enter comment and they can enter the person the comment is about. Then viewers can search the database for words that are in the comment or parts of the person name. It is complete...

Converting Paper/PDF forms for web - Normalize, Partition or Wide-Table it?

We'll be converting a fairly long lease application form into a web application for submission via PHP in to a PostgreSQL database. I abide by the maxim "Normalize till it hurts, then denormalize till it works" (Attr:SQLMenace) but as I jump in I figured I'd tap the collective mind. Here is what the paper form currently looks like: ht...

Advice and tools to help normalize a database

I have 7 MySQL tables that contain partly overlapping and redundant data in approximately 17000 rows. All tables contain names and addresses of schools. Sometimes the same school is duplicated in a table with a slightly different name, and sometimes the same school appears in multiple tables, again, with small differences in its name or ...

Basic table structure question

I have Brand and Company. 1 Company can have 1 or more Brands. As an example, company has company_id, company_name. Similarly Brands has brand_id and brand_name. Now can i add the FK column company_id to brands also and the relationship is complete in 2 tables or do i need a 3rd table like Company_Brands which will have company_id, bran...

Database Design Foreign Keys

Two tables in my database are as follows: [Employee] Table: Id (Primary Key, Autoincrement) FirstName LastName Status [Status] Table: Status (Primary Key) Status is one of the following: "FullTime" "Contractor" "Terminated" How should [Employee].Status reference [Status].Status as foreign key? I see two ways of doing this: [E...

How important is database normalization in a very simple database?

I am making a very simple database (mysql) with essentially two types of data, always with a 1 to 1 relationship: Events Sponsor Time (Optional) Location (City, State) Venue (Optional) Details URL Sponsors Name URL Cities will be duplicated often, but is there really much value in having a cities table for such a simple databa...

Is it still normalized db schema? database

I have the following db-schema . FILE, GROUP and BLOCK represent the object structure of the XML file. FILE is the root. GROUP has FK to FILE. BLOCK has the one FK to GROUP and the another one FK to UNIT. UNIT groups "similar" BLOCKs from diffrent GROUPs in the context of FILE. The data base is currently in 3NF. Yet I would like ...