Saturday 30 May 2020

How To Download/Restore/Load Sample Database In PostgreSQL Using pgAdmin4





Only 3.9% of viewers are subscribing to my channel 😓.
I request you to please give click on Subscribe button.
It really helps me grow 😢.






We will use the DVD rental database for demonstrating the features of PostgreSQL.



The DVD rental database represents the business processes of a DVD rental store. The DVD rental database has many objects including:



15 tables

1 trigger

7 views

8 functions

1 domain

13 sequences



PostgreSQL Sample Database Tables

There are 15 tables in the DVD Rental database:



actor – stores actors data including first name and last name.

film – stores films data such as title, release year, length, rating, etc.

film_actor – stores the relationships between films and actors.

category – stores film’s categories data.

film_category- stores the relationships between films and categories.

store – contains the store data including manager staff and address.

inventory – stores inventory data.

rental – stores rental data.

payment – stores customer’s payments.

staff – stores staff data.

customer – stores customers data.

address – stores address data for staff and customers

city – stores the city names.

country – stores the country names.



You can use the pgAdmin tool to restore the sample database from the downloaded database file using the following steps:





First, launch the pgAdmin tool and connect to the PostgreSQL server.



Next, right-click on the dvdrental database and choose Restore… menu item as shown:



After that, wait for a few seconds to let the restoration process completes.



Finally, open the dvdrental database from object browser panel, you will see the tables in the public schema and other database objects as shown.



We have shown you how to load the dvdrental sample database into the PostgreSQL database server for learning and practicing PostgreSQL.



Let’s start learning PostgreSQL and have fun!

No comments:

Post a Comment