 |
|
 |
|
Next: Database design question
|
| Author |
Message |
External

Since: Oct 02, 2008 Posts: 5
|
(Msg. 16) Posted: Thu Oct 02, 2008 8:51 pm
Post subject: Re: Simple database design question [Login to view extended thread Info.] Archived from groups: comp>databases>theory (more info?)
|
|
|
On Oct 3, 12:56 pm, xyzzy wrote:
> On Oct 2, 5:09 am, -CELKO- wrote:
>
>
>
> > I'd bet that you don't call the industry identifier a "sim_id" -- is
> > it a sim_nbr or something?? Ditto for a phone number; I think that is
> > 15 digits in the CITT standard. Learn to use the right names for
> > things, so you can have data interchange, a data dictionary, etc.
>
> > CREATE TABLE Sims
> > (sim_nbr CHAR(n) NOT NULL PRIMARY KEY,
> > ..);
>
> > CREATE TABLE Phones
> > (phone_nbr CHAR(15) NOT NULL PRIMARY KEY,
> > ..);
>
> > Put the sims in the phones ..
>
> > CREATE TABLE PhoneSimAssignments
> > (sim_nbr CHAR(n) NOT NULL UNIQUE -- industry standards?
> > REFERENCES Sims(sim_nbr)
> > ON DELETE CASCADE,
> > phone_nbr CHAR(15) NOT NULL UNIQUE
> > REFERENCES Phones(phone_nbr)
> > ON DELETE CASCADE,
> > ..);
>
> > Use a view to show the sims status of all phones
>
> > CREATE VIEW PhoneAssignments (..)
> > AS
> > SELECT sim_nbr, phone_nbr, ..
> > FROM Phones AS P
> > LEFT OUTER JOIN
> > PhoneAssignments AS A
> > ON A.phone_nbr = P.phone_nbr;
>
> This ticks all the boxes as far as I can see. The original
> requirement was for only 1 SIM associated with a phone.
> This requirement might not be correct -- even if he is selling phones
> with one SIM & phone per box.
> You can get phones that use more than one SIM, eg. Cect HT-508 dual
> SIM mobile phone.
>
> What if you can have 0, 1, or 2 SIMs associated with a phone?
S'pose you could add slot_number to PhoneAssignments and make it not
null, check slot_number in (1, 2). >> Stay informed about: Simple database design question |
|
| Back to top |
|
 |  |
External

