join 예제 3
외래 키 설정더보기-- customers table dataINSERT INTO customers (customer_name, email, address) VALUES('김철수', 'kimchulsoo@example.com', '서울시 강남구'),('이영희', 'leeyounghee@example.com', '서울시 마포구'),('박준혁', 'parkjunhyuk@example.com', '경기도 수원시'),('최수진', 'choisujin@example.com', '부산시 해운대구'),('정우진', 'jungwoojin@example.com', '대구시 수성구'),('한지수', 'hanjisu@example.com', '서울시 성동구'),('김지훈', 'kimjihun@example.com', '인천시..
2024. 12. 3.
Join 예제 2
더보기 INSERT INTO series (title, released_year, genre) VALUES('Archer', 2009, 'Animation'),('Arrested Development', 2003, 'Comedy'),("Bob's Burgers", 2011, 'Animation'),('Bojack Horseman', 2014, 'Animation'),("Breaking Bad", 2008, 'Drama'),('Curb Your Enthusiasm', 2000, 'Comedy'),("Fargo", 2014, 'Drama'),('Freaks and Geeks', 1999, 'Comedy'),('General Hospital', 1963, 'Drama'),('Halt and Catch Fire..
2024. 12. 3.
Join 예제
더보기INSERT INTO students (first_name) VALUES('Caleb'), ('Samantha'), ('Raj'), ('Carlos'), ('Lisa'); INSERT INTO papers (student_id, title, grade ) VALUES(1, 'My First Book Report', 60),(1, 'My Second Book Report', 75),(2, 'Russian Lit Through The Ages', 94),(2, 'De Montaigne and The Art of The Essay', 98),(4, 'Borges and Magical Realism', 89); -- grade로 정렬하세요-- first_name, title, gradeSELECT s.fi..
2024. 12. 2.
날짜 예제
더보기INSERT INTO orders (customer_name, product_name, order_date, delivery_date) VALUES('김철수', '노트북', '2023-10-01 14:30:00', '2023-10-05'),('이영희', '스마트폰', '2023-10-02 09:15:00', '2023-10-07'),('박준혁', '태블릿', '2023-10-03 16:45:00', '2023-10-09'),('최수진', '헤드폰', '2023-10-04 11:00:00', '2023-10-10'),('정우진', '키보드', '2023-10-05 18:20:00', '2023-10-12'),('윤지민', '스마트워치', '2023-10-06 10:30:00', '2023-10-10'..
2024. 12. 2.
키워드 예제 2
세팅더보기INSERT INTO subscriptions (user_name, plan_name, start_date, end_date, status, price) VALUES('김철수', 'Premium', '2023-01-01', '2023-12-31', 'Active', 12000),('박준혁', 'Standard', '2023-07-01', '2023-12-31', 'Active', 9000),('최수진', 'Premium', '2023-01-01', '2023-12-31', 'Active', 12000),('김지훈', 'Premium', '2023-04-01', '2023-12-31', 'Active', 12000),('장서현', 'Standard', '2023-06-01', '2023-12-31..
2024. 11. 29.
키워드 예제 1
세팅데이터베이스test6테이블books컬럼id - int, pri, not null, auto incrementtitle - varchar(100)author_fname - varchar(100)author_lname - varchar(100) released_year - intstock_quantity -intpages - int 더보기함수 예제 1과 동일 데이터에 아래 데이터만 추가되었습니다.insert into books(title, author_fname, author_lname, released_year, stock_quantity,pages)values('10% Happier', 'Dan', 'Harris', 2014, 29, 256),('fake_book', 'Freida', 'Harris'..
2024. 11. 28.
CRUD, 함수 예제 2
세팅 데이터베이스test6테이블subscriptions컬럼더보기INSERT INTO subscriptions (user_name, plan_name, start_date, end_date, status, price) VALUES('김철수', 'Premium', '2023-01-01', '2023-12-31', 'Active', 12000),('이영희', 'Basic', '2023-06-01', '2023-11-30', 'Expired', 6000),('박준혁', 'Standard', '2023-07-01', '2023-12-31', 'Active', 9000),('최수진', 'Premium', '2023-01-01', '2023-12-31', 'Active', 12000),('정우진', 'Basic', ..
2024. 11. 28.