Creating Books_View on Books Table
--Create Books_View on Books Table to select the data from Books table.
create or replace view books_view As
select book_id, type, price, describe, author, total_amount
from books;
-- Retrieve the data from view
select * from books_view;
Result:
SQL> @C:\Users\Admin\Desktop\Oracle\books_view.sql
View created.
BOOK_ID TYPE PRICE DESCRIBE AUTHOR
---------- --------------- ---------- -------------------- --------------------
TOTAL_AMOUNT
------------
101 Environment 200 Nature Dr. Manisha
5000
102 Environment 200 Nature Dr. Manisha
5000
103 Environment 200 Nature Dr. Manisha
5000
BOOK_ID TYPE PRICE DESCRIBE AUTHOR
---------- --------------- ---------- -------------------- --------------------
TOTAL_AMOUNT
------------
104 Environment 200 Nature Dr. Manisha
5000
105 Environment 200 Nature Dr. Manisha
5000
106 Environment 200 Nature Dr. Manisha
5000
BOOK_ID TYPE PRICE DESCRIBE AUTHOR
---------- --------------- ---------- -------------------- --------------------
TOTAL_AMOUNT
------------
107 Environment 200 Nature Dr. Manisha
5000
108 Environment 200 Nature Dr. Manisha
5000
109 Environment 200 Nature Dr. Manisha
5000
BOOK_ID TYPE PRICE DESCRIBE AUTHOR
---------- --------------- ---------- -------------------- --------------------
TOTAL_AMOUNT
------------
110 Environment 200 Nature Dr. Manisha
5000
112 Environment 200 Nature Dr. Manisha
5000
113 Environment 200 Nature Dr. Manisha
5000
BOOK_ID TYPE PRICE DESCRIBE AUTHOR
---------- --------------- ---------- -------------------- --------------------
TOTAL_AMOUNT
------------
114 Environment 200 Nature Dr. Manisha
5000
115 Environment 200 Nature Dr. Manisha
5000
116 Environment 200 Nature Dr. Manisha
15 rows selected.
0 टिप्पण्या
कृपया तुमच्या प्रियजनांना लेख शेअर करा आणि तुमचा अभिप्राय जरूर नोंदवा. 🙏 🙏