Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Views in SQL 
 

A View is a virtual or imaginary table based on the outcome of a SELECT statement.

 

Views in SQL

                         

A View is a virtual or imaginary table based on the outcome of a SELECT statement. A view include rows and columns as real table. A view include a fields is similar to one or more real tables in database. A view of a table does not store a data.

Understand with Example

The Tutorial illustrate an example from 'View in SQL'. To understand this example we create a table 'customer'. The create table is used to create a table customer with required field attribute and data type respectively.

 

 

 

 

Create Table 'customer':

create table customer(First_Name varchar(15),Last_Name varchar(15),Address varchar(15),City varchar(15),Country varchar(15));

Insert values into Table 'customer':

The insert into add the records or rows to the table 'customer'.

To see the detail of table 'customer':

The Select keywords returns you the set of records from table 'customer'.

select * from  customer;

 

Create View 'viewCustomer':

Now we apply view on Table 'customer'. The create VIEW is used to create a view 'viewCustomer' that contain the first_name,last_name and country field name  from table 'customer',

create VIEW viewCustomer as SELECT First_Name,Last_Name,Country
FROM Customer;

View Details :

The select  return the set of records or rows from 'viewCustomer'.

select * from viewCustomer;

Output is displayed as :

                         

» View all related tutorials
Related Tags: sql mysql c table io multiple sed column ip definition name columns rename tab if to ini modify e it

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.