본문 바로가기



프로그래밍/DB

[MariaDB] MySQL컬럼의 추가 방법

 

 

컬럼을 추가할 테이블을 결정한다음 다음 명령어를 입력한다.

alter table 테이블명 add 컬럼명 자료형 null속성(생략가능);

테이블 이름 student에 1st라는 int(100)의 속성을 가진 컬럼을 추가함

다음과 같은 명령어는 에러가 난다. 

MariaDB [study_db]> alter table '테이블명'add '컬럼명' 자료형 null속성;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'add 1st int(10)' at line 1

 

'프로그래밍 > DB' 카테고리의 다른 글

[Mariadb] 마리아 DB 용 JDBC 연결 및 클래스 사용  (0) 2021.06.23