Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is a view?

Answers were Sorted based on User's Feedback



What is a view?..

Answer / sandip gele

In view,we can create virtual table with the columns from
different tables by relation between them, we can use this
view as a table for selecting a data but we can't use view
to insert data.

Is This Answer Correct ?    2 Yes 0 No

What is a view?..

Answer / yuvaraja

SQL: VIEWS

------------------------------------------------------------
--------------------

A view is, in essence, a virtual table. It does not
physically exist. Rather, it is created by a query joining
one or more tables.

Creating a VIEW
The syntax for creating a VIEW is:

CREATE VIEW view_name AS
SELECT columns
FROM table
WHERE predicates;



For example:

CREATE VIEW sup_orders AS
SELECT suppliers.supplier_id, orders.quantity, orders.price
FROM suppliers, orders
WHERE suppliers.supplier_id = orders.supplier_id
and suppliers.supplier_name = 'IBM';

This would create a virtual table based on the result set
of the select statement. You can now query the view as
follows:

SELECT *
FROM sup_orders;



Updating a VIEW
You can update a VIEW without dropping it by using the
following syntax:

CREATE OR REPLACE VIEW view_name AS
SELECT columns
FROM table
WHERE predicates;



For example:

CREATE or REPLACE VIEW sup_orders AS
SELECT suppliers.supplier_id, orders.quantity, orders.price
FROM suppliers, orders
WHERE suppliers.supplier_id = orders.supplier_id
and suppliers.supplier_name = 'Microsoft';



Dropping a VIEW
The syntax for dropping a VIEW is:

DROP VIEW view_name;

For example:

DROP VIEW sup_orders;



Frequently Asked Questions

------------------------------------------------------------
--------------------

Question: Can you update the data in a view?

Answer: A view is created by joining one or more tables.
When you update record(s) in a view, it updates the records
in the underlying tables that make up the view.

So, yes, you can update the data in a view providing you
have the proper privileges to the underlying tables.


------------------------------------------------------------
--------------------

Question: Does the view exist if the table is dropped from
the database?

Answer: Yes, in Oracle, the view continues to exist even
after one of the tables (that the view is based on) is
dropped from the database. However, if you try to query the
view after the table has been dropped, you will receive a
message indicating that the view has errors.

If you recreate the table (that you had dropped), the view
will again be fine.

Is This Answer Correct ?    2 Yes 0 No

What is a view?..

Answer / guest

If we have several tables in a db and we want to view only
specific columns from specific tables we can go for views.
It would also suffice the needs of security some times
allowing specfic users to see only specific columns based on
the permission that we can configure on the view. Views also
reduce the effort that is required for writing queries to
access specific columns every time.

Is This Answer Correct ?    1 Yes 0 No

What is a view?..

Answer / prakash.s

Views are simply called as mirror table or virtual table.
Feild of one table can be updated inside the view.
Updation of more than one table inside the views is not
possible.

Is This Answer Correct ?    1 Yes 0 No

What is a view?..

Answer / sachin ladda

In view,we can list out different column from different
table in one virtual table..

Is This Answer Correct ?    2 Yes 1 No

What is a view?..

Answer / kalyan

A View is a named virtual table that is defined by a query
and used for a table

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

How to create new tables with "create table" statements in ms sql server?

0 Answers  


Explain nested stored procedure. Syntax and an example for create nested stored procedure?

0 Answers  


Difference between uniqe index and uniqe constraint?

0 Answers  


here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row then o/p will be id name 1 a 3 c 4 d next inssert 2nd row and i want o/p will be id name 1 a 2 e 3 c 4 d

7 Answers   IBM, TCS,


How can you see what type of locks used?

1 Answers  


What do you understand by mirroring and mention the advantages of the mirroring?

0 Answers  


What kind of problems occurs if we do not implement proper locking strategy?

0 Answers  


Explain the different types of backups available in sql server? : sql server database administration

0 Answers  


how to know Who Is Blocking Your SQL Server?

4 Answers  


Can sql server 2016 run on windows 7?

0 Answers  


Explain about system stored procedure?

0 Answers  


How to connect php with different port numbers?

0 Answers  


Categories