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 423,335 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 5,217 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.
Please support our Database Design advertiser: Programming Forums
Views: 520 | Replies: 1
Reply
Join Date: Jun 2008
Posts: 1
Reputation: jose123 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jose123 jose123 is offline Offline
Newbie Poster

where to store numerical rating?

  #1  
Jun 30th, 2008
Lets say
I have 1 department which have 4 suppliers

supplies 4 different types of product (A,B,C,D)
my main objective is to capture rating( 20 types) of these different types of product in alphabet and also in numerical thru lookup table

I created following tables

Supplier( supplierid, supplier)
01 ABC
02 DEF....

Suppliertype( suppliertypeid, supplierid, typesof products)
01 01 A
02 01 B
03 01 C
04 01 D
05 02 A ........


I created thirdtable

Ratingtable(departmentid,suppliertype,rating)

Dept 01 AAA
Dept 02 AA
Dept 03 AAA



Am i on right track and beside that I also have to put numerical value for rating, where is the best place to add column for numerical rating?
Can i add rating and numerical value to suppliertype table and taking off rating from rating table?

There are 20 types of rating with numerical value ( in look up table)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 295
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 41
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: where to store numerical rating?

  #2  
Jun 30th, 2008
Hello

... "There are 20 types of rating with numerical value ( in look up table)"

How is rating related to numerical value(s) ? Something like this:

AAA 20.5
AA 5.5

or even like this:

AAA 20.5
AAA 30
AAA -1 etc ?

krs,
tesu

p.s.
I have got the feeling that there could be something wrong between Supplier( supplierid, supplier) and Suppliertype( suppliertypeid, supplierid, typesof products)

If you want to express that: One supplier supplies various types of products and on type of product is supplied by various suppliers there exists a many-to-many relationship between suppliers and producttypes. Therefore the "linking" table contains primary key from supplier table and primary key of table producttypes. Both primary keys form the primary key of your so called "Suppliertype" table. They must also be foreign keys in that table. Sure, there can be additional data in the linking table, sometimes even an third attribute can be part of its primary key. So the create-table statement for Suppliertype would look like:

create table Suppliertype(supplierID integer not null, producttypesID integer not null,
maybe_additional_data varchar(50), primary key (supplierID, producttypesID),
foreign key (supplierID) references suppliers,
foreign key (producttypesID) references producttypes);

btw, if you omit the word "types" in "...of these different types of product...", what then means that a supplier supplies various (real) products and a (real) product would be supplied by various supplier, the many-to-many relationship will turn a bit more meaningful:

create table ProductSupplier(supplierID integer not null, productID integer not null,
maybe_additional_data varchar(50), primary key (supplierID, productID),
foreign key (supplierID) references suppliers, foreign key (productID) references products);
Last edited by tesuji : Jun 30th, 2008 at 6:53 pm.
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Database Design Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Database Design Forum

All times are GMT -4. The time now is 11:37 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC