Ad
Code
Diff
  • select 
      city_name, 
      sum(confirmed_cases) confirmed_cases , 
      sum(recovered_cases) recovered_cases, 
      sum(death_cases) death_cases
    from cases
      join dati
      on dati.code = cases.dati_code
    group by city_name
    order by confirmed_cases desc;
    • -- Code Here
    • select
    • city_name,
    • sum(confirmed_cases) confirmed_cases ,
    • sum(recovered_cases) recovered_cases,
    • sum(death_cases) death_cases
    • from cases
    • join dati
    • on dati.code = cases.dati_code
    • group by city_name
    • order by confirmed_cases desc;
Code
Diff
  • select *
    from employees
    order by salary desc
    limit 10
    • -- Code Here
    • select *
    • from employees
    • order by salary desc
    • limit 10
Code
Diff
  • select *
    from transactions
    where customer is not null
    order by store asc, total_price asc
    • -- Code Here
    • select *
    • from transactions
    • where customer is not null
    • order by store asc, total_price asc
Code
Diff
  • select *
    from transactions
    order by total_price desc
    • -- Code Here
    • select *
    • from transactions
    • order by total_price desc
Code
Diff
  • SELECT *
    FROM transactions
    ORDER BY total_price ASC
    • -- Code Here
    • SELECT *
    • FROM transactions
    • ORDER BY total_price ASC
Code
Diff
  • select * from transactions
    where customer like 'S%r';
    • -- Code Here
    • select * from transactions
    • where customer like 'S%r';
Code
Diff
  • SELECT *
    FROM transactions
    WHERE customer IS NOT NULL
    • -- Code Here
    • SELECT *
    • FROM transactions
    • WHERE customer IS NOT NULL
Code
Diff
  • SELECT *
    FROM transactions
    WHERE store NOT IN ('BIE Store Jakarta','BIE Store Bandung')
    • -- Code Here
    • SELECT *
    • FROM transactions
    • WHERE store NOT IN ('BIE Store Jakarta','BIE Store Bandung')
Code
Diff
  • -- Code Here
    SELECT *
    FROM transactions
    WHERE store IN ('BIE Store Bandung','BIE Store Palembang','BIE Store Malang')
    • --- Code Here
    • -- Code Here
    • SELECT *
    • FROM transactions
    • WHERE store IN ('BIE Store Bandung','BIE Store Palembang','BIE Store Malang')
Code
Diff
  • select date, store, total_price
    from transactions
    where date between '2022-01-01' and '2022-01-03'
    
    • -- Code Here
    • select date, store, total_price
    • from transactions
    • where date between '2022-01-01' and '2022-01-03'
Code
Diff
  • -- Code Here
    select * from transactions where store = 'BIE Store Bandung' and total_price <= 100000;
    • --- Code Here
    • -- Code Here
    • select * from transactions where store = 'BIE Store Bandung' and total_price <= 100000;
Code
Diff
  • -- Code here
    select * from customers where kota='Tasikmalaya'
    • --- Code here
    • -- Code here
    • select * from customers where kota='Tasikmalaya'
Code
Diff
  • -- Code Here
    select name as nama, age as umur from customers
    • --- Code Here
    • -- Code Here
    • select name as nama, age as umur from customers
Code
Diff
  • -- Code Here
    select name, age from customers
    • --- Code Here
    • -- Code Here
    • select name, age from customers
Code
Diff
  • -- Code here
    select * from customers
    • -- Code here
    • select * from customers