掌握 SQL - 从简单到高级的 200 多个查询
Master SQL - Simple to advanced 200 + queries
- 1. Introduction
- 2. Install PostgreSQL 13
- 3. Install pgAdmin 4 v5.5
- 4. Run PostgreSQL on the cloud
- 2. Employees Management System
- 1. Understand the database model
- 2. Create tables and populate data
- 3. Get filtered data via WHERE clause
- 4. Referencing an alias and concatenate columns
- 5. Using conditional logic with CASE expression
- 6. Using ORDER BY, LIMIT and RANDOM
- 7. Find NULL values and transform into real values
- 8. Searching for patterns
- 9. Sorting on data dependent key
- 10. Staking tables together
- 3. Hierarchical Queries
- 1. Expressing a Parent-Child Relationship
- 2. Expressing a Child-Parent-Grandparent Relationship
- 3. Creating a hierarchical view of a table
- 4. Finding all child rows for a given parent row
- 5. Which rows are leaf, branch, or root nodes
- 4. Working with numbers
- 1. Computing an average, minmax values
- 2. Sum, and count
- 3. Generating a running total
- 4. Calculating 3-point moving averages
- 5. Calculate a mode
- 6. Calculate a median, averages without highs and lows
- 5. Date Arithmetic
- 1. Add, subtract dates, and numbers of days
- 2. Compute running date difference
- 3. Comparing records using dates
- 6. Advances Searching
- 1. Find differences between rows within same group or partition
- 2. Pagination
- 3. Skipping n rows
- 4. Selecting the Top n Records
- 7. Window Functions
- 1. Turn aggregate function to window function
- 2. PARTITION BY clause
- 3. Handling NULLs
- 4. The ORDER BY clause matters
- 8. Metadata Queries
- 1. Listing tables, columns and indexes
- 2. Listing constraints on a table
- 3. Using SQL to Generate SQL
- 9. International Debt Analysis
- 1. Preparing the data
- 2. Analyzing International debt - Part 1
- 3. Analyzing International debt - Part 2
- 10. Stocks Markets Analysis
- 3. Import sample datasets
- 5. Important - SQL Query is in CODE Articles
- 6. List data, sectors in ascending and descending orders
- 8. Using COUNT, WHERE, IN and NOT IN with sectors