Doubt: 1 table per device or a single table? (1 Viewer)

Surka

IT dude
Local time
Today, 18:26
Joined
Aug 5, 2013
Messages
41
For a DB for device stock, e g: Telephone, Desktop, Laptop:
Is it better to have a table per type of device or one table for all devices with a Type column?

This is an example of what field would be needed:

Telephone: User, Serial
Desktop: User, Serial, Name (name of desktop)
Laptop: User, Serial, Name (name of laptop)

Thanks
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:26
Joined
Jan 20, 2009
Messages
12,851
One table.

BTW Don't call anything Name or Type because they are reserved words.
 

Surka

IT dude
Local time
Today, 18:26
Joined
Aug 5, 2013
Messages
41
Yes, that confirms what a friend told me: to have one table, and as much as forms needed.

Forms to Add, Modify, View, Delete.

Knowing that Desktops have one column more than others, does it still better to have them in the same table?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 22:26
Joined
Sep 12, 2006
Messages
15,641
still the same. you could have a "name" for the phone in the same way as the other devices. it's just that generally you won't bother.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:26
Joined
Feb 28, 2001
Messages
27,146
Whenever you have that situation, you have two choices.

1. The name column is just a text column and you do not care about duplicates.

2. The name column has to be unique for some purpose, in which case you generate a random number for the name column. OR, if you have an autonumber record, copy the record number to the name field but as text. That way, you could make a uniqueness constraint on the column if that was necessary for the other objects.
 

Users who are viewing this thread

Top Bottom