I have a question about getting information from a MySQL database.
The context is as follows:
I have 2 tables, one called brand and the other model (about cars).
The brand table has 2 columns: id and name.
The table model has 3 columns: id, brand, name.
The brand column in the table model stores the corresponding brand id according the table brand.
For a consult, my standar query is:
SELECT * FROM model
… to get all the information in the table model, e.g.
id=1, brand=1, model=modelName.
What changes should I make to the query to get the brand name and not just its id, from a consult to the table model? e.g
id=1, brand=brandName, model=modelName
Try an inner join