MySQL

    MySQL not equal(~가 아닌 것) , not like (~를 포함하지 않은 것) 데이터 가져오기.

    not equal( ~가 아닌 것 ) -- 출간 년도가 2017년도가 아닌 데이터를 가져오시오. select * from books where released_year != 2017; -- 작가의 author_lname이 'Harris'가 아닌 데이터에서, 책 제목과 페이지수를 가져오시오. select title,pages from books where author_lname != 'Harris'; not like ( ~를 포함하지 않은 것 ) -- 책 제목에 W가 포함되지 않은 책을 가져오시오. select * from books where title not like '%W%';

    MySQL - 값을 모두 더해주는 sum() , 값의 평균을 구해주는 avg()

    INSERT INTO books (title, author_fname, author_lname, released_year, stock_quantity, pages) VALUES ('The Namesake', 'Jhumpa', 'Lahiri', 2003, 32, 291), ('Norse Mythology', 'Neil', 'Gaiman',2016, 43, 304), ('American Gods', 'Neil', 'Gaiman', 2001, 12, 465), ('Interpreter of Maladies', 'Jhumpa', 'Lahiri', 1996, 97, 198), ('A Hologram for the King: A Novel', 'Dave', 'Eggers', 2012, 154, 352), ('The..

    MySQL - count() 데이터 개수 확인하기,group by 그룹화 하여 데이터를 처리하기

    INSERT INTO books (title, author_fname, author_lname, released_year, stock_quantity, pages) VALUES ('The Namesake', 'Jhumpa', 'Lahiri', 2003, 32, 291), ('Norse Mythology', 'Neil', 'Gaiman',2016, 43, 304), ('American Gods', 'Neil', 'Gaiman', 2001, 12, 465), ('Interpreter of Maladies', 'Jhumpa', 'Lahiri', 1996, 97, 198), ('A Hologram for the King: A Novel', 'Dave', 'Eggers', 2012, 154, 352), ('The..

    MySQL - 최대값 max() ,최소값 min() , sub query

    INSERT INTO books (title, author_fname, author_lname, released_year, stock_quantity, pages) VALUES ('The Namesake', 'Jhumpa', 'Lahiri', 2003, 32, 291), ('Norse Mythology', 'Neil', 'Gaiman',2016, 43, 304), ('American Gods', 'Neil', 'Gaiman', 2001, 12, 465), ('Interpreter of Maladies', 'Jhumpa', 'Lahiri', 1996, 97, 198), ('A Hologram for the King: A Novel', 'Dave', 'Eggers', 2012, 154, 352), ('The..