Premium problem134. Join Three Tables

Medium Locked

orders has order_id, customer_id, product_id and quantity. customers has customer_id and customer_name. products has product_id, product_name and unit_price.

Return a DataFrame with columns order_id, customer_name, product_name, quantity and revenue (quantity times unit price), keeping only orders whose customer and product are both known. Sort by order_id and renumber the index from 0.

Input

orders =
   order_id  customer_id  product_id  quantity
0         1            1          10         2
1         2            2          11         1
2         3            9          10         5
customers =
   customer_id customer_name
0            1           Ann
1            2            Bo
products =
   product_id product_name  unit_price
0          10          Pen         1.5
1          11          Pad         3.0

Output

   order_id customer_name product_name  quantity  revenue
0         1           Ann          Pen         2      3.0
1         2            Bo          Pad         1      3.0

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)