I want to know how i can write a mysql query which checks how many record exists in other table ?
table 1 : names
id name
-- ----
4 john
5 mike
6 jenny
table 2 : cars
id name_id car
-- ------- ---
1 4 bmw
2 4 wv
3 6 honda
query = "SELECT * FROM names WHERE id = '4'" <- in that query i also want to check how many records there are in the cars table or if there is any ?