work with more tables in MySQL

admin

Administrator
Staff member
Hi,

I have a lot of mess in mind regarding how to work with more than one table in MySQL.

I think that the problem is that I am thinking like if I was working with MS-Access.

I have made a "Driver" table and a "computer" table.

So in the "Computers" table I am storing computers models (so that I allow users only to select available models) and in the "Driver" table, I store the computer id (in the "Computer" table I have id and model fields) and some other infos like date, file name etc .

I am asking my self if it has sense to take an id for the "computer" table and to put it into the "driver" table.

Yes, because I want to show the computer name when I make the query and not the id of it...

I was working with id because, like in Access, if a model changes, I don't need to update all records on the "driver" table...

but with MySQL ? Which is the right way ?

I am a lot confused...

If I'm right with the way I take, which could be the SQL query to get out all the files for a model (checking "driver" table) and show the model number reading it from "computer" table ?

hope someone could tell me the right route...

Many thank to anybody who wants to explain this issue to me.

Fabio
 
Back
Top