query

    SQL - Multiple Tables

    Join(테이블 결합) • JOIN will combine rows from different tables if the join condition is true. SELECT * FROM orders JOIN subscriptions ON orders.subscription_id = subscriptions.subscription_id WHERE subscriptions.description = 'Fashion Magazine'; Inner Join SELECT COUNT(*) FROM newspaper JOIN online ON newspaper.id = online.id; Left Join A left join will keep all rows from the first table, regardles..

    SQL - Aggregate Functions

    Calculations performed on multiple rows of a table are called aggregates. Count The fastest way to calculate how many rows are in a table is to use the COUNT() function. SELECT COUNT(*) FROM fake_apps WHERE price = 0; Sum SUM() is a function that takes the name of a column as an argument and returns the sum of all the values in that column. SELECT SUM(downloads) FROM fake_apps; Max / Min The MAX..