*매우중요 MYSQL 문제풀이 - 테이블생성 (기본문법 보완필요) ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ri ght syntax to use near '“employed”,
# 문제 Define an Employees table, with the following fields id - number(automatically increments), mandatory, primary key last_name - text, mandatory first_name - text, mandatory middle_name - text, not mandatory age - number mandatory current_status - text, mandatory, defaults to 'employed' # 내 답안 CREATE TABLE employees ( id INT NOT NULL AUTO_INCREMENT, last_name VARCHAR(30) NOT NULL, first_name ..
2022. 9. 22.
MYSQL 다중 INSERT, 에러 경고문 출력, 기본출력값 설정(default)
# 다중 INSERT # 기본 구조 INSERT INTO 테이블이름 (컬럼이름1, 컬럼이름2…) VALUES (value1, value2) # 기본구조에서 생략이 가능한것은 컬럼이름1, 컬럼이름2다. # 응용코드 INSERT INTO cats(name, age) -> VALUES ('Peanut',2), -> ('Butter', 4), -> ('Jelly', 7); # 에러에 대한 경고문 출력 설정된 테이블규격에 안맞는 값을 입력하면 완전 에러가 나는경우가 있고 성공했다는 쿼리 ok는 뜨는데 입력이 안되는 경우가 있다. 이럴때 확인해주는 것이 SHOW WARNINGS; # 기본출력값 설정 만약 입력하지 않은 값이 있거나, CHECK로 조건을 설정해 두었을때 여기에 해당하지 않는 값이 있다면 경우에 따라서..
2022. 9. 22.