Simple View


  • Based on a single table
  • Doesn’t use functions, joins, or group operations
  • Updatable (INSERT/UPDATE/DELETE allowed)

 



======================================================================

CREATE VIEW simple_emp_view1 AS
SELECT emp_id, first_name,salary FROM emp1 fetch first 5 rows only;

select * from simple_emp_view1;



======================================================================

INSERT & UPDATE

INSERT INTO emp1 (emp_id, first_name, salary) VALUES (777, 'SUNNYBUNNY', 2398.32);

UPDATE emp1 SET salary = 9999.99 WHERE emp_id < 200;

select * from simple_emp_view1;





delete from emp1 where emp_id=777; 

select * from simple_emp_view1 where emp_id=777;   -- NO result