SQL Practice Problems - Day 13 Focus: Redshift Performance Optimization 1 - Create a sales table distributed by customer_id and sorted by sale_date. Input: Sales data structure Output: Optimized sales table 2 - Bulk load product data from S3 into Redshift using COPY command. Input: S3 bucket with product data Output: Loaded products table 3 - Export customer data to S3 in Parquet format using UNLOAD command. Input: Customers table Output: S3 files in Parquet format 4 - Create a dimension table with DISTSTYLE ALL for small reference data. Input: Product categories data Output: Optimized categories table 5 - Design fact and dimension tables with appropriate distribution keys. Input: Sales schema requirements Output: Optimized table DDLs 6 - Load data from S3 with error handling and statistics update. Input: S3 data with potential errors Output: Clean loaded data with statistics 7 - Choose between EVEN and KEY distribution for large tables. Input: Large sales data table Output: Optimized distribution strategy 8 - Use Redshift Spectrum to query data directly from S3 without loading. Input: S3 data files, external schema Output: Query results from external data 9 - Create interleaved sort keys for multiple query patterns. Input: Sales table with multiple access patterns Output: Table with interleaved sort keys 10 - Implement data compression during COPY operations. Input: Uncompressed S3 data Output: Compressed table data 11 - Use AUTO distribution to let Redshift choose distribution style. Input: New table with unknown usage patterns Output: Table with AUTO distribution 12 - Optimize JOIN performance with distribution key alignment. Input: Multiple large tables requiring joins Output: Tables with aligned distribution keys 13 - Handle data loading with manifest files for multiple S3 objects. Input: Multiple S3 files, manifest file Output: Complete data load 14 - Create materialized views for frequently used aggregations. Input: Large sales data, common queries Output: Materialized view definition 15 - Implement workload management (WLM) for mixed workloads. Input: Various query types and priorities Output: WLM configuration