SlideShare une entreprise Scribd logo
1  sur  35
Yasir musthafa pp
yasirmusthafapp@gmail.com
www.facebook.com/yasirmusthafa
twitter.com/yasirmusthafapp
in.linkedin.com/in/yasirmusthafapp
8891396749
Sql statements ,functions and joins
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
Sql statements
• Query or command to perform a task in a
database
3 type
1. DDL
2. DML
3. DCL
DDL
Data definition language
• Create
• Alter
• Drop
• truncate
Create
Syntax in mysql
CREATE TABLE table_name
(
column_name1 data_type(size),
column_name2 data_type(size),
....
);Example
create table tbl_stock
(
pk_int_stock_id int auto_increment,
vchr_name varchar(20),
int_quantity int,
int_price int,
primary key(pk_int_stock_id)
);
Alter
Syntax in mysql
Alter table table_name modify column
column_name data_type;
Example
alter table tbl_stock modify column int_price
float;
Drop
Syntax in mysql
Drop table table_name;
Example
Drop table tbl_student;
Truncate
Syntax in mysql
Truncate table table_name;
Example
Truncate table tbl_student;
DML
Data manipulation language
• Select
• Insert
• Update
• delete
Select
Syntax in mysql
Select * from table_name;
Example
Select * from tbl_stock;
Insert
Syntax in mysql
insert into table_name values
( );
Example
insert into tbl_stock values
(NULL,"mouse",10,500,1);
Update
Syntax in mysql
Update table_name set column_name=
Example
• update tbl_stock set int_price=int_price+1.50;
delete
Syntax in mysql
Delete from table_name;
Example
Delete from tbl_stock;
Difference between delete and truncate??
DCL
Data control language
• Grant
• Revoke
• Commit
• rollback
Grant
Syntax in mysql
GRANT privilege_type ON table_name TO
‘user_name'@'localhost';
Example
GRANT select ON tbl_supplier TO
'john'@'localhost';
Revoke
Syntax in mysql
REVOKE privilege_type ON table_name FROM
‘user_name'@'localhost';
Example
REVOKE select ON tbl_supplier FROM
'suhail'@'localhost';
functions
• Built in function-perform calculation on data
1. Aggregate function
2. Scalar function
Aggregate function
• Return a single value for all the values in the
column after calculation
AVG()
Mysql syntax
Select avg(coulmn_name) from table_name;
Example
Select avg(int_salary) from employee;
COUNT(),FIRST(),LAST(),MAX(),MIN(),SUM()
Group by
• To group the result set by one or more column
• Often used in conjunction with aggregate
function
Syntax in mysql
SELECT column_name, aggregate_function(column_name)
FROM table_name
GROUP BY column_name;
Example
Select vchr_city,sum(mark) from tbl_student group by vchr_city;
Scalar function
• Return single value for each value in a column
UCASE()
Syntax in mysql
Select UCASE (column_name) from table_name;
Example
Select UCASE(first_name) from tbl_student;
• LCASE(),MID(),LEN(),ROUND(),NOW(),FORMAT()
Joins
• Used to combine rows from two or more
tables
Different joins
• inner join
• Left join
• Right join
Inner join
• Returns all rows when there is at least one
match in BOTH tables
Syntax in mysql
Select column_name(s) from table1 join table2 on
table1.column_name=table2.column_name;
Pk_int_dept_id Vchr_dept_name
1 CS
2 EC
3 EE
4 MECH
pk_int_class_id Vchr_class_name int_dept_id
1 CS100 1
2 CC300 5
3 EC100 2
4 MECH100 4
Example
select vchr_dept_name,vchr_class_name,pk_int_dept_id,int_dept_id from
tbl_dept join tbl_classes on tbl_dept.pk_int_dept_id=tbl_classes.int_dept_id;
The result set will be
Vchr_department_
name
Vchr_class_name Pk_int_dept_id int_dept_id
CS CS100 1 1
EC EC100 2 2
MECH MECH100 4 4
Left join
• returns all rows from the left table (table1), with the matching
rows in the right table (table2).
• Syntax in mysql
SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name=table2.column_name;
Pk_int_dept_id Vchr_dept_name
1 CS
2 EC
3 EE
4 MECH
Pk_int_class_id Vchr_class_name int_dept_id
1 CS100 1
2 EC100 2
3 CC100 5
4 MECH100 4
select vchr_dept_name,vchr_class_name,pk_int_dept_id,int_dept_id from
tbl_dept LEFT join tbl_classes on
tbl_dept.pk_int_dept_id=tbl_classes.int_dept_id;
The result will be
Vchr_dept_na
me
Vchr_class_na
me
Pk_int_dept_i
d
int_dept_id
CS CS100 1 1
EC EC100 2 2
EE NULL 3 NULL
MECH MECH100 4 4
Right join
• Return all rows from the right table, and the matched rows from the left
table
Syntax in mysql
SELECT column_name(s)
FROM table1
RIGHT JOIN table2
ON table1.column_name=table2.column_name;
Pk_int_dept_id Vchr_dept_name
1 CS
2 EC
3 EE
4 MECH
Pk_int_class_id Vchr_class_name int_dept_name
1 CS100 1
2 EC100 2
4 MECH100 4
select vchr_dept_name,vchr_class_name,pk_int_dept_id,int_dept_id from
tbl_dept RIGHT join tbl_classes on
tbl_dept.pk_int_dept_id=tbl_classes.int_dept_id;
The result will be
Vchr_dept_na
me
Vchr_class_na
me
Pk_int_dept_i
d
int_dept_id
CS CS100 1 1
EC EC100 2 2
MECH MECH100 4 4
NULL CC100 NULL 5
Thank you
Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course
@ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designed
to make a quick, good software professional out of anybody who holds a passion for coding.
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square,
Hilite Business Park,
Near Pantheerankavu,
Kozhikode
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com
Contact Us

