Given task : Selecting queries from the dvd rental database using the postgre and pgadmin 4 on the macOS
I started with basic data retrieval by selecting film titles along with their rental rates. To make the output more readable, I used column aliases to rename fields like title to Movie Title and rental_rate to Rate. This small step made a big difference in how clean the results looked.
there were numerous task assigned to this specific topic which is 25 subtopics .
^ Moving forward, I worked on sorting data. For example, I retrieved a list of films sorted by rental rate in descending order. In cases where multiple films had the same rental rate, I applied a secondary sort based on the title in alphabetical order. This introduced me to multi-level sorting using the ORDER BY clause.
I also practiced sorting actor names by last name and then by first name, which reinforced my understanding of ordering data across multiple columns. Similarly, I retrieved unique values such as replacement costs, ratings, and rental durations using the DISTINCT keyword, which is very useful when dealing with repetitive data.
Another interesting part was working with film details like title and duration. By renaming the length column to Duration (min), I made the output more intuitive. I also sorted films based on their length in descending order to identify longer movies.
Additionally, I explored filtering and limiting data. For instance, I listed the 10 shortest films and retrieved the top 5 customers based on their customer IDs. These operations helped me understand how to control the size and relevance of query results.
I also worked with store and inventory data by identifying unique store IDs and determining the first rental date for each store. This gave me more exposure to handling data across different tables.
Finally, I practiced advanced sorting techniques, such as ordering films by multiple columns (like replacement cost and rental rate) and organizing customer and rental data in structured ways.
- Overall, this exercise helped me strengthen my understanding of SQL concepts like:
Data retrieval using SELECT
Column aliasing
Sorting with ORDER BY
Removing duplicates using DISTINCT
Aggregation with functions like MIN()
Grouping data using GROUP BY
Limiting results with LIMIT
This hands-on practice gave me a clearer idea of how SQL is used in real-world applications to manage and analyze structured data efficiently.


Top comments (0)