Let's pretend I'm going to a store. All the books should be in the book_basket and all the ice cream in the ice_basket. And I have a buy_list with me in which I write down what I will definitely buy.
CREATE PROCEDURE goods(
item_name VARCHAR(30),
description VARCHAR(30))
BEGIN
#ToDo write correct IF...END IF;
#INSERT INTO book_basket(item, description) VALUES (item_name, description);
# INSERT INTO buy_list(item, description) VALUES (item_name, description);
#INSERT INTO ice_basket(item, description) VALUES (item_name, description);
# INSERT INTO buy_list(item, description) VALUES (item_name, description);
#INSERT INTO other_basket(item, description) VALUES (item_name, description);
END;
By the end of my walk, the book_basket should contain all the books and the ice_basket should contain all the ice creams I picked up. And in the buy_list table there should only be "The Hobbit" and vanilla ice cream. Everything else should be in the other_basket
CALL goods('book', 'Tom Sawyer');
CALL goods('glasses', 'Polaroid');
CALL goods('umbrella', 'Rainbow');
CALL goods('ice cream', 'caramel');
CALL goods('ice cream', 'banana');
CALL goods('book', 'Sherlock Holmes');
CALL goods('ice cream', 'vanilla');
CALL goods('book', 'Don Quixote');
CALL goods('newspaper', 'Times');
CALL goods('book', 'The Hobbit');