Changes between Version 9 and Version 10 of UseCase4


Ignore:
Timestamp:
01/21/22 20:33:23 (3 years ago)
Author:
193026
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase4

    v9 v10  
    1616
    1717{{{#!sql
    18 select 
    19         b.business_id,
    20         b.business_name,
    21         (
    22         select
    23                 avg(r.review_stars)
    24         from
    25                 review r
    26         where
    27                 r.business_id = b.business_id
    28 ) as business_avg_stars,
    29         c.category_name,
    30         a.address_city
    31 from
    32         business b
    33 join category c on
    34         b.category_id = c.category_id
    35 join address a on
    36         b.business_id = a.business_id
     18select
     19                                b.business_id,
     20                                b.business_name,
     21                                (
     22                                        select avg(r.review_stars)
     23                                        from review r
     24                                        where r.business_id = b.business_id
     25                                ) as business_avg_stars,
     26                                c.category_id,
     27                                c.category_name,
     28                                (
     29                                        select string_agg(a.address_city, '; ') as address_city
     30                                        from address a
     31                                        where a.business_id = b.business_id
     32                                ) as address_city
     33                        from business b
     34                        join category c on
     35                                b.category_id = c.category_id
     36                        order by b.business_name
    3737}}}
    3838