User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 402,025 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,415 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.

Novice Table Relation Question

Join Date: Jun 2007
Location: Los Angeles, CA
Posts: 30
Reputation: sibir1us is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
sibir1us's Avatar
sibir1us sibir1us is offline Offline
Light Poster

Re: Novice Table Relation Question

  #3  
Jun 26th, 2007
Well, think of it this way: there are several types of relations between objects - one to one, one to many, many to many. Imagine, lets say, i would like to represent a database model for your store. I will have a table "Clients" (with fields: ClientId[int, primary key], ClientName[varchar50], ClientEmail[varchar50]...etc ) and another table "Orders"(with fields: OrderId[int, primary key], ClientId[int, foreign key], OrderName[varchar50]... etc ). Now, here we come to the point why it is called "relational database": by creating different types of relations between tables you represent a highly cohesive model. This means that you create a certain record once, and from then on, this record is represented by an Id adn this way you save alot of space (the data type of integer is way smaller, compared to the repetition of the data). Here is one final example: in your model most likely you will have an "one-to-many" relationship between a client and an order, which means, that one client can have many orders, but one order cannot have to clients. There for, "Clients" table will be parent to "Orders", and they will have a relationship on "ClientId". Hope this helps. Feodor
Reply With Quote  
All times are GMT -4. The time now is 10:13 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC