From the course: Scala Essential Training for Data Science

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Loading data into PostgreSQL

Loading data into PostgreSQL - Scala Tutorial

From the course: Scala Essential Training for Data Science

Start my 1-month free trial

Loading data into PostgreSQL

[Instructor] We've installed the PostgreSQL software. So now let's set it up by creating a database and a user, and loading some data into it. Now Postgres provides a couple of handy commands. One is called createdb, and I'll give it a name scala_db. This will create a database called scala_db. Now I also create a user and I'll give that user the same name, scala_db. Now what I'd like to do is create some tables and load some data into those tables. Now I've created a script called emps.sql. If you have access to the exercise files you can download emps.sql and follow along. And what I'm going to do is issue a command using Psql, a command line for working with Postgres. And I'm going to indicate that I want to log in as a user scala_db, and I want to use the database scala_db. And now I want to execute a script and to do that we pass in the dash a, dash f options, and then we specify our file. Now I have emps.sql in my download directory, so I'll just specify the path to that…

Contents