Since: Sep 30, 2008 Posts: 7
|
(Msg. 17) Posted: Tue Oct 07, 2008 7:25 am
Post subject: Re: Simple database design question [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
xyzzy wrote:
> On Oct 2, 5:09 am, -CELKO- wrote:
>> I'd bet that you don't call the industry identifier a "sim_id" -- is
>> it a sim_nbr or something?? Ditto for a phone number; I think that is
>> 15 digits in the CITT standard. Learn to use the right names for
>> things, so you can have data interchange, a data dictionary, etc.
>>
>> CREATE TABLE Sims
>> (sim_nbr CHAR(n) NOT NULL PRIMARY KEY,
>> ..);
>>
>> CREATE TABLE Phones
>> (phone_nbr CHAR(15) NOT NULL PRIMARY KEY,
>> ..);
>>
>> Put the sims in the phones ..
>>
>> CREATE TABLE PhoneSimAssignments
>> (sim_nbr CHAR(n) NOT NULL UNIQUE -- industry standards?
>> REFERENCES Sims(sim_nbr)
>> ON DELETE CASCADE,
>> phone_nbr CHAR(15) NOT NULL UNIQUE
>> REFERENCES Phones(phone_nbr)
>> ON DELETE CASCADE,
>> ..);
>>
>> Use a view to show the sims status of all phones
>>
>> CREATE VIEW PhoneAssignments (..)
>> AS
>> SELECT sim_nbr, phone_nbr, ..
>> FROM Phones AS P
>> LEFT OUTER JOIN
>> PhoneAssignments AS A
>> ON A.phone_nbr = P.phone_nbr;
>
> This ticks all the boxes as far as I can see. The original
> requirement was for only 1 SIM associated with a phone.
> This requirement might not be correct -- even if he is selling phones
> with one SIM & phone per box.
> You can get phones that use more than one SIM, eg. Cect HT-508 dual
> SIM mobile phone.
>
> What if you can have 0, 1, or 2 SIMs associated with a phone?
That can never happen in the scenario I am dealing with. They are not
actually phones; they are devices that take sim cards, and those sim
cards are put inside the devices and screwed shut before being sent out.
Only engineers belonging to the company should have access to them,
and they'd only be changed upon failure. I just wanted to provide a
more familiar scenario in my original question.
Thanks for your ideas and insight everyone, you've been very helpful.
Mark.
-- >> Stay informed about: Simple database design question |
|
| Back to top |
|
 |  |
External

Since: Oct 31, 2008 Posts: 27
|
(Msg. 18) Posted: Fri Oct 31, 2008 1:21 pm
Post subject: Re: Simple database design question [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Oct 2, 9:56 pm, xyzzy wrote:
> On Oct 2, 5:09 am, -CELKO- wrote:
>
>
>
> > I'd bet that you don't call the industry identifier a "sim_id" -- is
> > it a sim_nbr or something?? Ditto for a phone number; I think that is
> > 15 digits in the CITT standard. Learn to use the right names for
> > things, so you can have data interchange, a data dictionary, etc.
>
> > CREATE TABLE Sims
> > (sim_nbr CHAR(n) NOT NULL PRIMARY KEY,
> > ..);
>
> > CREATE TABLE Phones
> > (phone_nbr CHAR(15) NOT NULL PRIMARY KEY,
> > ..);
>
> > Put the sims in the phones ..
>
> > CREATE TABLE PhoneSimAssignments
> > (sim_nbr CHAR(n) NOT NULL UNIQUE -- industry standards?
> > REFERENCES Sims(sim_nbr)
> > ON DELETE CASCADE,
> > phone_nbr CHAR(15) NOT NULL UNIQUE
> > REFERENCES Phones(phone_nbr)
> > ON DELETE CASCADE,
> > ..);
>
> > Use a view to show the sims status of all phones
>
> > CREATE VIEW PhoneAssignments (..)
> > AS
> > SELECT sim_nbr, phone_nbr, ..
> > FROM Phones AS P
> > LEFT OUTER JOIN
> > PhoneAssignments AS A
> > ON A.phone_nbr = P.phone_nbr;
>
> This ticks all the boxes as far as I can see. The original
> requirement was for only 1 SIM associated with a phone.
> This requirement might not be correct -- even if he is selling phones
> with one SIM & phone per box.
> You can get phones that use more than one SIM, eg. Cect HT-508 dual
> SIM mobile phone.
>
> What if you can have 0, 1, or 2 SIMs associated with a phone?
He's probably working for Apple. >> Stay informed about: Simple database design question |
|
| Back to top |
|
 |  |
| Related Topics: | Design question - Hi all, not sure this is right group. Hoping someone could give me so advice on my database design. What is the best way to join these tables Short version goes like this.... I have tables : Person or Employee, Dependent (person is fk in dep table) ....
Amazon's "Simple" Database - Just wondered if anyone had seen this: http://www.regdeveloper.co.uk/2007/12/17/amazon_simpledb/ While in principle a globally accessible database sounds like a great idea, closer reading yields... "Unlike MySQL, Oracle, DB2 or SQL Server, Simple...
relational db design question - Hello, I have a relational database design question that I cannot seem to solve in an aesthatically pleasingly way; I was hoping someone could help me with. I am trying to create a recipe database, in which I would like to associate each recipe with a..
Newbie question on table design. - Hi, I have a table T with -- let's say -- a million+ records. The application allows logical deletion of a small fraction of these records. (Un-deletion of deleted records is allowed if you have admin privs via a Priveleges table.) I can easily think...
design question - lots of columns.... - Wanted to get this groups opinion on my issue. I started a thread @ microsoft.public.sqlserver.server ......... Can you all take a look & offer any advice? .. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|