Skip to main content

Story of SQL Views ideas you need when can be updated

A view can be read-only or updatable. You can maintain data security with views. Creating a view need base tables present in the database. Views are also called logical tables.

What is View

  • A view can be constructed with another view so it is called as nested view.
  • You can create or replace an existing view
  • A view can be created without having base tables. This is possible with FORCE option.

Read Only Views

The standard syntax for 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;

Force Views

CREATE FORCE VIEW products_list
SELECT product_description,
FROM products;

Updatable Views

  • A view can be updatable if a view follows certain rules.
  • A view when it is created for update purpose, you can give INSERT,UPDATE and DELETE operations.
  • A read only view should contain WITH READ ONLY CLAUSE.
  • While updating a view, it is possible to update only one base table at a time. When you created a view from more than one table, then it is not possible to update two tables at a time.

What is ALTER View

Using CREATE OR REPLACE statement you can ALTER the view already present.

Drop View

DROP VIEW vendors_sw

The view vendors_sw is deleted from database.

The Bottom Line

A view with CHECK OPTION is surely help you to satisfy certain condition. Usually this option will be used in updatable views.


Popular posts from this blog

R Vs SAS differences to read today

Statistical analysis should know by every software engineer. R is an open source statistical programming language. SAS is licensed analysis suite for statistics. The two are very much popular in Machine learning and data analytics projects.
SAS is analysis suite software and R is a programming language R ProgrammingR supports both statistical analysis and GraphicsR is an open source project.R is 18th most popular LanguageR packages are written in C, C++, Java, Python and.NetR is popular in Machine learning, data mining and Statistical analysis projects. SASSAS is a statistical analysis suite. Developed to process data sets in mainframe computers.Later developed to support multi-platforms. Like  Mainframe, Windows, and LinuxSAS has multiple products. SAS/ Base is very basic level.SAS is popular in data related projects. Learn SAS vs R Top Differences between SAS Vs R Programming SAS AdvantagesThe data integration from any data source is faster in SAS.The licensed software suite, so you…

Blue Prism complete tutorials download now

Blue prism is an automation tool useful to execute repetitive tasks without human effort. To learn this tool you need the right material. Provided below quick reference materials to understand detailed elements, architecture and creating new bots. Useful if you are a new learner and trying to enter into automation career. The number one and most popular tool in automation is a Blue prism. In this post, I have given references for popular materials and resources so that you can use for your interviews.
RPA Blue Prism RPA blue prism tutorial popular resources I have given in this post. You can download quickly. Learning Blue Prism is a really good option if you are a learner of Robotic process automation.
RPA Advantages The RPA is also called "Robotic Process Automation"- Real advantages are you can automate any business process and you can complete the customer requests in less time.

The Books Available on Blue Prism 
Blue Prism resourcesDavid chappal PDF bookBlue Prism BlogsVi…

Top Differences Read Today Agile vs Waterfall model

The Agile and Waterfall both models are popular in Software development. The Agile model is so flexible compared to waterfall model. Top differences on Waterfall vs Agile give you clear understanding on both the processes. Waterfall ModelThe traditional model is waterfall. It has less flexibility.Expensive and time consuming model.Less scalable to meet the demand of customer requirements.The approach is top down. Starting from requirements one has to finish all the stages, till deployment to complete one cycle.A small change in requirement, one has to follow all the stages till deployment.Waterfall model creates idleness in resource management. Agile ModelAgile model is excellent for rapid deployment of small changesThe small split-requirements you can call them as sprintsLess idleness in resource management.Scope for complete team involvement.Faster delivery makes client happy.You can deploy changes related to compliance or regulatory quickly.Collaboration improves among the team.