Posts

Showing posts with the label Creating Views in SQL

Featured Post

8 Ways to Optimize AWS Glue Jobs in a Nutshell

Image
  Improving the performance of AWS Glue jobs involves several strategies that target different aspects of the ETL (Extract, Transform, Load) process. Here are some key practices. 1. Optimize Job Scripts Partitioning : Ensure your data is properly partitioned. Partitioning divides your data into manageable chunks, allowing parallel processing and reducing the amount of data scanned. Filtering : Apply pushdown predicates to filter data early in the ETL process, reducing the amount of data processed downstream. Compression : Use compressed file formats (e.g., Parquet, ORC) for your data sources and sinks. These formats not only reduce storage costs but also improve I/O performance. Optimize Transformations : Minimize the number of transformations and actions in your script. Combine transformations where possible and use DataFrame APIs which are optimized for performance. 2. Use Appropriate Data Formats Parquet and ORC : These columnar formats are efficient for storage and querying, signif

3 SQL Query Examples to Create Views Quickly

Image
There are three kinds of Views in SQL. The three views are Read-only, Force, and Updatable. Views real usage is to hide data. And you need to ensure base tables are present before you create a View. You can call views as logical tables. The advantage of Views is you can show only some of the fields of base tables. What is a View in SQL A view can be constructed with another view so it is called a nested view. You can create or replace an existing view A view can be created without having base tables. This is possible with the FORCE option. #1: Read-Only Views The standard syntax for the view is as follows: CREATE OR replace VIEW invoice_summary AS SELECT vendor_name count(*) AS invoice_count, SUM(invoice_total) AS invoice_total_sum FROM vendor JOIN invoices ON vendors.vendor_id*invoices.vendor_id GROUP BY vendor_name; Notes: You cannot update Read-only Views #2: Force Views CREATE FORCE VIEW products_list AS SELECT product_description, product_price FROM products;