MySQL 데이터베이스에서 IF EXISTS 사용
이 튜토리얼에서는 MySQL에서 IF EXISTS 문을 탐색하는 것을 목표로 합니다. 그러나 시작하기 전에 작업할 더미 데이터 세트를 만듭니다. 여기에서 몇 개의 행과 함께 student_details 테이블을 만듭니다. -- create the table student_details CREATE TABLE student_details( stu_id int, stu_firstName varchar(255) DEFAULT NULL, stu_lastName varchar(255) DEFAULT NULL, primary key(stu_id) ); -- insert rows to the table student_details INSERT INTO student_details(stu_id,stu_firstName,stu_lastName) VALUES(1,"Preet","Sanghavi"), (2,"Rich","John"), (3,"Veron","Brow"), (4,"Geo","Jos"), (5,"Hash","Shah"), (6,"Sachin","Parker"), (7,"David","Miller"); 위의 쿼리는 학생의 이름과 성이 포함된 행과 함께 테이블을 생성합니다.