Changes between Version 8 and Version 9 of UseCase3


Ignore:
Timestamp:
01/21/22 21:00:49 (2 years ago)
Author:
193026
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase3

    v8 v9  
    1717{{{#!sql
    1818select
    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
     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
    2528                                ) 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
     29        c.category_id,
     30        c.category_name,
     31        (
     32        select
     33                string_agg(a.address_city, '; ') as address_city
     34        from
     35                address a
     36        where
     37                a.business_id = b.business_id
    3238                                ) 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
     39from
     40        business b
     41join category c on
     42        b.category_id = c.category_id
     43order by
     44        b.business_name
    3745}}}
    3846