top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are SQL Views? How we can create them?

0 votes
371 views
What are SQL Views? How we can create them?
posted Aug 1, 2014 by Rahul Mahajan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

A view is a virtual table based on the result-set of an SQL statement. 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.
Syntax for Creating Views:
CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

answer Aug 5, 2014 by Amanpreet Kaur
0 votes

A view is nothing more than a SQL statement that is stored in the database with an associated name. A view is actually a composition of a table in the form of a predefined SQL query.

A view can contain all rows of a table or select rows from a table. A view can be created from one or many tables which depends on the written SQL query to create a view.

Views, which are kind of virtual tables, allow users to do the following:

Structure data in a way that users or classes of users find natural or intuitive.

Restrict access to the data such that a user can see and (sometimes) modify exactly what they need and no more.
Summarize data from various tables which can be used to generate reports

The basic CREATE VIEW syntax is as follows:

CREATE VIEW view_name AS
SELECT column1, column2.....
FROM table_name
WHERE [condition];

.

answer Nov 17, 2014 by Manikandan J
...