mysql

Joining tables with ` `

Having some issues joining tables. I think my syntax is wrong due to having to call the column names with “ I think it should be an easy fix. When I call it gives me an error code 1052. Column ‘Brand.Name’ in field is ambiguous.
select a….

Filtering on a LEFT JOINED column

Is there a more efficient way to filter on a joined table as in the following example? Or is this a fine approach? This query returns the desired results, but I am an amateur at MySQL.
I have indexes on products.id, product_details.product…

SQL Database Table conception

I have an

employee table
customer table
credit table

In my design should I create a manytomany join in employee and customer or create an emplye_id and client_id column in the credit table?
knowing that the customer and employee table a…

MySQL meal plan for a week

I have a MySQL database shown on the picture MySQL tables
I want to create a week plan of meals (lunch&dinner) where each week there is at least 1 meal of specific type. For example:
Monday: Lunch – Meal with chicken meat and potatoes,…

INSERT new row IF NOT EXISTS

Table contents:
+—-+———+———–+
| id | title | author |
+—-+———+———–+
| 1 | book_1 | author_1 |
| 2 | book_2 | author_2 |
| 3 | book_3 | author_3 |
+—-+———+———–+

id – is UNIQUE and …