일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- Tkinter
- math
- SQL
- list
- matplotlib
- Excel
- GIT
- array
- c#
- Java
- PANDAS
- Google Spreadsheet
- Kotlin
- Google Excel
- string
- 파이썬
- gas
- Apache
- numpy
- google apps script
- PostgreSQL
- PySpark
- dataframe
- Mac
- Python
- django
- Github
- Redshift
- hive
- Today
- Total
목록Redshift (69)
달나라 노트
alter table 구문을 이용하면 table에 존재하는 column의 이름을 바꿀 수 있습니다. Syntax alter table (table_name) rename column (original_column_name) to (new_column_name) (table_name) = 변경 내용을 적용할 table 이름 (original_column_name) = 이름을 변경할 기존의 column 이름 (new_column_name) = 변경할 새로운 column 이름 alter table test_schema.test_table rename column col3 to dt_col; 위 예시에 있는 alter table 구문을 실행하면 test_schema.test_table에 있는 col3 컬럼 이름..
alter table ~ alter column/modify column ~ type ~ 구문을 사용하면 column의 data type을 변경할 수 있습니다. Syntax alter table (table_name) alter column (column_name) type (data_type) alter table (table_name) modify column (column_name) type (data_type) alter table (table_name) modify (column_name) type (data_type) alter table로 column의 data type을 바꾸기 위한 syntax로는 대표적으로 위 3가지가 있습니다. 위 3가지 형식은 사용하는 DB의 종류와 version에 ..
alter table ~ rename to ~ 구문을 사용하면 table의 이름을 바꿀 수 있습니다. Syntax alter table (original_table_name) rename to (new_table_name) (original_table_name) = 기존 테이블 이름입니다. schema와 table 이름 모두를 적어야합니다. (new_table_name) = 새로운 테이블 이름입니다. schema 이름은 생략하고 table 이름만 적어야 합니다. alter table test_schema.first_table rename to second_table ; 현재 test_schema.first_table이라는 테이블이 있다고 가정해봅시다. 그리고 이 table의 이름을 test_schema...
SQL을 다루다보면 어떤 table의 정보가 필요한 경우가 있습니다. 여기서 말하는 정보란 table에 존재하는 column의 종류, column의 자료형(data type), column에 들어갈 수 있는 데이터의 최대 크기 등을 의미합니다. 이러한 정보들을 DDL(Data Definition Language, Data Description Language)이라고 합니다. SQL에서 DDL이란 보통 table의 이름, table에 존재하는 column 종류, 각 column의 data type, column들이 수용할 수 있는 데이터의 최대 크기, distinct key, sort key 등 table의 특징에 관한 정보를 담은 내용을 의미합니다. (더 자세하고 정확히 말하면 위 설명보다 더 상세한 정..