중복제거 DISTINCT
1. 테이블 만들기 CREATE TABLE EMP (ID INTEGER PRIMARY KEY, POSITION TEXT, PARTY_NM TEXT, MANAGER_ID INTEGER, TEAM_NM TEXT, GRADE UNTEGER); 2. 값 넣기 INSERT INTO EMP VALUES (650, "DERI", "LEEJAEHOON", 1270, "MARKETING", 1); INSERT INTO EMP VALUES (540, "GWAJANG", "JANGSENGSU", 3221, "INSA", 2); INSERT INTO EMP VALUES (210, "CHAJANG", "MUNBOMI", 3914, "INSA",3); INSERT INTO EMP VALUES (347, "CHAJANG", "LE..
AND OR 쿼리 실습
CREATE TABLE exercise_logs (id INTEGER PRIMARY KEY AUTOINCREMENT, type TEXT, minutes INTEGER, calories INTEGER, heart_rate INTEGER); INSERT INTO exercise_logs(type, minutes, calories, heart_rate) VALUES ("biking", 30, 100, 110); INSERT INTO exercise_logs(type, minutes, calories, heart_rate) VALUES ("biking", 10, 30, 105); INSERT INTO exercise_logs(type, minutes, calories, heart_rate) VALUES ("da..
자전거 가게 DB 만들기 실습
CREATE TABLE SHOP (ID INTEGER PRIMARY KEY, TYPE TEXT, LEVEL TEXT, BRAND TEXT, NAME TEXT, QUANTITY INTEGER); INSERT INTO SHOP VALUES (1, "LOAD", "DURA", "GIANT", "ADVAN", 10); INSERT INTO SHOP VALUES (2, "LOAD", "105", "SCOTT", "POIL", 5); INSERT INTO SHOP VALUES (3, "MTB", "SRAM", "MERIDA", "XCL", 3); INSERT INTO SHOP VALUES (4, "LOAD", "105", "TRIGON", "R", 3); INSERT INTO SHOP VALUES (5, "LOAD..
집계함수 연습
집계 함수 테스트 CREATE TABLE pky902 (id INTERGER PRIMARY KEY, name TXT, quantity INTERGER, aisle INTERGER); INSERT INTO pky902 VALUES (1, "JDNY", 2, 1); INSERT INTO pky902 VALUES (2, "21C", 1, 3); INSERT INTO pky902 VALUES (3, "COSMOS", 1, 3); INSERT INTO pky902 VALUES (4, "JCCOPY", 4, 2); SELECT SUM(quantity) FROM pky902; SELECT aisle, SUM(quantity) FROM pky902 group by aisle; SELECT aisle, MAX(quant..