MySQL 실습: insert 값(orders)
예제 참고 : https://yeo0616.tistory.com/117 총 700개 하기는 insert 값 ---- insert into orders (order_date, amount, customer_id) values ('2019/10/27', 284.81, 2); insert into orders (order_date, amount, customer_id) values ('2020/02/08', 564.85, 97); insert into orders (order_date, amount, customer_id) values ('2019/11/05', 615.05, 87); insert into orders (order_date, amount, customer_id) values ('2019/10/..
더보기
MySQL 실습: insert 값 (customers)
예제 참고: https://yeo0616.tistory.com/117 총 100개 데이터 insert 값 하기 참고 --- insert into customers (first_name, last_name, email) values ('Quintin', 'Whelpton', 'qwhelpton0@irs.gov'); insert into customers (first_name, last_name, email) values ('Netty', 'Ryhorovich', 'nryhorovich1@soundcloud.com'); insert into customers (first_name, last_name, email) values ('Yvette', 'Boys', 'yboys2@multiply.com'); ins..
더보기
[MySQL] ~인것 가져오기: where, and, or, between…and, in(), case when …then.. else… end
~인것 가져오기 : where, and, or, between…and, in(), case when …then.. else… end -- 오늘 가장 중요한 이야기. -- ~인것 가져오기 -- 연도가 2017인 데이터를 가져오시오 select * from books where released_year = 2017; select * from books where released_year = 2010; -- 년도가 2017년이 아닌 데이터만 가져오시오. select * from books where released_year != 2017; -- author_lname이 Harris가 아닌 데이터만 가져오시오. select * from books where author_lname != 'Harris'; sele..
더보기
[MySQL] 시간 계산: datediff(), date_add(), interval + 시간
desc people2; insert into people2 (name,birthdate, birthtime, birthdt) values ('Padma','1988-11-11','10:07:35','1988-11-11 10:07:35'), ('Larry','1994-04-22','04:10:42','1994-04-22 04:10:42'); select * from people2; select name, year(birthdate) from people2; 해당 컬럼의 년도를 보여줌 select name, month(birthdate) from people2; 해당 컬럼의 월를 보여줌 select name, day(birthdate) from people2; 해당 컬럼의 날짜를 보여줌 select nam..
더보기
[MySQL] 시간을 처리하는 방법:curdate(), curtime(), now()
- 관련 튜토리얼: https://www.tutorialspoint.com/mysql/mysql-date-time-functions.htm\ create a table desc people2; insert into people2 (name,birthdate, birthtime, birthdt) values ('Padma','1988-11-11','10:07:35','1988-11-11 10:07:35'), ('Larry','1994-04-22','04:10:42','1994-04-22 04:10:42'); select * from people2; 시간을 처리하는 방법:curdate(), curtime(), now() -- date, time, datetime -- date: YYYY-MM-DD -- ti..
더보기