Changes between Version 1 and Version 2 of ImportantUseCase4


Ignore:
Timestamp:
01/21/22 23:14:40 (3 years ago)
Author:
191151
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImportantUseCase4

    v1 v2  
    99[SLIKA]
    1010
    11 {{{
     11{{{#!sql
     12select u.email, u.username, u.full_name, u.created_at, u.type,
     13        a.*, at2.name as artist_type_name, u2.full_name as manager_full_name
     14        from users u
     15        inner join artists a
     16                on u.id = a.user_id
     17        inner join artist_types at2
     18                on a.artist_type_id = at2.id
     19        inner join managers m
     20                on a.manager_id = m.user_id
     21        inner join users u2
     22                on u2.id = m.user_id
     23        where u.username = 'artist';
    1224
     25select g.name as genre_name
     26        from users u
     27        inner join artists a
     28                on u.id = a.user_id
     29        inner join artist_sings_genres asg
     30                on a.user_id = asg.artist_id
     31        inner join genres g
     32                on g.id = asg.genre_id
     33        where u.username = 'artist';
     34
     35select ai.path as image_path
     36        from users u
     37        inner join artists a
     38                on u.id = a.user_id
     39        inner join artist_images ai
     40                on a.user_id = ai.artist_id
     41        where u.username = 'artist';
    1342}}}
    1443
     
    1746[SLIKA]
    1847
    19 {{{
     48{{{#!sql
     49select * from events e
     50        where e.organizer_id = (
     51                select u.id from users u
     52                where u.email = 'test_organizer_1@mail.com'
     53        );
    2054
     55
     56INSERT INTO project.events (title, slug, start_time, end_time, event_date, city, country, description,
     57                            event_type_id, organizer_id, created_at)
     58VALUES ('Igor''s Birthday', 'igors-birthday', '21:00:00', '23:30:00', '2022-09-15', 'Belgrade', 'Serbia',
     59        'It''s my birthday!', (select e.id from event_types e where e.name = 'Birthday'), (
     60                select u.id from users u
     61                where u.email = 'test_organizer_1@mail.com'
     62        ), NOW());
     63
     64INSERT INTO project.offers (slug,payment_type,status,created_at,artist_id,event_id)
     65        VALUES ('offer-igors-birthday-jkASHDhASD',1,1,now(),(select u.id from users u where u.email = 'test_artist@mail.com'), (select e.id from events e where e.slug = 'igors-birthday'));
    2166}}}
    2267
     
    2570[SLIKA]
    2671
    27 {{{
     72{{{#!sql
    2873
    2974}}}