Having the following tables in the category and subcategory database:
CREATE TABLE categories (
id INT AUTO_INCREMENT PRIMARY KEY,
category_name VARCHAR(255) NOT NULL,
created DATETIME,
modified DATETIME
);
CREATE TABLE sub_categories (
id INT AUTO_INCREMENT PRIMARY KEY,
sub_category_name VARCHAR(255) NOT NULL,
category_id INT NOT NULL,
created DATETIME,
modified DATETIME,
FOREIGN KEY category_key (category_id) REFERENCES categories(id)
);
What would be the SQL to search the subcategories given the name of a category? Ex: Select all subcategories from the Food category by passing the category name.