Learn SQL

using MySQL 

Prateek Narang

Let's Learn

  • Programming Languages

  • C++ History

  • C++ Advantages & Applications

SELECT – the columns in the result set
FROM – names the base table(s) from which results will be retrieved

WHERE – specifies any conditions for the results set (filter)
ORDER BY – sets how the result set will be ordered
LIMIT – sets the number of rows to be returned

SELECT Statement

Variable name: A label for a memory location

Value: The something that would be stored in a variable

Storage: A place where data can be stored

Declaration: Announcing a variable (usually) at the beginning of a program

Naming convention: A set of rules about the names of variables

Assignment: Giving (setting) a variable a value

Variables

// Valid names
int topics = 3
int marks = 20
int student_1 = 5

// Invalid Names
1_student = 8;

Naming Convention

  • For variable name we can use uppercase and lowercase letters, digits from 1 to 9 and underscore(_).
  • First character must be underscore or letter.
  • C++ is strongly typed language. So every variable needs to be declare before using it

Variable Initialisation

Variables when just declared have garbage value until they are assigned a value for the first time.

We can assign a specific value from the moment variable is declared, called as initialisation of variable.

// Declare
int marks;

// Declare + Assign (Init)
int x = 10;

CODE DEMO

Made with Slides.com