Dbms
Dbms
• Description: COMMIT saves all changes made to the database, while ROLLBACK undoes
changes since the last COMMIT.
a. Commit
b. Rollback
2. COUNT
3. SUM
4. AVG
5. LIMIT
7. UNION
8. INTERSECT
Example:
INTERSECT
• Description: Returns rows from the first query that are not in the second query.
Example:
EXCEPT
10. PROJECTION
11. SELECTION
15. AS
A trigger in SQL is a database object that automatically executes a predefined action in response to
certain events (such as INSERT, UPDATE, or DELETE) on a table. Triggers are useful for enforcing
business rules, maintaining audit trails, or validating data.
ON table_name
BEGIN
END;
Trigger Scenario
We want to record new employee insertions into a log table called employee_log, which contains the
following details:
• employee_id
• name
• action
• log_time