Contenu connexe

Tendances

Sql delete, truncate, drop statements
Sql delete, truncate, drop statementsSql delete, truncate, drop statements
Sql delete, truncate, drop statements
Vivek Singh
 
Intro to tsql unit 3
Intro to tsql   unit 3Intro to tsql   unit 3
Intro to tsql unit 3
Syed Asrarali
 
Database Oracle Basic
Database Oracle BasicDatabase Oracle Basic
Database Oracle Basic
Kamlesh Singh
 

Tendances (20)

Day 1b R structures objects.pptx
Day 1b   R structures   objects.pptxDay 1b   R structures   objects.pptx
Day 1b R structures objects.pptx
 
Sql delete, truncate, drop statements
Sql delete, truncate, drop statementsSql delete, truncate, drop statements
Sql delete, truncate, drop statements
 
Day 5b statistical functions.pptx
Day 5b   statistical functions.pptxDay 5b   statistical functions.pptx
Day 5b statistical functions.pptx
 
SQL Pattern Matching – should I start using it?
SQL Pattern Matching – should I start using it?SQL Pattern Matching – should I start using it?
SQL Pattern Matching – should I start using it?
 
Chapter9 more on database and sql
Chapter9 more on database and sqlChapter9 more on database and sql
Chapter9 more on database and sql
 
Data Types and Structures in R
Data Types and Structures in RData Types and Structures in R
Data Types and Structures in R
 
Dml and ddl
Dml and ddlDml and ddl
Dml and ddl
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
 
DML Commands
DML CommandsDML Commands
DML Commands
 
Ddl & dml commands
Ddl & dml commandsDdl & dml commands
Ddl & dml commands
 
3 R Tutorial Data Structure
3 R Tutorial Data Structure3 R Tutorial Data Structure
3 R Tutorial Data Structure
 
