sql training institute in ambala ! batra computer centre

19
Email: [email protected] om BATRA COMPUTER CENTRE ISO CERTIFIED 9001:2008 Website: Ph. No.: 8222066670, 4000670

Upload: jatin-batra

Post on 12-Apr-2017

12 views

Category:

Education


0 download

TRANSCRIPT

Page 1: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

BATRA COMPUTER CENTREISO CERTIFIED 9001:2008

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Page 2: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Introduction๏A Business need๏Database

“An organized collection if information”Or

“Set of tables each having different class of data”

Page 3: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Structured Query Language (SQL)๏A language to communicate with the database๏A tool to retrieve the required information from database๏Elements

» Syntax of SQL is in plains English» To question the database

Page 4: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

What SQL can do?1. Execute queries against a database2. Perform CRUD function:

» CREATE New database New table in a database Records in a database» READ Retrieve data from a database» Update Update Records in a database» DELETE Delete records from a database

Page 5: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Page 6: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Pre – requisites for SQL๏ Relational Database๏ Tables๏ Fields๏ Records๏ Different Relationships

» 1-1» 1-m

Page 7: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

SYNTAX

Page 8: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

SQL Queries

Page 9: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Function QueriesFunction queries in SQL involve manipulating functions in SQL statements to retrieve desired information from the databaseSuch function queries are of two board categories:» Aggregate Function queries

» Scalar Function queries

Page 10: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Page 11: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

SQL join QueriesSQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables.

Page 12: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Inner JoinThe Inner JOIN keyword return rows when there is an least one match in both tablesSyntaxSELECT column_name(s)

FROM table_name1INNER JOIN table_name2ON table_name1.column_name=table_name2.column_name

Page 13: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Outer JoinThe outer join clause differs from the INNER JOIN in that row are returned even when there are no matches through the JOIN criteria on the second table.Difference Explained:Assuming you’re joining on columns with no

duplicates, which is by far the most common case:An Inner join of A and B gives the results of A intersect B, i.e. the inner part of a Venn diagram intersectionAn outer join of A and B gives the results of A union B, i.e. the outer parts of a Venn diagram union

Page 14: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Left Outer JoinThe left JOIN Keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2)SyntaxSELECT column_name(s)FROM table_name1LEFT JOIN table_name2ON table_name1.column_name=table_name2.column_name

Page 15: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Right Outer JoinThe RIGHT JOIN Keyword Return all rows from the right table (table_name2), even if there are no matches in the left table (table_name2)SyntaxSELECT column_name(s)FROM table_name1LEFT JOIN table_name2ON table_name1.column_name=table_name2.column_name

Page 16: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Full JoinThe FULL JOIN keyword return rows when there is a match in one of the tables.SyntaxSELECT column_name(s)FROM table_name1LEFT JOIN table_name2ON table_name1.column_name=table_name2.column_name

Page 17: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

Page 18: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670

ADDRESS:

SCO -15, Dayal Bagh,

Near Hanuman Mandir

Ambala Cantt-133001

Haryana

Ph. No.: 9729666670, 8222066670 &0171-4000670

Email ID: [email protected]

Website: www.batracomputercentre.com

Page 19: SQL Training Institute in Ambala ! Batra Computer Centre

Email: [email protected]

Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670