I have a business problem in which
there are m/c (machine) operators.
each machine operator can operate only certain number of machines.
There are about 18-20 different m/c's.
some operators can operate all machines.
How do i put it into a db?
i came across 2 solutions
1. create a table for each operator and list the m/c's they can operate
2. create a table with the 1st column as the m/c number and one column for each operator. which will act like a 2d table.
Is ther also a way to create or alter a table within a stored procedure? (Using MySql)
Ok, maybe you picked a really poor example (one that is frequently used as a final project in elementary database design classes), and picked a poor time (right at the end of the school quarter), and a poor way to present your question (it just has the sound of an assignment to me).
What creates the logical link between the operator and the machine? Asking the same question another way: what determines which operator can use what machine?
Are there certifications involved, and does a certificate automatically imply that the operator can use the machine, or does a certificate just make the operator eligable? Are there time periods involved (for example, does the link ever expire)? Do you have "classes" of machines, where one operator gets logically "blessed" for many machines with a single "grant" of permission?
One of the things that lead me to assume an assignment was the lack of this kind of detail... These are natural thoughts and considerations for most people trying to solve a real world problem.
Oh yeah, your MySQL question about creating tables... What version of MySQL are you using?
Coach me a bit, we may be able to get somewhere yet.