망각에 재주 있는 나를 위해 기록하는 곳.

DBeaver에 PostgresSQL 샘플 데이터 넣기 본문

DB

DBeaver에 PostgresSQL 샘플 데이터 넣기

baobabtree 2022. 3. 17. 02:57

SQL 마다 제공하는 샘플 데이터로 SQL연습을 할려고 한다.

PostgresSQL을 DB관리툴인 DBeaver에서 사용할 것이다.

 

먼저 DBeaver와 Postgres 그리고 샘플 데이터를 다운받는다.

 

DBeaver 다운로드

https://dbeaver.io/download/

 

Download | DBeaver Community

Download Tested and verified for MS Windows, Linux and Mac OS X. Install: Windows installer – run installer executable. It will automatically upgrade version (if needed). MacOS DMG – just run it and drag-n-drop DBeaver into Applications. Debian package

dbeaver.io

 

Postgres 다운로드

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

 

PostgreSQL: Downloads

Downloads PostgreSQL Downloads PostgreSQL is available for download as ready-to-use packages or installers for various platforms, as well as a source code archive if you want to build it yourself. Packages and Installers Select your operating system family

www.postgresql.org

 

Postgres 샘플 데이터

https://www.postgresqltutorial.com/postgresql-sample-database/

 

PostgreSQL Sample Database

Summary: in this tutorial, we will introduce you to a PostgreSQL sample database that you can use for learning and practicing PostgreSQL. We will use the DVD rental database to demonstrate the features of PostgreSQL. The DVD rental database represents the

www.postgresqltutorial.com

 

PostgresSQL 설치시 Stack Builder는 설치하지 않았다.

DBeaver에 PostgresSQL을 연결하고 샘플 데이터를 넣어야하는데 

PostgresSQL는 설치시 Client Tool인 pgAdmin이 같이 설치된다.

pgAdmin은 GUI환경에서 DB를 관리할 수 있는 툴이다. (이 과정에서 psql을 처음 알게되었다.)

샘플 데이터는 pgAdmin에서 넣어줘야 DBeaver에서 사용할 수 있다.

 

 

그리고 샘플 데이터를 넣기위해 pgAdmin에서 Restore시 Utility not found라는 오류가 발생하기도 한다.

이와 관련된 해결법은 다른분의 블로그를 참고하여 해결했다.

관련링크:

https://while1.tistory.com/m/entry/PostgreSQL-file-not-found-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0%ED%95%98%EA%B8%B0

 

[PostgreSQL] file not found 오류 해결하기

📌문제점 DB에서 Restore를 시도하자 아래와 같은 에러가 발생하며 더이상 진행되지 않았다. 당연하겠지만 OK를 눌러도 아무 반응이 없음. 무슨 일인가 싶어 PostgreSQL파일에 들어가봤더니 pdAdmin4 파

while1.tistory.com

 

결과적으로 DBeaver에 샘플데이터가 잘 나와 기부니가 좋아졌다.

 

참고로 PostgresSQL 샘플데이터의 ER다이어그램은 이러하다.

 

이제 필요하면 이걸 가지고 마음대로 연습하면 되겠다.

 

 

 

 

ps1. 하다보니 여기서 PSQL이라는 존재도 알게 되었는데 나중에 필요하면 공부해야겠다.

PSQL관련링크:

https://browndwarf.tistory.com/51

 

알아두면 유용한 psql 명령어 정리

PSQL 보통 PostgreSQL을 설치할 때 Client Tool인 pgAdmin이 같이 설치되고, 대부분 GUI 환경에서 pgAdmin을 사용하기 때문에 PSQL의 존재조차 모를 때가 있다. (필자는 PostgreSQL 처음 사용했을 때 psql의 존재..

browndwarf.tistory.com

ps2. 다른 종류의 SQL 샘플 데이터

MySQL

https://www.mysqltutorial.org/mysql-sample-database.aspx/

 

MySQL Sample Database

This page provides you with a MySQL sample database that helps you to practice with MySQL effectively and quickly. You can download the sample database and load it into your MySQL Server.

www.mysqltutorial.org

 

Oracle

https://www.oracletutorial.com/getting-started/oracle-sample-database/

 

Oracle Sample Database

This tutorial introduces you an Oracle sample database and shows you how to load it into an Oracle database for practicing

www.oracletutorial.com