SELECT p.name, p.price, COALESCE(s.size, 'Medium')
FROM product p
LEFT JOIN sizes s ON p.id = s.product
WHERE p.id = 1
If a product is not mentioned in sizes
table, it doesn't select that product?
id name price
1. cap 50
2. glove 75
id product size
1. 2 'small'
2. 2 'large'