Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Question related to e-r model and entity

Author  Topic 

g_p
Starting Member

48 Posts

Posted - 2007-11-27 : 14:23:34
Hello to everyone!

I would like to ask you sthg as far as the e-r model is concerned!
I haven't started of course to use SQL yet,cause i have to make the e-r model first.

I have a a question to make :

For example i have to keep data for a Personal Computer (PC)
So i have the entity : COMPUTER
COMPUTER has many characteristics/fields like the primary key which is going to be PC_ID and it's unique for every computer,NAME_OF_PC the name and also TYPE_OF_MOTHERBOARD, TYPE_OF_RAM, TYPE_OF_HARD_DISK etc.

I have to keep for the TYPE_OF_MOTHERBOARD the manufacturer, the motherboard's code etc.

Shall i make an entity for the motherboard or for the HARD_DISK or for the RAM?
Cause i want next to change these fields of every COMPUTER if it's n eeded!
e.g. i have the PC_ID = 12 and i want to change the hard disk cause it's not working!(shall i keep an entity of the hard disk or not?)

Can sm advise me what i shall do?

Thanks, in advance! :)

anonymous1
Posting Yak Master

185 Posts

Posted - 2007-11-27 : 14:54:35
if the data is populated by a user interface then you probably do want to create lookup tables for each piece of hardware. that allows you to constraint the data (no one can type 0GB) and a change just one record and via the FK constraint all the appropriate computer changes occur (Seegate -> Seagate). if the data is programmatically populated by an automated process you might want to trust the process until you can determine whether updates or constraints are needed.
Go to Top of Page

g_p
Starting Member

48 Posts

Posted - 2007-11-27 : 17:19:44
Thanks for replying :)

Well actually i have to make a database where i have to keep the equipment of my school.For example, my school buys 50 Computers and i have to keep information for them e.g. Computer 12, hard disk = 80
RAM = 2GB, DVD Rom, DVD RW,Operating System(Windows,Linux etc), etc.
I mean that i have to keep the characteristics of every computer.
If sthg doesn't function well in the computer(e.g. the RAM) we have to replace the "bad" part with a new one from the database.
Shall i create a table in order to keep all the RAMs we have in the laboratory?Is that right?

Also, you were saying about "FK" constraint, i know what a constraint is but what does FK mean?The data at the beginning is going to be populated by a user interface but when you say "if the data is programmatically populated by an automated process", how can we do that?how can data be populated by automation without the interference of the user?

Thanks :)
Go to Top of Page

anonymous1
Posting Yak Master

185 Posts

Posted - 2007-11-28 : 10:06:18
having separate tables per hardware type seems the way to go, so yes create a RAM_TYPE table and populate it will all the known RAM types. FK is an abbreviation for foreign key. there are a number of was to programmatically retrieve hardware information about a computer, WMI is the means I used in the past.
Go to Top of Page
   

- Advertisement -