SQL 9
SQL 9
syllabus
2022-23
Chapter 9
Structured
Query
Language
MySQL Features
Open Source & Free of Cost:
It is Open Source and available at free of cost.
Portability:
Small enough in size to instal and run it on any types of Hardware
and OS like Linux,MS Windows or Mac etc.
Security :
Its Databases are secured & protected with password.
Connectivity
Various APIs are developed to connect it with many programming
languages.
Query Language
It supports SQL (Structured Query Language) for handling
database.
Visit : python.mykvs.in for regular updates
SQL
Now we write query–select * from student order by class asc, marks asc;
Name Purpose
SUM() Returns the sum of given column.
MIN() Returns the minimum value in the given column.
MAX() Returns the maximum value in the given column.
AVG() Returns the Average value of the given column.
COUNT() Returns the total number of values/ records as per given
column.
Query result will be unique occurrences of class values along with counting of
students(records) of each class(sub group).
MySQL GROUP BY with aggregate functions (with where and order by clause)
we are having student table with following data.
Query result will be unique occurrences of class values where class<10 along
with average marks of each class(sub group) and descending ofer of marks.
Visit : python.mykvs.in for regular updates
SQL
Types of JOIN
Following are the types of JOIN that we can use in SQL:
Inner
Outer
Left
Right
Natural JOIN(⋈)
Natural Join is a type of Inner join which is based on
column having same name and same datatype present in
both the tables to be joined.E.g.
Select * from a natural join b;
Mysql query –
Select * from a left outer join b on
(a.name=b.name) union Select *
from a right outer join b on
(a.name=b.name) ;