> My question is: must I manually enter the value from the "people_id"
> (primary key of "people table") into the machine_id field of the
> "machines table"?  My only question here (unless you see others ;) is
> must I manually enter these "corresponding" numbers?

If I understand your question correctly, you're asking if users need to remember
the id that corresponds to the person to whom they are assigning a machine.
Well, that depends on how your data is entered.  Obviously, the correct data
must be entered if you'd like things to work, but the degree of difficulty
involved in that depends on how you interact with your database.

I think it's fair to say that most end-users don't work with data by typing out
SQL statements.  Data is usually entered and retrieved via a front end of sorts,
often through forms on a website or within an application.  In the case of your
people/machines example, a script can be written to display the names of people
based on their id.  When a user selects one of these names and goes to insert
data into the machines table, similar scripting ensures that the proper id is
used.

Again, sorry if it's a bad explanation.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "MySQL List" <[EMAIL PROTECTED]>
Sent: Friday, 30 May, 2003 00:28
Subject: establishing relationship


Someone here (Mike) has been quite kind and responded elaborately to me
off-list, thanks Mike!
I wanted to go ahead and put this "final" question here:

In my database that I'm working on I already have data --a 'one to
many' people to machines db.

I had made each table with a primary key field (people_id, machine_id),
each autoincrementing.  Now I see that the machines table needs no
primary key. (?)  In fact, it should have the same field but it cannot
be a primary as one person can have many machines.

My question is: must I manually enter the value from the "people_id"
(primary key of "people table") into the machine_id field of the
"machines table"?  My only question here (unless you see others ;) is
must I manually enter these "corresponding" numbers?
-----------
If you started to design "without data" so to speak, you would instruct
whomever that they need to enter the proper "persons_id" VALUE into the
corresponding machine_id, right?  Sorry to be redundant!
-----------
So aside from having a wonderful RDBMS --there must always be someone
entering any and all new data AND they must know how to keep those
IDs... right?

Thanks,
Ted


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to