
Install PostgreSQL 13.3 on macOS, Windows, or Linux by downloading from postgresql.org and running installer. Use Pgadmin four to connect to the server and manage databases via its web interface.
Install pgAdmin 4 v5.5
Set up a free managed PostgreSQL database on the cloud with elephant sql and connect using pgAdmin to run queries.
Explore the database model for an employee management system by linking the employees and departments tables through department_id, and prepare them in Pgadmin to run basic to advanced queries.
Create and populate two tables, departments and employees, in PostgreSQL using SQL, define department_id as primary key with not null constraints, and insert sample data.
Learn to filter data with the where clause, using and/or conditions, and retrieve specific columns with aliases. Explore not null and commission examples in SQL queries.
Reference aliases in where clauses via inline view, inner and outer queries, then alias the outer result for filtering; concatenate name and job to form a job title.
Explore using a case expression to apply conditional logic in a select query, labeling salaries as underpaid or overpaid in the employees table.
Order by sorts query results by a column, limit restricts the number of records, and random selects random rows. Use these to list top salaries or sample employees.
Identify null values with is null in an employee table and replace them with zero or real values using coalesce or a case statement.
Master SQL pattern searching by using in for set matching, combining with and/or, and applying like with percent wildcards to filter employees by department and name or job title.
Sort data by multiple columns using order by, such as department id and salary. Apply a case expression to enable data dependent sorting, using commission for sales and salary otherwise.
Learn how to stack result sets from multiple tables using union and union all, create temporary tables, and apply distinct filtering with inner and outer queries.
Explore hierarchical queries and parent-child relationships by testing self joins on an employees table to display each employee with their manager, using concatenation and subqueries.
Explore recursive queries in Postgres to express a child-parent-grandparent hierarchy, building a tree from Miller to Clark to King using depth, union all, and leaf-branch visualization.
Build a recursive query to generate an employee tree from a parent-child table. Start with roots (manager_id is null) and use union all to reveal hierarchy to any depth.
Find all child rows for a given parent by using a recursive query with union all, starting from a root employee and traversing manager relationships to list child employees.
Identify each row's position in a parent-child hierarchy by classifying employees as leaf, branch, or root using scalar subqueries, counts, and a sign method in SQL.
Compute the average salaries across all employees and by department using avg, min, and max. Group by department, order by salary, and uncover data stories with SQL.
Compute total salaries using the sum function and apply the average function. Group by department id to show department totals and counts, and order by highest totals.
Generate a running total in SQL using a window function over salary, ordered by salary, and ensure uniqueness with employee ID to handle duplicates.
Learn to compute a three-point moving average in SQL by combining current sales with two prior values using lag functions and a window ordered by transaction date.
Learn how to calculate the mode in a data set using SQL, counting how often each salary appears, applying dense_rank, and selecting the most frequent value.
Calculate a median using percentile_cont within group by salary, filtered by department 20, and compute averages without highs and lows by excluding max and min salaries.
Learn date arithmetic in PostgreSQL by adding and subtracting days, months, and years with interval, and calculate the number of days between dates using simple queries.
Learn to compute running date differences in SQL by using lead window function to find the next hire date within department 10, then subtract hire dates to get day counts.
Learn to compute days between consecutive hire dates for employees in department 10 using lead window functions and scalar subqueries, and produce a differential column with sorted hire dates.
Use the lead over window function with partition by department id and order by hire date to compute each employee's salary difference with the next salary in the same department.
Learn SQL pagination with the row_number window function to paginate salaries from the employee table, fetching first five and next five using where n between 1 and 5.
Skip rows in SQL by using row_number over order by to generate a sequence, then filter with mod to return every other (odd) employee from the employee table.
Apply window functions with dense_rank to return the top salaries, handling ties correctly, using inline views and ranking rather than limit for accurate top end results.
Explore how to turn aggregate functions into window functions using the over clause, and see how counts run over partitions like departments while where and order by affect execution.
Utilize the partition by clause as a moving group by in window functions to compute per-department counts without a standard group by.
Learn how to handle nulls in queries using group by and partition by. See how nulls are treated as a single group and how count(*) differs from count(column).
Explore how the order by clause in a window function's over clause shapes results within a partition, computing running salaries by department and comparing partitioned totals.
Explore how to list tables, columns, and indexes with meta queries in PostgreSQL, using information_schema and pg_catalog to inspect schemas, tables, columns, and index definitions.
List and inspect postgres table constraints using information_schema views, identify primary keys and other constraints, and combine table_constraint with key_column_usage for a complete view of a table.
Generate dynamic SQL from meta queries to count rows across thousands of base tables in the public schema, building strings into a SQL statement for maintenance tasks.
Prepare and upload World Bank depth data to a PostgreSQL database, create the international depth table with country and indicator fields, insert data, and preview records for global data stories.
Analyze international debt data with SQL: count distinct countries and indicators, sum depth, compute total debt in USD, and identify the countries with the highest depth.
Compute the average depth across indicators and group by indicator to reveal top categories in international debt data. Identify country rankings by maximum depth and explore indicator counts.
Import sample data by downloading and unzipping four csv files, then use the SQL copy command in PgAdmin to load sectors, symbols, latest prices, and historical prices.
Explore an interactive sql learning workflow with a live query editor that shows questions and commands to analyze stock market data, using associated article's code column to run in PgAdmin.
Explore how to analyze stock market data in PostgreSQL by querying sectors, symbols, prices latest, and price historical, and learn to sort sectors by name in ascending or descending order.
Count total sectors in the stock market database using count and alias as total sectors. Use where with in and not in to include or exclude specific sector IDs.
Are you ready to embark on an exciting journey through the dynamic world of PostgreSQL?
Look no further! Our comprehensive PostgreSQL course has been meticulously designed to transform you from a novice into a PostgreSQL wizard, armed with the skills to conquer real-world data challenges!
By the end of this course, you will run 200+ SQL queries to:
Apply Powerful SQL Commands: Gain the expertise to effectively store, update, and retrieve information using PostgreSQL's powerful SQL commands.
Master Complex Joins: Navigate the intricate web of data by seamlessly joining multiple tables with various techniques.
Harness the Magic of Subqueries: Move from the basics to advanced subqueries with ease, enabling you to extract precise information from complex datasets.
Unlock the Secrets of Aggregate Functions: Learn how to aggregate data using functions that turn raw data into meaningful insights.
Time Travel with Date/Time: Handle date and time data types, intervals, and timezones like a pro.
Data Grouping: Organize your data with GROUP BY and apply conditional filters using HAVING, allowing for more structured analysis.
Combining Queries: Combine query results using UNION, INTERSECT, and EXCEPT, creating a powerful toolbox for data manipulation.
Windows Functions: Delve into the world of window functions, from the basics to advanced techniques for advanced data analysis.
Real-world Practice: Work on practical datasets, including Employee Management System, International Debt Data Analysis, Stock Market Analysis, World Trades databases, and much more to preparing you for real-world scenarios.
Ready to Take the Leap? Join Us Today!
Don't miss this opportunity to master PostgreSQL, one of the most popular and powerful relational database systems in the world. Sign up now, and you'll be well on your way to becoming a PostgreSQL pro! Your next big project is waiting – seize it with PostgreSQL expertise!
Your journey begins with a single click. Enroll now and revolutionize your data handling skills with PostgreSQL!