Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER $$
- CREATE PROCEDURE sp_select_all_staff ()
- BEGIN
- SELECT first_name, last_name, staff_id
- FROM staff;
- END;
- $$
- DELIMITER ;
- CALL sp_select_all_staff ();
- **************************************
- DELIMITER $$
- CREATE PROCEDURE sp_staffOrdersServed()
- BEGIN
- SELECT staff_id,
- COUNT(order_id) as orders_served
- FROM customer_orders
- GROUP BY staff_id;
- END;
- $$
- DELIMITER ;
- CALL sp_staffOrdersServed();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement