SQL is categorized based on its functional scope, primarily into four types: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Data Query Language (DQL). DDL operates on database structures like schemas, tables, indexes, and views. Core commands are C...
What Are Database Triggers? A trigger is a specialized database object that automatically executes in response to certain events on a specific table or view. Unlike regular stored procedures, triggers cannot be invoked manually—they fire automatically when INSERT, UPDATE, or DELETE operations occur...
Table Definition Syntax CREATE TABLE table_name ( column1 data_type constraint, column2 data_type constraint ); Column Naming Convensions Avoid using numeric-only identifiers. Special characters are prohibited. Recommended practice: Use descriptive, snake_case names like employee_id or department_na...
Mapper Mapping File <?xml version="1.0" encoding="UTF-8" ?> <mapper namespace="EmployeeMapper"> <!-- Return type for insert/update/delete is `int`, so `resultType` is not needed. `insert`, `update`, `delete` tags don't have `resultType` but support `param...
Data Definition Language (DDL) DDL encompasses commands used to define and modify database schema structures. These operations affect the organization and properties of database objects rather than the data itself. Key commands include: CREATE: Establishes new database objects ALTER: Modifies existi...