Mac [MariaDB] 4. table 생성, 삭제, 변경, 복사

델버·2022년 5월 19일
0

MariaDB

목록 보기
5/17

table 생성

  1. table을 생성한다. column이 하나라도 있어야 생성되므로 column도 하나 만들어준다.
    create table tabel명 ( column명 VARCHAR(100) );
  2. table 확인
    show tab;

table 삭제

  • table 삭제
    drop table table명;

table 이름 변경

  • 이름 변경
    rename table table명 to 변경할table명;

table 복사

  • 테이블 스키마 복사
    create table new_table명 like old_table명 ;

  • 테이블 스키마 & 데이터 복사

    create table new_table명 (select * from old_table명);

  • 데이터 복사

    insert into receive_table명 (select * from serve_table명);


참고

https://www.codingfactory.net/11335

0개의 댓글