
## 오류1
12:05:41 Insert Into person (Person_Name, Birthday, Address, Rented_Book_Id) VALUES ("yuna", 19890620, "경기도 부천시", "ISBN12090") Error Code: 1366. Incorrect integer value: 'ISBN12090' for column 'Rented_Book_Id' at row 1 0.000 sec
## Rendted_Book_Id 컬럼의 데이터 타입을 바꾸자
ALTER TABLE [테이블 이름] MODIFY [컬럼명] [바꾸고자 하는 데이터타입];
ALTER TABLE person modify Rented_Book_Id varchar(45);
======================================================
## 오류2
12:19:02 Insert INTO person (Person_Name, Gender, Birthday, Address, Rented_Book_id) VALUES ("yuna", "Female", 19890620, "경기도 부천시", "ISBN123123") Error Code: 1364. Field 'Person_Id' doesn't have a default value 0.000 sec
>> primary key에 auto_increment가 있는줄 알았는데 아니었댜..
>> auto_increment를 넣어주쟈
>> 우선 PrimaryKey를 drop해줘야 한다.
ALTER TABLE person DROP Person_Id;
ALTER TABLE person add Person_Id int NOT NULL AUTO_INCREMENT PRIMARY KEY;
======================================================
## 컬럼 Person_ID를 처음으로 이동시켜주자
alter table person modify column Person_ID INT FIRST;
======================================================
## 그런데도 안됨 .. 아래처럼 했더니 됨ㅎ
alter table person modify Person_ID INT auto_increment;

person table
Insert INTO person (Person_Name, Gender, Birthday, Address, Rented_Book_id)
VALUES ("yuna", "Female", 19890620, "경기도 부천시", "ISBN123123");
books table
insert into books (Book_Genre,Book_Title, Person_Rented_Id, Library_Name)
values ("romance", "last love",1,"서울시립도서관"),
("novel", "our story",1,"서울시립도서관"),

update person
set Address = "서울시 합정동"
where Person_Id = 2;
select * from person;

use bookrent;
select * from books;
Delete from books
where Book_Id=3;

select * from books where Book_Genre = "novel";
