BEGIN; BEGIN create or replace view revenue5 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) from lineitem where l_shipdate >= '1994-02-01' and l_shipdate < date'1994-02-01' + interval '90 days' group by l_suppkey; CREATE VIEW select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue5 where s_suppkey = supplier_no and total_revenue = ( select max(total_revenue) from revenue5 ) order by s_suppkey; s_suppkey | s_name | s_address | s_phone | total_revenue -----------+---------------------------+------------------------------+-----------------+----------------- 8000 | Supplier#000008000 | zYtb gUcE,2oeUsUE5JSLBWeDwmX | 19-875-478-4736 | 2248395.3815861 (1 row) drop view revenue5; DROP VIEW COMMIT; COMMIT