BEGIN; BEGIN create or replace view revenue1 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) from lineitem where l_shipdate >= '1994-08-01' and l_shipdate < date'1994-08-01' + interval '90 days' group by l_suppkey; CREATE VIEW select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue1 where s_suppkey = supplier_no and total_revenue = ( select max(total_revenue) from revenue1 ) order by s_suppkey; s_suppkey | s_name | s_address | s_phone | total_revenue -----------+---------------------------+--------------------------------+-----------------+------------------ 725815 | Supplier#000725815 | OFFRyjWb,13TXkT6cyZ5D4k4E2N7OG | 15-188-715-4868 | 2330915.99659336 (1 row) drop view revenue1; DROP VIEW COMMIT; COMMIT