Views. Logical data is how we want to see the current data in our database. Physical data is how this data is actually placed in our database.

Slides:



Advertisements
Similar presentations
Views-basics 1. 2 Introduction a view is a perspective of the database different users may need to see the database differently; this is achieved through.
Advertisements

Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
View (virtual table). View A VIEW is a virtual table A view contains rows and columns, just like a real table. The fields in a view are fields from one.
4-1 Copyright  Oracle Corporation, All rights reserved. Types of Joins Equijoin Non-equijoin Outer join Self join.
Basic SQL Introduction Presented by: Madhuri Bhogadi.
MySQL. To start go to Login details: login: labuser password:macimd15 – There.
6.830/6.814 Lecture 5 Database Internals Continued September 17, 2014.
Copyright  Oracle Corporation, All rights reserved. 10 Creating and Managing Tables.
Introduction To SQL Lynnwood Brown President System Managers LLC Copyright System Managers LLC 2003 all rights reserved.
SQL Components DML DDL DAL. Overview u Getting the records onto the disk - mapping u Managing disk space u SQL Modes u Ceating database.
View Sen Zhang. Views are very common in business systems users view of data is simplified a form of security - user sees only the data he/she needs to.
View and Materialized view. What is a view? Logically represents subset of data from one or more table. In sql, a view is a virtual relation based on.
Introduction to Oracle9i: SQL1 Views. Introduction to Oracle9i: SQL2 Chapter Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE.
Security, Transactions, and Views. Security Achieved through GRANT & REVOKE Assumes the database can recognize its users and verify their identity can.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
Relational Model Concepts. The relational model represents the database as a collection of relations. Each relation resembles a table of values. A table.
1 ICS 184: Introduction to Data Management Lecture Note 10 SQL as a Query Language (Cont.)
-Software School of Hunan University-
SQL (DDL & DML Commands)
1 ICS 184: Introduction to Data Management Lecture Note 11: Assertions, Triggers, and Index.
Nested Queries (Sub Queries) A nested query is a form of a SELECT command that appears inside another SQL statement. It is also termed as subquery. The.
ACTION QUERIES (SQL COMMANDS ) STRUCTURED QUERY LANGUAGE.
1 Information Retrieval and Use (IRU) CE An Introduction To SQL Part 1.
STRUCTURED QUERY LANGUAGE Chandra S. Amaravadi 1.
An Introduction To SQL - Part 1 (Special thanks to Geoff Leese)
1 Agenda for Class 03/07/2006  Learn to simplify queries for complex questions through the use of views.  Concept of a view.  Syntax to create and access.
제 2 장 SQL 활용.  SQL 활용 예제 (1) create table student ( id int not null, name char(20) not null, age int, height int, weight float, primary key(id) ); insert.
SQL FUNDAMENTALS SQL ( Structured Query Language )
DATA MANIPULATION andCONTROL
10 Creating and Managing Tables Objectives At the end of this lesson, you will be able to: Describe the main database objects Create tables Describe.
Security, Transactions, and Views. About Security As is the case in most shared environments, the DBMS also must implement a security mechanism that allows.
Nitin Singh/AAO RTI ALLAHABAD 1 SQL Nitin Singh/AAO RTI ALLAHABAD 2 OBJECTIVES §What is SQL? §Types of SQL commands and their function §Query §Index.
Database Programming Sections 11 & 12 – Creating, and Managing Views, Sequences, Indexes, and Synonymns.
Copyright  Oracle Corporation, All rights reserved. 10 Creating and Managing Tables.
CpSc 3220 The Language of SQL The Language of SQL Chapters
SQL SeQueL -Structured Query Language SQL SQL better support for Algebraic operations SQL Post-Relational row and column types,
Chapter 13 Views Oracle 10g: SQL. Oracle 10g: SQL2 Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE VIEW command Employ the.
Copyright  Oracle Corporation, All rights reserved. 12 Creating Views.
Functional dependency: a relationship between two attributes (or sub-sets of attributes) in a relational database, such that the value of the first attribute.
VIEWS A view is like a window through which one can view or change information in the table. Although view does not contain any data of their own. They.
Indexes- What?  Optional structures associated with tables  Provides a quick access path to table data  You can create indexes on one or more columns.
ORDER BY clause in SELECT command: Normally, the result of the query will not be in ordered format. If we want to get the result of the query in specific.
Copyright س Oracle Corporation, All rights reserved. 12 Creating Views.
CSCI N311: Oracle Database Programming 5-1 Chapter 15: Changing Data: insert, update, delete Insert Rollback Commit Update Delete Insert Statement –Allows.
Advanced SQL. SQL - Nulls Nulls are not equal to anything - Null is not even equal to Null where columna != ‘ABC’ --this will not return records where.
CSED421 Database Systems Lab View. Page 2  Virtual or logical table which is defined as SELECT query with joins  Act as table but not real data, only.
IFS180 Intro. to Data Management Chapter 10 - Unions.
Creating Indexes Database Systems Objectives Distinguish between the indexes that are created automatically and those that are created manually.
Oracle – SQL 10g.
CpSc 3220 The Language of SQL
Insert, Update and the rest…
PL/SQL LANGUAGE MULITPLE CHOICE QUESTION SET-1
Introduction to Database Systems, CS420
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
Interacting with the Oracle Server
Generalization.
جملة الاستعلام الأساسية
JOINS.
What Is a View? EMPNO ENAME JOB EMP Table EMPVU10 View
Workbench Data Definition Language (DDL)
Data base System Concepts & Data Modeling
Data Control Language Grant, Revoke.
Chapter 2 Views.
مقدمة في قواعد البيانات
Chapter 2 Views.
So What are Views and Triggers anyway?
Updating Databases With Open SQL
Introduction to Relational databases
Integrity Constraints
Updating Databases With Open SQL
Presentation transcript:

Views

Logical data is how we want to see the current data in our database. Physical data is how this data is actually placed in our database.

Views may be created for the following reasons :- Provides data security Simplifies queries Can be queried as a table itself. Avoids data redundancy. Prevents updating a record as DBA knows you are really working with a subset of a record.

Creation of views Syntax Create view as Select, ……. from where = ; Example SQL> Create view emp_view as select eno, ename, salary from emp where salary>=5000;

Rename the columns of a view SQL> create view emp_view as select eno,ename,salary, dno from emp where eno between 10 and 100; (give existing view name )

Update table join views SQL> Create view ex_v1 as select emp.eno, emp.ename, emp.dno, dept.dname from emp,dept where dept.dno=emp.dno;

Destroying a view Syntax Drop view Example SQL> drop view emp_xx;

Example SQL>create view v1 as select * from emp; SQL>create view v1 (emp_name,salary) as select ename, salary from emp; SQL> Select * from user_views;

Check option Std Rollno Namecreate table Sub1 Sub2 Sub3 SQL> Create view std_best as select rollno,name,sub1,sub2,sub3 from std where sub3>=90 with check option;

Update option SQL> Create view v2 (eno,ename,salry) as select eno,ename, salary*2 from emp; SQL> select * from v2; SQL>create view v3 (deptno, salary) as select dno,sum(salary) from emp group by dno;

SQL> Create view h1 as select ename, salary from emp where salary>=5000 with check option; SQL> insert into h1 values (‘ram’,7000); SQL> insert into h1 values (‘ravi’,3000); (Not insert )