normalization

Normalization of database for timesheet tool and ensure data integrity

I'm creating a timesheet application. I have the following entities (amongst others): Company Employee = an employee associated with a company Client = a client associated with a company So far I have the following (abbreviated) database setup: Company - id - name Employee - id - companyId (FK to Company.id) - name Clie...

What kind of normalization rule does this violate?

Suppose I have two tables on a database, and they have 10 columns one and 11 columns the other, where 10 of the columns are exactly the same on both. What (if any) normalization rule am I violating? ...

Database normalization - how deep should I link tables together?

I have three tables: Post, Attachment, and Media. Posts have Attachments, and Attachments have Media. Currently, the Post and Attachment tables are linked by foreign keys, and so are the Attachment and Media tables. My question is, for the sake of proper database design and normalization, should I setup a foreign key relationship bet...

Table Design For SystemSettings, Best Model

Someone suggested moving a table full of settings, where each column is a setting name(or type) and the rows are the customers & their respective settings for each setting. ID | IsAdmin | ImagePath ------------------------------ 12 | 1          | \path\to\images 34 | 0          | \path\to\images The downside to this is every time we wa...

Temporary users table or legitimate users table?

I have a freelance web application that lets users register for events. In my database, I have a t_events_applicants table with the column t_events_applications.user_id with a foreign key constraint linked to the t_users.user_id column. So this means only users who have registered with my web application can register for my web applica...

Advice needed on best and most efficient practices with developing google apps application...

Hi guys , I'm getting my feet wet with developing my order management applications for integration with google apps. However there are certain aspects I need to take into consideration prior to proceeding any further. My application is such that it would upload documents to google documents and store contacts in google contacts. It requ...

mySQL Efficiency Issue - How to find the right balance of normalization...?

I'm fairly new to working with relational databases, but have read a few books and know the basics of good design. I'm facing a design decision, and I'm not sure how to continue. Here's a very over simplified version of what I'm building: People can rate photos 1-5, and I need to display the average votes on the picture while keeping tr...

How do you normalize one-to-one-or-the-other relationships?

I'm storing data on baseball statistics and would like to do so with three tables: players, battingStats, and pitchingStats. For the purpose of the question, each player will have batting stats or pitching stats, but not both. How would I normalize such a relationship in 3NF? ...

Translating functional dependencies into 3rd normal form

I have this problem decomposing a relation schema into a set of schemas that are in 3NF. I have this relation schema: R= (A, B, C, D, E, F) With the following set F of functional dependencies: A → ABCDEF B → C D → E Can anyone help me out? ...

Advice Needed To Normalise Database

hey all, im trying to create a database for a feedback application in ASP.net i have the following database design. Username (PK) QuestionNo (PK) QuestionText FeedbackNo (PK) Username UserFeedbackNo (PK) FeedbackNo (FK) QuestionNo (FK) Answer Comment a user has a unique username a user can have multiple feedbacks i was wondering...

Should I include user_id in multiple tables?

I'm at the planning stages of a multi-user application where each user will only have access their own data. There'll be a few tables that relate to each other, so I could use JOINs to ensure they're accessing only their data, but should I include user_id in each table? Would this be faster? It would certainly make some of the queries ea...

Hmm, why finding by '2' or '2' return the same record?

Hi everyone, forgive my newbie question, but why finding by '2' or '2' in Mysql returns the same record? For example: Say I have a record with string field named 'slug', and the value is '2'. And the following SQLs returns same record. SELECT * From articles WHERE slug='2' SELECT * From articles WHERE slug='2' ...

c++ opengl: how to find normalized vectors for a quad ?

Hiya. can anyone assist me in finding the proper formula for quad normalization ? using c++ with opengl. thank you! ...

How to Set Customer Table with Multiple Phone Numbers? - Relational Database Design

CREATE TABLE Phone ( phoneID - PK . . . ); CREATE TABLE PhoneDetail ( phoneDetailID - PK phoneID - FK points to Phone phoneTypeID ... phoneNumber ... . . . ); CREATE TABLE Customer ( customerID - PK firstName phoneID - Unique FK points to Phone . . . ); A customer can have multiple phone numbers e.g. Cell, Work, etc. phoneID in Custo...

How to Auto-Increment Non-Primary Key? - SQL Server

CREATE TABLE SupplierQuote ( supplierQuoteID int identity (3504,2) CONSTRAINT supquoteid_pk PRIMARY KEY, PONumber int identity (9553,20) NOT NULL . . . CONSTRAINT ponumber_uq UNIQUE(PONumber) ); The above ddl produces an error: Msg 2744, Level 16, State 2, Line 1 Multiple identity columns specified for table 'SupplierQuote'. On...

mysql database normalization question

here is my 3 tables: table 1 -- stores user information and it has unique data table 2 -- stores place category such as, toronto, ny, london, etc hence this is is also unique table 3 -- has duplicate information. it stores all the places a user have been. the 3 tables are linked or joined by these ids: table 1 has an "table1_id" ta...

mySQL and general database normalization question

I have question about normalization. Suppose I have an applications dealing with songs. First I thought about doing like this: Songs Table: id | song_title | album_id | publisher_id | artist_id Albums Table: id | album_title | etc... Publishers Table: id | publisher_name | etc... Artists Tale: id | artist_name | etc... Then as I t...

Are these tables respect the 3NF Database Normalization?

AUTHOR table Author_ID, PK First_Name Last_Name TITLES table TITLE_ID, PK NAME Author_ID, FK DOMAIN table DOMAIN_ID, PK NAME TITLE_ID, FK READERS table READER_ID, PK First_Name Last_Name ADDRESS CITY_ID, FK PHONE CITY table CITY_ID, PK NAME BORROWING table BORROWING_ID,pk READER_ID, fk TITLE_ID, fk DATE HISTORY ta...

What stage of normalization is this? (moving repeating data into separate table)

Hi There, I have noticed that when designing a database I tend to shift any repeating sets of data into a separate table. For example, say I had a table of people, with each person living in a state. I would then move these repeating states into a separate table and reference them with foreign keys. However, what if I was not storing a...

Normalizing data in rails

I created a rails model by doing script/generate model Customer name:string address:string city:string state:string zip:integer [...] I filled the database with 5000 customers and started building my app. Now I've realized my model isn't normalized: I often have multiple customers at the same address! If I wish to do something per-add...