ASK Question

Quick links:
Latest articles
Internship
Members

Languages:
C
C++
C++ STL
Java
Data Structure
C#.Net
Android
Kotlin
SQL

Web:
PHP
Python
JavaScript
CSS
Ajax
Node.js
Web prog.

Programs:
C
C++
DS
Java
C#
Python


Aptitude:
C
C++
Java
DBMS

Interview:
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


Home » SQL

SQL - VIEW AND DUAL



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

Examples:

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

SELECT SYSDATE() FROM DUAL;

Will return current date from the system.

SQL - DUAL in sql example





Quick links:
C FAQ(s) C Advance programs C/C++ Tips & Tricks Puzzles JavaScript CSS Python Linux Commands PHP Android Articles More...

Was this page helpful? Please share with your friends...

Are you a blogger? Join our Blogging forum.

Comments and Discussions




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 (2015-2018), Some rights reserved.