problem about normalization-Collection of common programming errors


  • 10 revsSam
    mysql database-design primary-key normalization composite-key
    A web application I am working on has encountered an unexpected ‘bug’ – The database of the app has two tables (among many others) called ‘States’ and ‘Cities’.’States’ table fields:——————————————- idStates | State | Lat | Long ——————————————-‘idStates’ is an auto-incrementing primary key.’Cities’ table fields:———————————————————- idAreaCode | idStates | City | Lat | Long —

  • Justin Grant
    sql sql-server sql-server-2008-r2 normalization database-normalization
    Our application (using a SQL Server 2008 R2 back-end) stores data about remote hardware devices reporting back to our servers over the Internet. There are a few “families” of information we have about each device, each stored by a different server application into a shared database:static configuration information stored by users using our web app. e.g. Physical Location, Friendly Name, etc. logged information about device behavior, e.g. last reporting time, date the device first came online, w

  • Makoto
    unicode normalization cjk
    I’m writing some Java code that deals with Chinese characters, and I got some unexpected results — strings that should be equal were not. Here is one of the offending characters, which means “six” (pinyin: liù): ?. This character can be represented with either of two code points: F9D1 in the block: CJK Compatibility Ideographs 516D in the block: CJK Unified Ideographs Wikipedia has a page about these character ranges, and the short section on compatibility ideographs does mention some duplic

  • Derek Downey
    mysql performance join normalization
    For the first time, I am running up against a horrifically long execution time of a MySQL query (~5 minutes). The data in the database is highly (and not arbitrarily) normalized. It very efficient at organizing and shuffling data to be displayed in a lot of very helpful ways for different purposes, except this one particular query is throwing a wrench into it. I can’t understand the reason for it. However, some background information that may shed some light onto otherwise arbitrarily convoluted

  • DigitalTrifecta
    sql mysql normalization denormalization multiple-tables
    I have a web application that I am currently working on that uses a MySQL database for the back-end, and I need to know what is better for my situation before I continue any further.Simply put, in this application users will be able to construct their own forms with any number fields (they decide) and right now I have it all stored in a couple tables linked by foreign keys. A friend of mine suggests that to keep things “easy/fast” that I should convert each user’s form to a flat table so that qu

  • Kenaniah
    database-design normalization
    Exactly how far do you normalize the example below, and exactly which level of normalization does this example meet?CREATE TABLE “public”.”contact_info” (“id” SERIAL, “home_phone” TEXT, “mobile_phone” TEXT, “work_phone” TEXT, “fax_phone” TEXT, “email” TEXT, “line1” TEXT, “line2” TEXT, “city” TEXT, “state_id” INTEGER, “zipcode” TEXT, “preferred_type” TEXT, “first_name” TEXT, “last_name” TEXT,CONSTRAINT “contact_info_pkey” PRIMARY KEY(“id”), CONSTRAINT “contact_info_fk_state_id” FOREIGN KEY (“stat

  • dezso
    sql-server normalization log
    How can I normalize a table that has four columns for logging the latest activity for a single record:Created On Created By Modified On Modified ByWe have dozens of tables, all with these 4 columns. Is there a way or pattern to normalize this in an efficient and flexible manner?

  • R Brooks
    sql database theory normalization
    I recently learned about normalisation in my informatics class and I’m developing a multiplayer game using SQLite as backend database at the moment.Some information on it:The simplified structure looks a bit like the following:player_id | level | exp | money | inventory ———————————————————1 | 3 | 120 | 400 | {item a; item b; item c}Okay. As you can see, I’m storing a table/array in string form in the column “inventory”. This is against normali

  • Jon Raynor
    database-design database-development schema normalization
    Currently I am working on creating a new database schema as part of a major new product. Our previous customer address records (in a previous product) look something like this in our current schema (not all columns shown):AddressID, AddressLine1, AddressLine2, City, State. Zip, Country, Etc.I want to normalize this so that an address actually breaks down to:1 address to many address lines 1 address to a zip/postal codeSo, I sent out a communication saying that zip code will now be in its own

  • Andrew Thompson
    java url normalization
    I want to resolve some urls. For that, I take the result of :new URL(new URL(baseurl), link);This method seems to fail when baseurl=”http://www.site.com” and link=”./”You will have the following result http://www.site.com/./ instead of just http://www.site.com/How can I solve the problem?

  • Slick23
    ruby-on-rails-3 activerecord normalization
    I’m trying to group a series of records in Active Record so I can do some calculations to normalize that quantity attribute of each record for example:A user enters a date and a quantity. Dates are not unique, so I may have 10 – 20 quantities for each date. I need to work with only the totals for each day, not every individual record. Because then, after determining the highest and lowest value, I convert each one by basically dividing by n which is usually 10.This is what I’m doing right now:de

  • Jacka
    matlab normalization norm
    I have a following problem – I have a matrix A of size 16×22440.What I need to do is to normalize each row of this matrix, so that the norm of each of them is equal to 1 (for n=1:16 norm(A(n,:))==1)How can I achieve that in matlab? Edit: Each row in this matrix is a vector created of an 160×140 image and thus must be considered separately. The values need to be normalised to create an eigenfaces matrix.

  • Schneider
    java apache normalization relative-path absolute-path
    I’m using a the normalize function to get the absolute path from a String,org.apache.commons.io.FilenameUtils.normalize(String)But when I use just normalize(String) I get :The method normalize(String) is undefined for the type MyClassI tried : import org.apache.commons.io.FilenameUtils;I downloaded the library from Apache website, and linked it to my project but I get the same error.I don’t want to write everytime the whole line to call the function.Is there any solution for this ?Thanks

  • CyanPrime
    java math vector normalization
    Okay, so say I got a rectangle (This is all 2d) made from Thing A’s x,y,width and height. How would I calculate it’s normal?

  • 41 revs, 3 users 100%andrew
    php mysql database-design normalization
    This question is a follow on from this QuestionThe project and problemThe project I am currently working on is a bulletin board for a large non-profit organisation. The bulletin board will be used to allow inter-office communication within the organisation.I am building the application and have been having trouble extracting the results that I need from my database because I don’t think it is properly normalized and because of limitations in my knowledge of relational database theory and mysql.

  • WW.
    oop theory normalization relational-database solid-principles
    In the database world, we have normalisation. You can start with a design, crank the steps and end up with a normal form of the database. This is done on the basis of the symantics of the data and can be throught of as a series of design refactorings.In object orientated design, we have the SOLID principals and various other adhoc guidelines towards good design.Do you think it is possible to define the equivalent of normal forms for OO, such that a series of refactoring steps could move a proc

Web site is in building