normalization

Repeating group or not

Is SName in the following table considered a repeating group? link text Each of the subject listed in the SName field is in a separate cell. As far as I know a repeating group is when a cell contains more than one value. Therefore I am not sure since the subjects are in separate cells. ...

Separate tables for just one field can be logical ?

If I have one table which has a City field and as expected this field will repeat itself so only separate it to another table can be ok for normalizing concepts? I mean separated table who has only one field can be meaningful and can help performance gaining? ...

Simple Database normalization question...

Hi all, I have a quick question regarding a database that I am designing and making sure it is normalized... I have a customer table, with a primary key of customerId. It has a StatusCode column that has a code which reflects the customers account status ie. 1 = Open, 2 = Closed, 3 = Suspended etc... Now I would like to have another f...

MySQL Normalization stored procedure performance

I've written a stored procedure in MySQL to take values currently in a table and to "Normalize" them. This means that for each value passed to the stored procedure, it checks whether the value is already in the table. If it is, then it stores the id of that row in a variable. If the value is not in the table, it stores the newly inserted...

How to normalize a database where different user groups have different kinds of profiles?

My application database has a Groups table that separates users into logical roles and defines access levels (admin, owner, salesperson, customer service, etc.) Groups has many Users. The Users table contains login details such as username and password. Now I wish to add user profiles to my database. The trouble I'm having (probably ...

Efficient way to update SQL 'relationship' table

Say I have three properly normalised tables. One of people, one of qualifications and one mapping people to qualifications: People: id | Name ---------- 1 | Alice 2 | Bob Degrees: id | Name --------- 1 | PhD 2 | MA People-to-degrees: person_id | degree_id --------------------- 1 | 2 # Alice has an MA 2 ...

Database design efficiency with 1 to many relationships limited 1 to 3

This is in mysql, but its a database design issue. If you have a one to many relationship, like a bank customer to bank-accounts, typically you would have the table that records the bank-account information have a foreign key that keeps track of the relationship between account and customer. Now this follows the 3rd normal form thing and...

Non-normalized association with legacy tables in Rails and ActiveRecord

I am building a Rails application accessing a legacy system. The data model contains Customers which can have one or more Subscriptions. A Subscription always belong to one and only one Customer. Though not needed, this association is represented through a join table "subscribes", which do not have an id column: Column | Type...

In a One to One relationship should i drop one of the table's id column?

I have the following 2 tables in MySQL: Customer(Id, Firstname, Lastname...) Bonus(Id, CustomerId, Value, ...) The relation is One-To-One, every customer has only one bonus.(the CustomerId is unique in the Bonus Table) Q: Should I drop the Id column of the Bonus table? (I want to know why or why not) ...

Query a Lookup Table in Excel or Access

I've got a mental block about what I'm sure is a common scenario: I have some data in a csv file that I need to do some very basic reporting from. The data is essentially a table with Resources as column headings and People as row headings, the rest of the table consists of Y/N flag, "Y" if the person has access to the resource, "N" if...

Is it bad to not use normalised tables in this database?

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 --------------------------------------------------------- ...

Normalizing uri part given base url, with PHP.

First of, I'm doing this for a web crawler (aka spider aka worm...) Given two strings (base url and relative url), I need to determine the absolute url. It is especially confusing when it comes to "SEO friendly" crap, such as: Base url: http://aaa.com/january/15/test Found url: /test.php?aaa How would I know that the above aren't fold...

How to store data to MySQL for array input

Hope my question is correct to the post. <form action="process.php?id=<?php echo intval($order['id']);?>" method="post"> <ul> <?php $sd = 'SELECT * FROM download WHERE pid IN ('.$order['pid'].') ORDER BY pid ASC'; // pid IN (3,4,5) $qd = $db->rq($sd); $no = 1; while($download = $db->fetch($qd)) { ?> <li> <?php echo $no...

Automating table normalization

I have a table with this structure (simplified): artID: 1 artName: TNT ArtBrand: ACME ... And I want to normalize it making a separate table for the brand (it will have additional data about every brand) So I want to end up with this article table: artID: 1 artName: TNT brandID: 1 ... brand table brandID: 1 brandName: ACME brandI...

How can I normalize/canonize a regular expression pattern?

Hi, I have a complex regular expression I've built with code. I want to normalize it to the simplest (canonical) form that will be an equivalent regular expression but without the extra brackets and so on. I want it to be normalized so I can understand if it's correct and find bugs in it. Here is an example for a regular expression I ...

Atomicity of field for part numbers

In our internal inventory application, we store three values (in separate fields) that become the printed "part number" in this format: PPP-NNNNN-VVVV (P = Prefix, N = Number, V = version). So for example, if you have a part 010-00001-01 you know it's version 1 of a part of type "010" (which let's say is a printed circuit board). So, i...

Drowning in a Sea of Nulls

An application I inherited tracks lab test results performed on material samples. Data is stored in a single table (tblSampleData) with a primary key of SampleID and 235 columns representing potential test results. The problem is that only a few tests are performed per sample, so each row contains over 200 nulls. Actually, there is a sec...

How can I make multi-language website?

Possible Duplicates: Create a webpage with Multilanguage in PHP PHP - how to translate a website into multiple languages? I want to make a site which will have 3 languages - e.g. English, Arabic and Italian; the content sure will be different from one language to another. Should I make different table for each language, e.g...

Normalization/Schema for classifying cross-browser bugs based on rendering engines and browser versions?

I'm trying to decide on a schema for storing cross-browser bugs across all the rendering engines. Here's what I had in mind: browser_engines table: id name version 1 gecko 1.5 2 gecko 1.7 3 gecko 1.8 4 gecko 1.9.0 5 gecko 1.9.1 browser_versions table: id name version engine_id 1 firefox 3.0 4 2 firefox...

Ideas about data normalization

I'm designing an app for work management. The work can be broken down in (technically) infinite levels using a WBS (Work Breakdown Structure). When defining the job/task numbers for each level, what is the best way to normalize the task/job reference data (i.e. Job Number)? For example, I have 5 Reference fields for Identifying tasks/j...