# Data Overview

Redshift is a queryable data warehouse, so the data you can export depends entirely on what tables, views, and schemas exist in your cluster.

## What data can you export?

Coupler.io connects directly to your Redshift cluster and can export:

* **Any table** — Public or private tables in any schema you have read access to
* **Any view** — Materialized or regular views
* **Custom query results** — The output of any SELECT statement you write

## Report types

| Report type       | Best for                                      | Output                                       |
| ----------------- | --------------------------------------------- | -------------------------------------------- |
| **Table or view** | One-to-one export of a Redshift table or view | All rows and columns from the selected table |
| **Custom SQL**    | Filtered, aggregated, or transformed data     | Results of your SQL query                    |

## Building custom SQL queries

### Filter data

```sql
SELECT * FROM sales WHERE region = 'EMEA' AND order_date >= '2024-01-01';
```

### Aggregate metrics

```sql
SELECT DATE_TRUNC('month', order_date) AS month, SUM(amount) AS total_revenue
FROM orders
GROUP BY DATE_TRUNC('month', order_date)
ORDER BY month DESC;
```

### Join multiple tables

```sql
SELECT c.customer_name, o.order_id, o.amount
FROM customers c
JOIN orders o ON c.customer_id = o.customer_id
WHERE o.order_date >= '2024-01-01';
```

### Window functions

```sql
SELECT customer_id, order_date, amount,
  ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date) AS order_rank
FROM orders;
```

## Common use cases

#### Sales dashboards

Export order, customer, and revenue data to Looker Studio or Google Sheets for real-time sales tracking.

#### Finance reporting

Aggregate transaction data by account, region, or time period and send it to BigQuery for further analysis.

#### Customer insights

Join customer metadata with behavioral data and export to Claude or ChatGPT for AI-powered analysis.

#### Data warehouse consolidation

Use Coupler.io to combine Redshift data with data from other sources (Salesforce, Stripe, etc.) via Append or Join transformations.

## Platform-specific notes

* Redshift supports standard SQL syntax; if you're familiar with PostgreSQL, most queries will work directly
* Use `LIMIT` in your Custom SQL query to test large datasets before full export
* Redshift may compress or transform data types on export; verify column formats in your destination
* If your query returns more than 10 million rows, consider adding filters or aggregation to stay within destination limits
* Temporary tables (created with `CREATE TEMP TABLE`) are not accessible between connections; use permanent tables or views instead
* Redshift's `UNLOAD` command is not required — Coupler.io handles data extraction directly via SQL queries