Data Fragementation
Data FragementationData Fragementation
Data Fragementation
 
JCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPYJCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPY
 
Intro to tsql unit 3
Intro to tsql   unit 3Intro to tsql   unit 3
Intro to tsql unit 3
 
Database Oracle Basic
Database Oracle BasicDatabase Oracle Basic
Database Oracle Basic
 
Commands of DML in SQL
Commands of DML in SQLCommands of DML in SQL
Commands of DML in SQL
 
R code for data manipulation
R code for data manipulationR code for data manipulation
R code for data manipulation
 
SQL Queries - DML Commands
SQL Queries - DML CommandsSQL Queries - DML Commands
SQL Queries - DML Commands
 
2
22
2
 
Normalization case
Normalization caseNormalization case
Normalization case
 

Similaire à Sql statement,functions and joins

Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
SANTOSH RATH
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
Reka
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
Sam Depp
 

Similaire à Sql statement,functions and joins (20)

Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
 
Sql
SqlSql
Sql
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
Sql
SqlSql
Sql
 
Mysql Ppt
Mysql PptMysql Ppt
Mysql Ppt
 
Mandatory sql functions for beginners
Mandatory sql functions for beginnersMandatory sql functions for beginners
Mandatory sql functions for beginners
 
Mysql1
Mysql1Mysql1
Mysql1
 
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
Views, Triggers, Functions, Stored Procedures,  Indexing and JoinsViews, Triggers, Functions, Stored Procedures,  Indexing and Joins
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
 
Mysql
MysqlMysql
Mysql
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
 
Db1 lecture4
Db1 lecture4Db1 lecture4
Db1 lecture4
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
SQL
SQL SQL
SQL
 
SQL
SQLSQL
SQL
 
Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query languageIts about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
ADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASADADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASAD
 

Plus de baabtra.com - No. 1 supplier of quality freshers

Plus de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Dernier

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Dernier (20)

ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 

