SQL Day2
SQL Day2
joins
----
-----------
Natural join
select *
from emp e
INNER JOIN projects p
on e.emp_id=p.emp_id;
select *
from emp e
NATURAL JOIN projects p
-----
select *
from studnet s
INNER JOIN marks m
on e.emp_id=p.emp_id;
select *
from emp e
NATURAL JOIN projects p
------------
Has join
============================
Self JOin
========================================================
VIEW:
Updating a View
A view can be updated under certain conditions which are given below −
All NOT NULL columns from the base table must be included in the view in order for
the INSERT query to function.
===================================================================================
=============
Triggers
UPDATE employees
SET salary = salary + 1000.0
commit;
Stored Procedure