BEGIN; BEGIN create or replace view revenue7 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) from lineitem where l_shipdate >= '1996-01-01' and l_shipdate < date'1996-01-01' + interval '90 days' group by l_suppkey; CREATE VIEW select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue7 where s_suppkey = supplier_no and total_revenue = ( select max(total_revenue) from revenue7 ) order by s_suppkey; s_suppkey | s_name | s_address | s_phone | total_revenue -----------+---------------------------+------------------------------------------+-----------------+------------------ 69998 | Supplier#000069998 | ,ZT4VX2ygq9dLsG298SbYYSVUqeH,jhLSRVxNxGv | 16-386-278-9829 | 2121481.29092889 (1 row) drop view revenue7; DROP VIEW COMMIT; COMMIT