Sql statement,functions and joins

  • 1.
  • 3. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 4. Sql statements • Query or command to perform a task in a database 3 type 1. DDL 2. DML 3. DCL
  • 5. DDL Data definition language • Create • Alter • Drop • truncate
  • 6. Create Syntax in mysql CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), .... );Example create table tbl_stock ( pk_int_stock_id int auto_increment, vchr_name varchar(20), int_quantity int, int_price int, primary key(pk_int_stock_id) );
  • 7. Alter Syntax in mysql Alter table table_name modify column column_name data_type; Example alter table tbl_stock modify column int_price float;
  • 8. Drop Syntax in mysql Drop table table_name; Example Drop table tbl_student;
  • 9. Truncate Syntax in mysql Truncate table table_name; Example Truncate table tbl_student;
  • 10. DML Data manipulation language • Select • Insert • Update • delete
  • 11. Select Syntax in mysql Select * from table_name; Example Select * from tbl_stock;
  • 12. Insert Syntax in mysql insert into table_name values ( ); Example insert into tbl_stock values (NULL,"mouse",10,500,1);
  • 13. Update Syntax in mysql Update table_name set column_name= Example • update tbl_stock set int_price=int_price+1.50;
  • 14. delete Syntax in mysql Delete from table_name; Example Delete from tbl_stock; Difference between delete and truncate??
  • 15. DCL Data control language • Grant • Revoke • Commit • rollback
  • 16. Grant Syntax in mysql GRANT privilege_type ON table_name TO ‘user_name'@'localhost'; Example GRANT select ON tbl_supplier TO 'john'@'localhost';
  • 17. Revoke Syntax in mysql REVOKE privilege_type ON table_name FROM ‘user_name'@'localhost'; Example REVOKE select ON tbl_supplier FROM 'suhail'@'localhost';
  • 18. functions • Built in function-perform calculation on data 1. Aggregate function 2. Scalar function
  • 19. Aggregate function • Return a single value for all the values in the column after calculation AVG() Mysql syntax Select avg(coulmn_name) from table_name; Example Select avg(int_salary) from employee; COUNT(),FIRST(),LAST(),MAX(),MIN(),SUM()
  • 20. Group by • To group the result set by one or more column • Often used in conjunction with aggregate function Syntax in mysql SELECT column_name, aggregate_function(column_name) FROM table_name GROUP BY column_name; Example Select vchr_city,sum(mark) from tbl_student group by vchr_city;
  • 21. Scalar function • Return single value for each value in a column UCASE() Syntax in mysql Select UCASE (column_name) from table_name; Example Select UCASE(first_name) from tbl_student; • LCASE(),MID(),LEN(),ROUND(),NOW(),FORMAT()
  • 22. Joins • Used to combine rows from two or more tables Different joins • inner join • Left join • Right join
  • 23. Inner join • Returns all rows when there is at least one match in BOTH tables Syntax in mysql Select column_name(s) from table1 join table2 on table1.column_name=table2.column_name;
  • 24. Pk_int_dept_id Vchr_dept_name 1 CS 2 EC 3 EE 4 MECH pk_int_class_id Vchr_class_name int_dept_id 1 CS100 1 2 CC300 5 3 EC100 2 4 MECH100 4 Example select vchr_dept_name,vchr_class_name,pk_int_dept_id,int_dept_id from tbl_dept join tbl_classes on tbl_dept.pk_int_dept_id=tbl_classes.int_dept_id;
  • 25. The result set will be Vchr_department_ name Vchr_class_name Pk_int_dept_id int_dept_id CS CS100 1 1 EC EC100 2 2 MECH MECH100 4 4
  • 26. Left join • returns all rows from the left table (table1), with the matching rows in the right table (table2). • Syntax in mysql SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name=table2.column_name;
  • 27. Pk_int_dept_id Vchr_dept_name 1 CS 2 EC 3 EE 4 MECH Pk_int_class_id Vchr_class_name int_dept_id 1 CS100 1 2 EC100 2 3 CC100 5 4 MECH100 4 select vchr_dept_name,vchr_class_name,pk_int_dept_id,int_dept_id from tbl_dept LEFT join tbl_classes on tbl_dept.pk_int_dept_id=tbl_classes.int_dept_id;
  • 28. The result will be Vchr_dept_na me Vchr_class_na me Pk_int_dept_i d int_dept_id CS CS100 1 1 EC EC100 2 2 EE NULL 3 NULL MECH MECH100 4 4
  • 29. Right join • Return all rows from the right table, and the matched rows from the left table Syntax in mysql SELECT column_name(s) FROM table1 RIGHT JOIN table2 ON table1.column_name=table2.column_name;
  • 30. Pk_int_dept_id Vchr_dept_name 1 CS 2 EC 3 EE 4 MECH Pk_int_class_id Vchr_class_name int_dept_name 1 CS100 1 2 EC100 2 4 MECH100 4 select vchr_dept_name,vchr_class_name,pk_int_dept_id,int_dept_id from tbl_dept RIGHT join tbl_classes on tbl_dept.pk_int_dept_id=tbl_classes.int_dept_id;
  • 31. The result will be Vchr_dept_na me Vchr_class_na me Pk_int_dept_i d int_dept_id CS CS100 1 1 EC EC100 2 2 MECH MECH100 4 4 NULL CC100 NULL 5
  • 33. Want to learn more about programming or Looking to become a good programmer? Are you wasting time on searching so many contents online? Do you want to learn things quickly? Tired of spending huge amount of money to become a Software professional? Do an online course @ baabtra.com We put industry standards to practice. Our structured, activity based courses are so designed to make a quick, good software professional out of anybody who holds a passion for coding.
  • 34. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Give a feedback @ massbaab.com/baabtra Thanks in advance www.baabtra.com | www.massbaab.com |www.baabte.com
  • 35. Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com Contact Us