
Select Queries from DVD Rental database
first, Download the tar file https://github.com/syedjaferk/postgres_sample_database/blob/main/dvd_rental/dvdrental.tar using the above link then open pgAdmin4 Login to your postgres then upload the downloaded database create a new database called dvdrental using the cmd CREATE DATABASE dvdrental; -To check if your database has been uploaded use this cmd \dt SELECT Query Basic SELECT Statement SELECT first_name FROM customer; use the cmd to display all name in database 1) Use column aliases to rename title as "Movie Title" and rental_rate as "Rate" cmd: SELECT title AS "Movie Title", rental_rate AS "Rate" FROM film; sample op: Movie Title | Rate -----------------------------+------ Chamber Italian | 4.99 Grosse Wonderful | 4.99 Airport Pollock | 4.99 Bright Encounters | 4.99 Academy Dinosaur | 0.99 Ace Goldfinger | 4.99 Adaptation Holes | 2.99 2) List customer names and their email addresses. Alias first_name and last_name as "First Name" and "Last Name" cmd: SELECT first_name AS "First
Continue reading on Dev.to Tutorial
Opens in a new tab



