Posts

Showing posts with the label SQL VIEWS

Featured Post

How to Build CI/CD Pipeline: GitHub to AWS

Image
 Creating a CI/CD pipeline to deploy a project from GitHub to AWS can be done using various AWS services like AWS CodePipeline, AWS CodeBuild, and optionally AWS CodeDeploy or Amazon ECS for application deployment. Below is a high-level guide on how to set up a basic GitHub to AWS pipeline: Prerequisites AWS Account : Ensure access to the AWS account with the necessary permissions. GitHub Repository : Have your application code hosted on GitHub. IAM Roles : Create necessary IAM roles with permissions to interact with AWS services (e.g., CodePipeline, CodeBuild, S3, ECS, etc.). AWS CLI : Install and configure the AWS CLI for easier management of services. Step 1: Create an S3 Bucket for Artifacts AWS CodePipeline requires an S3 bucket to store artifacts (builds, deployments, etc.). Go to the S3 service in the AWS Management Console. Create a new bucket, ensuring it has a unique name. Note the bucket name for later use. Step 2: Set Up AWS CodeBuild CodeBuild will handle the build proces

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;