clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2249185 fiddles created (32137 in the last week).

CREATE TABLE plant( plant_id INT AUTO_INCREMENT, taxon_name VARCHAR(25), common_name VARCHAR(25), general_description TEXT, image BINARY, cultivation_group_id INT, nutritional_info_id INT, disease_id INT, planting_req_id INT, growing_req_id INT, PRIMARY KEY (plant_id) ); CREATE TABLE harvesting_req( harvesting_req_id INT AUTO_INCREMENT, plant_id INT, number_of_harvests INT, descriptive_growing_season VARCHAR(25), min_length_of_growing_harvest FLOAT, max_length_of_growing_harvest FLOAT, harvest_start_date DATE, PRIMARY KEY(harvesting_req_id) ); ALTER TABLE harvesting_req ADD FOREIGN KEY(plant_id_fk) REFERENCES plant(plant_id) ON DELETE SET NULL;
 hidden batch(es)


INSERT INTO plant (taxon_name, common_name) VALUES ('Taraxacum', 'dandelion'); INSERT INTO harvesting_req (number_of_harvests, harvest_start_date, plant_id) VALUES (2, '2021-04-15', 1) , (3, '2021-07-01', 1);
 hidden batch(es)


SELECT * FROM plant; SELECT * FROM harvesting_req;
plant_id taxon_name common_name general_description image cultivation_group_id nutritional_info_id disease_id planting_req_id growing_req_id
1 Taraxacum dandelion
harvesting_req_id plant_id number_of_harvests descriptive_growing_season min_length_of_growing_harvest max_length_of_growing_harvest harvest_start_date
1 1 2 2021-04-15
2 1 3 2021-07-01
 hidden batch(es)


SELECT p.taxon_name , p.common_name , hr.* FROM plant p INNER JOIN harvesting_req hr ON p.plant_id = hr.plant_id;
taxon_name common_name harvesting_req_id plant_id number_of_harvests descriptive_growing_season min_length_of_growing_harvest max_length_of_growing_harvest harvest_start_date
Taraxacum dandelion 1 1 2 2021-04-15
Taraxacum dandelion 2 1 3 2021-07-01
 hidden batch(es)