Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
After completing this lesson, you should be able to do the following: Describe a view Create, alter the definition of, and drop a view Retrieve data through a view Insert, update, and delete data through a view Create and use an inline view Perform “Top-N” analysis | Creating Views Schedule: Timing Topic 20 minutes Lecture 20 minutes Practice 40 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe a view Create, alter the definition of, and drop a view Retrieve data through a view Insert, update, and delete data through a view Create and use an inline view Perform “Top-N” analysis Lesson Aim In this lesson, you learn how to create and use views. You also learn to query the relevant data dictionary object to retrieve information about views. Finally, you learn to create and use inline views, and perform Top-N analysis using inline views. Database Objects Description Basic unit of storage; composed of rows and columns Logically represents subsets of data from one or more tables Generates primary key values Improves the performance of some queries Alternative name for an object Object Table View Sequence Index Synonym What is a View? EMPLOYEES Table: What Is a View? You can present . | Creating Views Schedule: Timing Topic 20 minutes Lecture 20 minutes Practice 40 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe a view Create, alter the definition of, and drop a view Retrieve data through a view Insert, update, and delete data through a view Create and use an inline view Perform “Top-N” analysis Lesson Aim In this lesson, you learn how to create and use views. You also learn to query the relevant data dictionary object to retrieve information about views. Finally, you learn to create and use inline views, and perform Top-N analysis using inline views. Database Objects Description Basic unit of storage; composed of rows and columns Logically represents subsets of data from one or more tables Generates primary key values Improves the performance of some queries Alternative name for an object Object Table View Sequence Index Synonym What is a View? EMPLOYEES Table: What Is a View? You can present logical subsets or combinations of data by creating views of tables. A view is a logical table based on a table or another view. A view contains no data of its own but is like a window through which data from tables can be viewed or changed. The tables on which a view is based are called base tables. The view is stored as a SELECT statement in the data dictionary. Instructor Note Demo: 11_easyvu.sql Purpose: The view shown on the slide is created as follows: CREATE OR REPLACE VIEW simple_vu AS SELECT employee_id, last_name, salary FROM employees; Why Use Views? To restrict data access To make complex queries easy To provide data independence To present different views of the same data Advantages of Views Views restrict access to the data because the view can display selective columns from the table. Views can be used to make simple queries to retrieve the results of complicated queries. For example, views can be used to query information from multiple tables without the user knowing how to