W3schools: SQL Views
W3schools: SQL Views
w3schools.com
SQL Views
❮ Previous Next ❯
A view contains rows and columns, just like a real table. The fields in a view are fields from
one or more real tables in the database.
You can add SQL functions, WHERE, and JOIN statements to a view and present the data as
if the data were coming from one single table.
Note: A view always shows up-to-date data! The database engine recreates the data, using
the view's SQL statement, every time a user queries a view.
The following SQL creates a view that shows all customers from Brazil:
Example
Try it Yourself »
Example
Try it Yourself »
The following SQL creates a view that selects every product in the "Products" table with a
price higher than the average price:
Example
Try it Yourself »
Example
https://www.w3schools.com/sql/sql_view.asp 2/9
11/19/2018 SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements
Try it Yourself »
The following SQL adds the "City" column to the "Brazil Customers" view:
Example
Try it Yourself »
https://www.w3schools.com/sql/sql_view.asp 3/9
11/19/2018 SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements
Example
Try it Yourself »
❮ Previous Next ❯
https://www.w3schools.com/sql/sql_view.asp 4/9
11/19/2018 SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements
COLOR PICKER
HOW TO
Tabs
Dropdowns
Accordions
Side Navigation
Top Navigation
https://www.w3schools.com/sql/sql_view.asp 5/9
11/19/2018 SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements
Modal Boxes
Progress Bars
Parallax
Login Form
HTML Includes
Google Maps
Range Sliders
Tooltips
Slideshow
Filter List
Sort List
SHARE
CERTIFICATES
HTML, CSS, JavaScript, PHP, jQuery, Bootstrap and XML.
Read More »
https://www.w3schools.com/sql/sql_view.asp 6/9
11/19/2018 SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements
https://www.w3schools.com/sql/sql_view.asp 7/9
11/19/2018 SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements
REPORT ERROR
PRINT PAGE
FORUM
ABOUT
Top 10 Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
SQL Tutorial
PHP Tutorial
jQuery Tutorial
Python Tutorial
Top 10 References
HTML Reference
CSS Reference
JavaScript Reference
W3.CSS Reference
Bootstrap Reference
SQL Reference
PHP Reference
HTML Colors
jQuery Reference
Python Reference
Top 10 Examples
HTML Examples
CSS Examples
JavaScript Examples
How To Examples
W3.CSS Examples
Bootstrap Examples
PHP Examples
jQuery Examples
Angular Examples
XML Examples
Web Certificates
HTML Certificate
CSS Certificate
JavaScript Certificate
jQuery Certificate
PHP Certificate
Bootstrap Certificate
XML Certificate
https://www.w3schools.com/sql/sql_view.asp 8/9
11/19/2018 SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements
W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and
basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot
warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use,
cookie and privacy policy. Copyright 1999-2018 by Refsnes Data. All Rights Reserved.
Powered by W3.CSS.
https://www.w3schools.com/sql/sql_view.asp 9/9