본문 바로가기
기타

[SQL][DataBase][PosgreSQL] PostgreSQL Create DB,Import csv file

by Chandler.j 2024. 1. 29.
반응형

1. PostgreSQL

2. Create DataBase

3. Import CSV file

4. SQL Query


1. PostgreSQL

- https://www.postgresql.org/about/

 

PostgreSQL: About

About What is PostgreSQL? PostgreSQL is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads. The origins of PostgreSQL

www.postgresql.org

- Download: https://www.postgresql.org/download/

- 무료임 / OS 범용적임 / 간단히 DB 구축해서 사용하기 좋음


2. Create DataBase

1) SQL Shell (psql)


- 정보 입력하여 로그인


- CREATE Databse

- \l >> DB list

- \c dbname>> db connect


 

2) pgadmin

- pgadmin 4 실행 후 1 > 2 > 3 순으로 클릭


- 탭에 있는 설정할 것들 설정 한 후 save click


- db_test2 DB 생성 확인


3. Import CSV file

- sample data

 

sample.csv
7.33MB

 

 


1) sql shell

- Create table


- COPY csv file

보통 하면 되는데 권한 이슈가 있는 것 같아 일단 패스 pgadmin으로 다시 import


2) pgadmin

- 1 > 2 > 3 > 4 순으로 import/export data click


- general > options > columns 설정 확인 후 ok click


- 알람으로 started and completed 확인


4. SQL Query

- select 문으로 해당 table data 확인

 

 


TOP

Designed by 티스토리