Re: Three tables or one?
Posted by: James Gordon
Date: March 26, 2007 04:40AM

table devicetypes
~~~~~~~~~~~~~~~~~
typeid primary key
typename

Values
~~~~~~
1, "Phone"
2, "SatNav"

table parameters
~~~~~~~~~~~~~~~~
paramid primary key
paramname

Values
~~~~~~
1, "GPRS"
2, "802.11g"
3, "HSPDA"

table devices
~~~~~~~~~~~~~
deviceid primary key
typeid references devicetypes (typeid)

Values
~~~~~~
1, 1 -- Phone
2, 2 -- SatNav
3, 1 -- Phone
4, 1 -- Phone

table device_parameters
~~~~~~~~~~~~~~~~~~~~~~~
devpramid primary key
deviceid references devices (deviceid)
paramid references parameters (paramid)
value

Values
~~~~~~
1, 1, 1, "11GHz" -- Phone, GPRS
2, 3, 2, "Channel 6" -- Phone, 802.11g
3, 2, 3, "Unknown" -- SatNav, HSPDA

So basically you have a look up table for device types and valid parameter names.

You then create a device of a particular type.

The last table is a list of all of the parameters that you have set for a particular device.

You can create views to link the tables together and get the device type and it's parameters etc.

HTH.

James.

Options: ReplyQuote


Subject
Written By
Posted
March 13, 2007 03:55PM
March 14, 2007 03:01AM
March 14, 2007 09:20AM
March 14, 2007 09:29AM
March 16, 2007 08:07AM
March 25, 2007 03:38PM
Re: Three tables or one?
March 26, 2007 04:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.