SELECT * FROM users;
SELECT id, name, gender, mbti FROM users;
SELECT id, name, gender FROM users WHERE gender="male";
SELECT * FROM users WHERE birth_month=5;
SELECT id, name, gender FROM users
WHERE gender!="male" AND birth_month=5;
SELECT * FROM users WHERE birth_month < 7;
SELECT * FROM users
WHERE between 3 and 10;
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28';
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28'
AND gender="female";
SELECT * FROM users
WHERE name='김홍엽' ;
SELECT * FROM users
WHERE name LIKE '김%' ;
SELECT * FROM users
WHERE name LIKE '%김';
SELECT * FROM users
WHERE name LIKE "%김%";
SELECT count(id) FROM users
WHERE gender = "female" ;
SELECT sum(calories) AS '채소류 칼로리 총합'
FROM foods WHERE food_group = "채소류";
SELECT avg(fat_g) AS '과일류 지방의 평균'
FROM foods WHERE food_group = '과일류';
SELECT * FROM users
ORDER BY birth_month ASC;
SELECT * FROM users
ORDER BY birth_month DESC;
SELECT * FROM users
ORDER BY birth_month DESC
LIMIT 3;
SELECT * FROM users;
SELECT id, name, gender, mbti FROM users;
SELECT id, name, gender FROM users WHERE gender="male";
SELECT * FROM users WHERE birth_month=5;
SELECT id, name, gender FROM users
WHERE gender!="male" AND birth_month=5;
SELECT * FROM users WHERE birth_month < 7;
SELECT * FROM users
WHERE between 3 and 10;
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28';
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28'
AND gender="female";
SELECT * FROM users
WHERE name='김홍엽' ;
SELECT * FROM users
WHERE name LIKE '김%' ;
SELECT * FROM users
WHERE name LIKE '%김';
SELECT * FROM users
WHERE name LIKE "%김%";
SELECT count(id) FROM users
WHERE gender = "female" ;
SELECT sum(calories) AS '채소류 칼로리 총합'
FROM foods WHERE food_group = "채소류";
SELECT avg(fat_g) AS '과일류 지방의 평균'
FROM foods WHERE food_group = '과일류';
SELECT * FROM users
ORDER BY birth_month ASC;
SELECT * FROM users
ORDER BY birth_month DESC;
SELECT * FROM users
ORDER BY birth_month DESC
LIMIT 3;
SELECT * FROM users;
SELECT id, name, gender, mbti FROM users;
SELECT id, name, gender FROM users WHERE gender="male";
SELECT * FROM users WHERE birth_month=5;
SELECT id, name, gender FROM users
WHERE gender!="male" AND birth_month=5;
SELECT * FROM users WHERE birth_month < 7;
SELECT * FROM users
WHERE between 3 and 10;
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28';
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28'
AND gender="female";
SELECT * FROM users
WHERE name='김홍엽' ;
SELECT * FROM users
WHERE name LIKE '김%' ;
SELECT * FROM users
WHERE name LIKE '%김';
SELECT * FROM users
WHERE name LIKE "%김%";
SELECT count(id) FROM users
WHERE gender = "female" ;
SELECT sum(calories) AS '채소류 칼로리 총합'
FROM foods WHERE food_group = "채소류";
SELECT avg(fat_g) AS '과일류 지방의 평균'
FROM foods WHERE food_group = '과일류';
SELECT * FROM users
ORDER BY birth_month ASC;
SELECT * FROM users
ORDER BY birth_month DESC;
SELECT * FROM users
ORDER BY birth_month DESC
LIMIT 3;
SELECT * FROM users;
SELECT id, name, gender, mbti FROM users;
SELECT id, name, gender FROM users WHERE gender="male";
SELECT * FROM users WHERE birth_month=5;
SELECT id, name, gender FROM users
WHERE gender!="male" AND birth_month=5;
SELECT * FROM users WHERE birth_month < 7;
SELECT * FROM users
WHERE between 3 and 10;
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28';
SELECT * FROM users
WHERE employment_date between '2022-01-01' and '2022-02-28'
AND gender="female";
SELECT * FROM users
WHERE name='김홍엽' ;
SELECT * FROM users
WHERE name LIKE '김%' ;
SELECT * FROM users
WHERE name LIKE '%김';
SELECT * FROM users
WHERE name LIKE "%김%";
SELECT count(id) FROM users
WHERE gender = "female" ;
SELECT sum(calories) AS '채소류 칼로리 총합'
FROM foods WHERE food_group = "채소류";
SELECT avg(fat_g) AS '과일류 지방의 평균'
FROM foods WHERE food_group = '과일류';
SELECT * FROM users
ORDER BY birth_month ASC;
SELECT * FROM users
ORDER BY birth_month DESC;
SELECT * FROM users
ORDER BY birth_month DESC
LIMIT 3;
SELECT * FROM users;
SELECT id, name, gender, mbti FROM users;