상세 컨텐츠

본문 제목

[오라클 DB 스터디] View

프로그래밍 도서

by DeepinDev 2025. 4. 22. 08:51

본문

Overview of Views

A view is a logical representation of one or more tables. In essence, a view is a stored query.

A view derives its data from the tables on which it is based, called base tables. Base tables can be tables or other views. All operations performed on a view actually affect the base tables. You can use views in most places where tables are used.

 

Views enable you to tailor the presentation of data to different types of users. Views are often used to:

  • Provide an additional level of table security by restricting access to a predetermined set of rows or columns of a table
  • Hide data complexity. For example, a single view can be defined with a join, which is a collection of related columns or rows in multiple tables. However, the view hides the fact that this information actually originates from several tables. A query might also perform extensive calculations with table information. Thus, users can query a view without knowing how to perform a join or calculations.
  • Present the data in a different perspective from that of the base table. For example, the columns of a view can be renamed without affecting the tables on which the view is based.
  • Isolate applications from changes in definitions of base tables. For example, if the defining query of a view references three columns of a four column table, and a fifth column is added to the table, then the definition of the view is not affected, and all applications using the view are not affected.
  • [From Oracle Database Concepts]
뷰는 한개이상의 테이블로부터 논리적으로 만든 테이블이다. 이는 저장된 쿼리를 의미한다. 
뷰는 Base Table로부터 만들어진다. Base table은 테이블이 될수도 있고 다른 뷰가 될수도 있다. 
뷰에 대해서 작업하는 것은 실제로 base table에 영향을 끼친다.
뷰를 쓰는 목적은 다음과 같다. 
- 미리 정해놓은 컬럼과 행을 사용하도록 만들어 테이블 정보를 보호하기 위해 
- 복잡한 데이터 조합을 감추기 위해
- base table로부터 데이터를 보여줄때 다른 관점으로 보여줄 수 있음(e.g. base table의 컬럼이름을 변경하여 표시)
- base table의 정의를 변경할때 독립적으로 어플리케이션을 다룰수 있음

관련글 더보기

댓글 영역