Home » SQL


SQL - VIEW SQL - DUAL: Here, we will learn what is VIEW, how to create VIEW and how it reflects on the tables?
Submitted by Shubham Singh Rajawat, on November 14, 2017

A VIEW is a virtual table, through wish we can select a small portion of data from one or more table, and it restricts the access on the original table/data. Any changes done on data in view will reflect on the tables from which data is taken.

A DUAL is a special one column and one row which can be used to do small calculations and operations etc.

Sample table (Student),

alter table in sql example


1) Create a view from the student table

CREATE VIEW first_view AS SELECT student_name, City from Student;

To view this table we need to use SELECT query.

SELECT * FROM first_view;

Here, first_view : it is the name of the virtual table

views in sql example

2) Use DUAL to get current date


Will return current date from the system.

SQL - DUAL in sql example

Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.