The inventory_held_by_customer function
returns the customer_id of the customer who
has rented out the specified inventory item.
p_inventory_id: The ID of the inventory
item to be checked.
This function returns the customer_id of
the customer who is currently renting the item, or
NULL if the item is in stock.
mysql>SELECT inventory_held_by_customer(8);+-------------------------------+ | inventory_held_by_customer(8) | +-------------------------------+ | NULL | +-------------------------------+ 1 row in set (0.14 sec) mysql>SELECT inventory_held_by_customer(9);+-------------------------------+ | inventory_held_by_customer(9) | +-------------------------------+ | 366 | +-------------------------------+ 1 row in set (0.00 sec)
