Structural Reconnaissance
Table-Level Inventory
Start every new dataset encounter by answering these questions:
- What is the total row and column count?
- What does each row represent (the grain)?
- Which column or columns uniquely identify a row?
- When was the most recent data loaded?
- What is the earliest date in the dataset?
Classifying Columns by Role
Assign every column to one of these categories:
- Key: Primary keys, foreign keys, entity identifiers
- Attribute: Categorical fields used for grouping or filtering (region, status, plan_type)
- Measure: Numeric fields intended for aggregation (revenue, duration, score)
- Timestamp: Date or datetime fields (created_at, processed_on, event_date)
- Free-text: Unstructured strings (descriptions, comments, names)
- Flag: Binary true/false indicators
- Nested: JSON blobs, arrays, or embedded structures
Column-Level Inspection
Universal Checks (All Column Types)
- Null count and null percentage
- Count of distinct values and cardinality ratio (distinct / total rows)
- Top 5-10 most frequent values with their occurrence counts
- Bottom 5 least frequent values (useful for spotting anomalies)
Numeric Measures
Minimum, maximum, mean, median
Standard deviation
Percentile ladder: p1, p5, p25, p75, p95, p99
Count of zeros
Count of negatives (flag if unexpected)
Text and Categorical Fields
Shortest length, longest length, average length
Count of empty strings
Format regularity (do values follow a consistent pattern?)
Case consistency (uniform upper, uniform lower, or mixed?)
Count of values with leading or trailing whitespace
Date and Timestamp Fields
Earliest date, latest date
Count of nulls
Count of future dates (flag if the domain forbids them)
Distribution across months or weeks
Gaps in expected daily/weekly cadence
Boolean Fields
True count, false count, null count
True proportion
Discovering Relationships
After examining columns individually, look for connections:
- Foreign key candidates: ID columns whose values likely reference another table
- Hierarchical dimensions: Columns that nest naturally (country > region > city)
- Correlated measures: Numeric columns that trend together
- Computed columns: Fields that appear derived from other columns in the same table
- Duplicated information: Columns that carry identical or near-identical content
Evaluating Data Quality
Completeness Ratings
Assign each column a tier:
- Full (>99% populated): No action needed
- Mostly full (95-99%): Investigate the missing values
- Gaps present (80-95%): Determine whether the gaps are systematic and whether the column is still usable
- Sparse (<80%): Likely unusable without imputation or supplemental data
Consistency Checks
Scan for:
- Value normalization failures: The same concept spelled multiple ways ("USA", "US", "United States", "us")
- Type mismatches: Numerics stored as text, dates in inconsistent formats
- Broken references: Foreign key values with no matching parent record
- Rule violations: Negative quantities, end dates preceding start dates, percentages outside 0-100
- Cross-column contradictions: status = 'shipped' while ship_date is null
Accuracy Warning Signs
Patterns that suggest the data may be unreliable:
- Sentinel values: 0, -1, 999999, "N/A", "TBD", "test", "xxx"
- Suspiciously dominant defaults: One value appearing far more often than expected
- Stale records: The updated_at column shows no recent activity in an active system
- Physically impossible values: Ages above 150, dates decades in the future, negative durations
- Rounding artifacts: Disproportionate clustering on multiples of 5 or 10 (implies estimation)
Freshness Assessment
- What is the timestamp of the most recent row?
- How often should this table refresh?
- Is there measurable lag between event occurrence and warehouse arrival?
- Are there missing days or hours in the time series?
Recognizing Patterns
Distribution Shapes
When profiling a numeric column, classify its shape:
- Bell-shaped: Mean and median nearly equal; symmetric tails
- Right-skewed: Long right tail with a few very large values (typical for revenue, session length)
- Left-skewed: Long left tail with a few very small values (less common)
- Bimodal: Two distinct peaks (suggests two merged populations)
- Power-law: A handful of enormous values dominating; many near-zero values (user engagement metrics)
- Uniform: Roughly flat across the range (often synthetic or randomly generated)
Time-Based Patterns
For any temporal data, investigate:
- Trend: Persistent upward or downward drift
- Seasonality: Recurring cycles — weekly, monthly, quarterly, annual
- Weekday effects: Systematic weekday vs. weekend differences
- Holiday impacts: Spikes or dips around known holidays
- Level shifts: Abrupt, sustained changes in the baseline
- Isolated anomalies: Single data points that break the prevailing pattern
Segment Discovery
Surface natural groupings by:
- Identifying categorical columns with 3 to 20 distinct values
- Comparing metric distributions across each segment value
- Highlighting segments whose behavior diverges meaningfully from the overall
- Checking whether apparent segments contain meaningful sub-segments
Correlation Scanning
Across numeric columns:
- Build a pairwise correlation matrix
- Highlight strong associations (|r| > 0.7)
- Remember that correlation never establishes causation — note this explicitly
- Probe for non-linear relationships (quadratic, logarithmic) that Pearson r would miss
Documenting What You Find
Dataset Summary Template
## Table: [schema.table_name]
**Purpose**: [What this table captures]
**Grain**: [One row per...]
**Primary Key**: [column(s)]
**Approximate Rows**: [count, as of date]
**Refresh Cadence**: [real-time / hourly / daily / weekly]
**Responsible Team**: [owner]
### Important Columns
| Column | Type | Meaning | Sample Values | Notes |
|--------|------|---------|---------------|-------|
| user_id | STRING | Unique user handle | "usr_abc123" | References users.id |
| event_type | STRING | Action category | "click", "view", "purchase" | 15 distinct values |
| revenue | DECIMAL | USD transaction amount | 29.99, 149.00 | Null for non-purchases |
| created_at | TIMESTAMP | Event occurrence time | 2024-01-15 14:23:01 | Partition column |
### Join Paths
- Links to `users` via `user_id`
- Links to `products` via `product_id`
- Parent of `event_details` (one-to-many on event_id)
### Known Caveats
- [Document any quality issues]
- [Note analytical gotchas]
### Typical Query Use Cases
- [List common analytical patterns against this table]
Schema Discovery Queries
When working directly against a warehouse, use these patterns:
-- Enumerate tables in a schema (PostgreSQL)
SELECT table_name, table_type
FROM information_schema.tables
WHERE table_schema = 'public'
ORDER BY table_name;
-- Inspect column metadata (PostgreSQL)
SELECT column_name, data_type, is_nullable, column_default
FROM information_schema.columns
WHERE table_name = 'target_table'
ORDER BY ordinal_position;
-- Rank tables by storage footprint (PostgreSQL)
SELECT relname, pg_size_pretty(pg_total_relation_size(relid))
FROM pg_catalog.pg_statio_user_tables
ORDER BY pg_total_relation_size(relid) DESC;
-- Row count per table (general approach)
-- Execute individually: SELECT COUNT(*) FROM table_name
Tracing Data Lineage
When navigating an unfamiliar warehouse:
- Begin at the consumption layer — identify which tables power reports and dashboards
- Follow dependencies upstream: what feeds those tables?
- Map the raw / staging / mart architecture
- Track where transformations enrich, filter, or roll up the data
- Record any points where data is joined with external sources
1---2name: "data-profiling"3description: "Profile and explore unfamiliar datasets — assess schema structure, column distributions, data quality, null rates, cardinality, outliers, relationships between tables, and temporal coverage. Use when onboarding to a new data source, auditing data freshness, discovering foreign keys, or deciding what to analyze."4source: "community_canonical"5risk: "unknown"6license: "not_declared_upstream"7metadata:8 source: https://skillmd.com/skills/revrebel/data-profiling9---1011## Structural Reconnaissance1213### Table-Level Inventory1415Start every new dataset encounter by answering these questions:1617- What is the total row and column count?18- What does each row represent (the grain)?19- Which column or columns uniquely identify a row?20- When was the most recent data loaded?21- What is the earliest date in the dataset?2223### Classifying Columns by Role2425Assign every column to one of these categories:2627- **Key**: Primary keys, foreign keys, entity identifiers28- **Attribute**: Categorical fields used for grouping or filtering (region, status, plan_type)29- **Measure**: Numeric fields intended for aggregation (revenue, duration, score)30- **Timestamp**: Date or datetime fields (created_at, processed_on, event_date)31- **Free-text**: Unstructured strings (descriptions, comments, names)32- **Flag**: Binary true/false indicators33- **Nested**: JSON blobs, arrays, or embedded structures3435## Column-Level Inspection3637### Universal Checks (All Column Types)3839- Null count and null percentage40- Count of distinct values and cardinality ratio (distinct / total rows)41- Top 5-10 most frequent values with their occurrence counts42- Bottom 5 least frequent values (useful for spotting anomalies)4344### Numeric Measures4546```47Minimum, maximum, mean, median48Standard deviation49Percentile ladder: p1, p5, p25, p75, p95, p9950Count of zeros51Count of negatives (flag if unexpected)52```5354### Text and Categorical Fields5556```57Shortest length, longest length, average length58Count of empty strings59Format regularity (do values follow a consistent pattern?)60Case consistency (uniform upper, uniform lower, or mixed?)61Count of values with leading or trailing whitespace62```6364### Date and Timestamp Fields6566```67Earliest date, latest date68Count of nulls69Count of future dates (flag if the domain forbids them)70Distribution across months or weeks71Gaps in expected daily/weekly cadence72```7374### Boolean Fields7576```77True count, false count, null count78True proportion79```8081## Discovering Relationships8283After examining columns individually, look for connections:8485- **Foreign key candidates**: ID columns whose values likely reference another table86- **Hierarchical dimensions**: Columns that nest naturally (country > region > city)87- **Correlated measures**: Numeric columns that trend together88- **Computed columns**: Fields that appear derived from other columns in the same table89- **Duplicated information**: Columns that carry identical or near-identical content9091## Evaluating Data Quality9293### Completeness Ratings9495Assign each column a tier:9697- **Full** (>99% populated): No action needed98- **Mostly full** (95-99%): Investigate the missing values99- **Gaps present** (80-95%): Determine whether the gaps are systematic and whether the column is still usable100- **Sparse** (<80%): Likely unusable without imputation or supplemental data101102### Consistency Checks103104Scan for:105- **Value normalization failures**: The same concept spelled multiple ways ("USA", "US", "United States", "us")106- **Type mismatches**: Numerics stored as text, dates in inconsistent formats107- **Broken references**: Foreign key values with no matching parent record108- **Rule violations**: Negative quantities, end dates preceding start dates, percentages outside 0-100109- **Cross-column contradictions**: status = 'shipped' while ship_date is null110111### Accuracy Warning Signs112113Patterns that suggest the data may be unreliable:114- **Sentinel values**: 0, -1, 999999, "N/A", "TBD", "test", "xxx"115- **Suspiciously dominant defaults**: One value appearing far more often than expected116- **Stale records**: The updated_at column shows no recent activity in an active system117- **Physically impossible values**: Ages above 150, dates decades in the future, negative durations118- **Rounding artifacts**: Disproportionate clustering on multiples of 5 or 10 (implies estimation)119120### Freshness Assessment121122- What is the timestamp of the most recent row?123- How often should this table refresh?124- Is there measurable lag between event occurrence and warehouse arrival?125- Are there missing days or hours in the time series?126127## Recognizing Patterns128129### Distribution Shapes130131When profiling a numeric column, classify its shape:132- **Bell-shaped**: Mean and median nearly equal; symmetric tails133- **Right-skewed**: Long right tail with a few very large values (typical for revenue, session length)134- **Left-skewed**: Long left tail with a few very small values (less common)135- **Bimodal**: Two distinct peaks (suggests two merged populations)136- **Power-law**: A handful of enormous values dominating; many near-zero values (user engagement metrics)137- **Uniform**: Roughly flat across the range (often synthetic or randomly generated)138139### Time-Based Patterns140141For any temporal data, investigate:142- **Trend**: Persistent upward or downward drift143- **Seasonality**: Recurring cycles — weekly, monthly, quarterly, annual144- **Weekday effects**: Systematic weekday vs. weekend differences145- **Holiday impacts**: Spikes or dips around known holidays146- **Level shifts**: Abrupt, sustained changes in the baseline147- **Isolated anomalies**: Single data points that break the prevailing pattern148149### Segment Discovery150151Surface natural groupings by:152- Identifying categorical columns with 3 to 20 distinct values153- Comparing metric distributions across each segment value154- Highlighting segments whose behavior diverges meaningfully from the overall155- Checking whether apparent segments contain meaningful sub-segments156157### Correlation Scanning158159Across numeric columns:160- Build a pairwise correlation matrix161- Highlight strong associations (|r| > 0.7)162- Remember that correlation never establishes causation — note this explicitly163- Probe for non-linear relationships (quadratic, logarithmic) that Pearson r would miss164165## Documenting What You Find166167### Dataset Summary Template168169```markdown170171## Table: [schema.table_name]172173**Purpose**: [What this table captures]174**Grain**: [One row per...]175**Primary Key**: [column(s)]176**Approximate Rows**: [count, as of date]177**Refresh Cadence**: [real-time / hourly / daily / weekly]178**Responsible Team**: [owner]179180### Important Columns181182| Column | Type | Meaning | Sample Values | Notes |183|--------|------|---------|---------------|-------|184| user_id | STRING | Unique user handle | "usr_abc123" | References users.id |185| event_type | STRING | Action category | "click", "view", "purchase" | 15 distinct values |186| revenue | DECIMAL | USD transaction amount | 29.99, 149.00 | Null for non-purchases |187| created_at | TIMESTAMP | Event occurrence time | 2024-01-15 14:23:01 | Partition column |188189### Join Paths190- Links to `users` via `user_id`191- Links to `products` via `product_id`192- Parent of `event_details` (one-to-many on event_id)193194### Known Caveats195- [Document any quality issues]196- [Note analytical gotchas]197198### Typical Query Use Cases199- [List common analytical patterns against this table]200```201202### Schema Discovery Queries203204When working directly against a warehouse, use these patterns:205206```sql207-- Enumerate tables in a schema (PostgreSQL)208SELECT table_name, table_type209FROM information_schema.tables210WHERE table_schema = 'public'211ORDER BY table_name;212213-- Inspect column metadata (PostgreSQL)214SELECT column_name, data_type, is_nullable, column_default215FROM information_schema.columns216WHERE table_name = 'target_table'217ORDER BY ordinal_position;218219-- Rank tables by storage footprint (PostgreSQL)220SELECT relname, pg_size_pretty(pg_total_relation_size(relid))221FROM pg_catalog.pg_statio_user_tables222ORDER BY pg_total_relation_size(relid) DESC;223224-- Row count per table (general approach)225-- Execute individually: SELECT COUNT(*) FROM table_name226```227228### Tracing Data Lineage229230When navigating an unfamiliar warehouse:2312321. Begin at the consumption layer — identify which tables power reports and dashboards2332. Follow dependencies upstream: what feeds those tables?2343. Map the raw / staging / mart architecture2354. Track where transformations enrich, filter, or roll up the data2365. Record any points where data is joined with external sources