File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ CREATE OR REPLACE TABLE ingredient_translation (
8787) ENGINE = InnoDB;
8888
8989CREATE TABLE recipe_status (
90- id TINYINT AUTO_INCREMENT PRIMARY KEY ,
90+ status_id TINYINT AUTO_INCREMENT PRIMARY KEY ,
9191 status_name VARCHAR (25 ) UNIQUE NOT NULL
9292) ENGINE = InnoDB;
9393
Original file line number Diff line number Diff line change 1+ -- Use the database
2+ USE smartcooking;
3+
4+ DELIMITER //
5+
6+ CREATE OR REPLACE PROCEDURE get_recipe_status(
7+ IN p_status_id INT
8+ )
9+ BEGIN
10+ SELECT status_name
11+ FROM recipe_status
12+ WHERE status_id = p_status_id;
13+ END //
14+
15+ CREATE OR REPLACE PROCEDURE get_recipe_status_by_name(
16+ IN p_status_name VARCHAR (25 )
17+ )
18+ BEGIN
19+ SELECT status_id
20+ FROM recipe_status
21+ WHERE status_name = p_status_name;
22+ END //
23+
24+ DELIMITER ;
You can’t perform that action at this time.
0 commit comments