0% found this document useful (0 votes)
9 views19 pages

1.1 Types of MySQL Variables - Local Variables PDF

The document discusses local variables in MySQL, highlighting their scope and visibility within a program. It defines local variables as those that are only visible within the BEGIN-END block where they are created. The keyword DECLARE is used to create these local variables, such as v_avg_salary.

Uploaded by

ablearnfr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views19 pages

1.1 Types of MySQL Variables - Local Variables PDF

The document discusses local variables in MySQL, highlighting their scope and visibility within a program. It defines local variables as those that are only visible within the BEGIN-END block where they are created. The keyword DECLARE is used to create these local variables, such as v_avg_salary.

Uploaded by

ablearnfr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Advanced SQL Topics

Types of MySQL Variables – Local Variables


Types of MySQL Variables – Local Variables

scope
the region of a computer program where a phenomenon, such as a
variable, is considered valid
Types of MySQL Variables – Local Variables

scope
the region of a computer program where a phenomenon, such as a
variable, is considered valid
Types of MySQL Variables – Local Variables

scope
the region of a computer program where a phenomenon, such as a
variable, is considered valid
Types of MySQL Variables – Local Variables

scope
the region of a computer program where a phenomenon, such as a
variable, is considered valid


Types of MySQL Variables – Local Variables

scope
the region of a computer program where a phenomenon, such as a
variable, is considered valid


Types of MySQL Variables – Local Variables

scope =
the region of a computer program where a phenomenon, such as a
variable, is considered valid


Types of MySQL Variables – Local Variables

scope = visibility
the region of a computer program where a phenomenon, such as a
variable, is considered valid


Types of MySQL Variables – Local Variables

MySQL Variables
Types of MySQL Variables – Local Variables

MySQL Variables
Types of MySQL Variables – Local Variables

MySQL Variables

local
Types of MySQL Variables – Local Variables

MySQL Variables

local
Types of MySQL Variables – Local Variables

MySQL Variables

local
session
Types of MySQL Variables – Local Variables

MySQL Variables

local
session
Types of MySQL Variables – Local Variables

MySQL Variables

local global
session
Types of MySQL Variables – Local Variables

MySQL Variables

local global
session
Types of MySQL Variables – Local Variables

MySQL Variables

local global
session

local variable
a variable that is visible only in the BEGIN – END block in which it was
created
Types of MySQL Variables – Local Variables
DECLARE is a keyword that can be used when creating local variables only

v_avg_salary is visible only in the BEGIN - END block

You might also like