Introduction to MySQL Programming
Instructor: Sriya Ivaturi
Overview of MySQL
➢ What is MySQL:
○ An open-source relational database management system (RDBMS) that uses SQL to store,
manage, and retrieve data.
➢ MySQL Architecture:
○ Follows a client-server model with components like the MySQL Server (processing queries),
storage engines (InnoDB, MyISAM), and client programs.
➢ MySQL Tools (Workbench / CLI):
○ MySQL Workbench provides a GUI for database design and administration; the MySQL
Command-Line Client allows executing SQL commands directly.
Basic SQL in MySQL
➢ Data Definition Language (DDL)
➢ Data Manipulation Language (DML)
➢ Data Control Language (DCL)
MySQL Data Types
➢ Numeric
➢ String
➢ Date/Time
MySQL Programming Elements
➢ Variables – Store temporary data for use within queries or stored programs.
➢ Comments – Add explanations or notes inside SQL code without affecting execution.
➢ Control Flow Statements – Direct the logic of execution using IF, CASE, LOOP, WHILE, and REPEAT.
➢ Cursors – Retrieve and process rows from a query result set one at a time.
➢ Condition Handlers (Error Handling) – Catch and handle errors or warnings during execution.
➢ Stored Routines (Procedures/Functions) – Group reusable SQL code blocks for repeated tasks.
➢ Triggers – Automatically run code in response to INSERT, UPDATE, or DELETE events on tables.