Views

278 views
217 views

Published on

Published in: Technology, Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
278
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Views

  1. 1. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  2. 2. VIEWS IN SQL WASEEM HASSAN wazeeem456@gmail.com www.facebook.com/waseem hassan twitter.com/ in.linkedin.com/in/ +919567850028
  3. 3. What is a view? • A view is a “virtual” table that is derived from other tables • 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. • We 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
  4. 4. SQL CREATE VIEW SYNTAX CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition;
  5. 5. SQL CREATE VIEW Example • CREATE VIEW Current_Product_ List AS SELECT ProductID,ProductName FROM Products WHERE Discontinued=No; The view "Current Product List" lists all active products (products that are not discontinued) from the "Products" table. The view is created with the following SQL
  6. 6. We can query the view above as follows: • SELECT * FROM [Current Product List];
  7. 7. SQL Updating a View • We can update a view by using the following syntax: • SQL REPLACE VIEW Syntax • REPLACE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition
  8. 8. • SQL Dropping a View • You can delete a view with the DROP VIEW command. • SQL DROP VIEW Syntax • DROP VIEW view_name
  9. 9. THANK YOU……..
  10. 10. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  11. 11. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com

×