normalization

What would you do to avoid conflicting data in this database schema?

Hi, I'm working on a multi-user internet database-driven website with SQL Server 2008 / LinqToSQL / custom-made repositories as the DAL. I have run across a normalization problem which can lead to an inconsistent database state if exploited correctly and I am wondering how to deal with the problem. The problem: Several different compa...

Correct normalization of database with optional columns

I need to create a database table that stores parametric descriptions of physiological characteristics (e.g. systolic blood pressure, triglyceride concentrations, etc.) of a hypothetical cohort of patients. For example, supposing the user specifies a triangular distribution for SBP, then the minimum, maximum and mode (and distribution t...

How do I normalise this database design?

I am creating a rowing reporting and statistics system for a client where I have a structure at the moment similar to the following: ----------------------------------------------------------------------------- | ID | Team | Coaches | Rowers | Event | Position | Time | -------------------------------------------------...

Normalization in MYSQL

Could anybody help me to know what is normalization in mysql and in which case and how we need to use it.. Thanks in advance. ...

Database Design: Composite key vs one column primary 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...

Implementing Version Control of DB Objects

I will soon be beginning work on a project that (from the spec) reminds me a bit of StackOverflow. Basically, its a web app that has user-controlled content. One of the features that's got me going around in circles in my mind is the version control. Here on StackOverflow, each question and answer can have multiple revisions. This is pr...

Split table with duplicates into 2 normalized tables?

I have a table with some duplicate rows that I want to normalize into 2 tables. user | url | keyword -----|-----|-------- fred | foo | kw1 fred | bar | kw1 sam | blah| kw2 I'd like to start by normalizing this into two tables (user, and url_keyword). Is there a query I can run to normalize this, or do I need to loop through the tabl...

Normalised beyond my SQL knowledge?

I think I've normalised my database beyond my SQL knowledge. :) Here's a query I'm struggling with from my Snooker league web app. It calculates overall stats for high breaks for a team from all seasons. In the example team id 3. select max(break_score) maxBreak,avg(break_score) avgBreak, count(break_score) breaks from breaks join m...

How to model tags in the database?

I have an existing webapp and want to add a tag feature so that users can tag existing objects. The question is should I add a tag column to each object? or should I normalize it and use a tag table where each object will have a collection of tags? I am leaning towards the latter because it feels cleaner, easier to report on and easier t...

Oracle: Normalizing data during migration

I have a table with a lot of repeated data that I'd like to refactor as 3 tables. Current structure looks like: meeting_desc meeting_date topic_desc ... And the data in the current_table looks like: meeting1,2/3/2009,abc meeting1,2/3/2009,efg meeting1,2/3/2009,xyz meeting2,4/5/2009,aaa meeting2,4/5/2009,bbb I would like to create ...

Javascript character normalization

hi, im using Google Translate API, and if i try to translate Mc Donald's this is what i get as a result: Mc Donald's How can i translate ' to ' -- in Javascript -- and so on for any other numeric character reference? Thanks! ...

MySQL - Database Design Question - Valid Formal Norms

I have a 'customers' table. Each record contains a customer name, email, address, etc. I have an 'skus' table. Each record contains the name of an SKU. e.g. "Super Software Bundle". An SKU represents a purchaseable item at a single price point. The purchased item can include one or more products. e.g. The SKU record named "Super Softw...

Normalization or Alternative with MySQL

Hi, building a site using PHP and MySQL that needs to store a lot of properties about users (for example their DOB, height, weight etc) which is fairly simple (single table, lots of properties (almost all are required)). However, the system also needs to store other information, such as their spoken languages, instrumental abilities, et...

What is the resource impact from normalizing a database?

When taking a database from a relatively un-normalized form and normalizing it, what, if any, changes in resource utilization might one expect? For example, normalization often means more tables get created from fewer which means the database now has a higher number of tables, but many of them are quite small, allowing the often used on...

Would keeping an XML data inside sql table be an architectural misconception?

Hi, I've got an SQL table that I use to keep product data. Some products have other attached data to them (be it: books have number of pages, cover type; movies have their time-length; etc). I could use a separate table in SQL to keep those, keeping (name, value) pairs. I can also just keep an XML-packed data in a single field in a t...

Tool for transforming Excel files? (swapping columns, basic string manipulation etc)

I need to import tabular data into my database. The data is supplied via spreadsheets (mostly Excel files) from multiple parties. The format of each of these files is similar but not the same and various transformations will be necessary to massage the data into the final format suitable for import. Furthermore the input formats are like...

When two tables are very similar, when should they be combined?

I have events and photos, and then comments for both. Right now, I have two comments tables, one for comments related to the events, and another for photo comments. Schema is similar to this: CREATE TABLE EventComments ( CommentId int, EventId int, Comment NVarChar(250), DateSubmitted datetime ) CREATE TABLE PhotoComments ( C...

SQL Server - Database Design - Best Practices

We are developing an ASP.NET application and carrying out the database design too. Kindly let me know if you know any best reference document for SQL Server database design - best practices. ...

How can I present information from normalized data entities in my tableView cells?

I'm currently thinking about the modeling of data in an iPhone app. My first instinct is to try to normalize the data into entities. For example a Professor entity might look something ilke this: @interface Professor : NSManagedObject { } @property (nonatomic, retain) NSString * profID; @property (nonatomic, retain) NSString * firs...

query a table not in normal 3rd form

Hi I have a table which was designed by a lazy developer who did not created it in 3rd normal form. He saved the arrays in the table instead of using MM relation . And the application is running so I can not change the database schema. I need to query the table like this: SELECT * FROM myTable WHERE usergroup = 20 where usergroup fiel...