Structured Query Language (SQL)
Upcoming SlideShare
Loading in...5
×
 

Structured Query Language (SQL)

on

  • 1,313 views

Presentation on Structured Query Language (SQL)

Presentation on Structured Query Language (SQL)

Statistics

Views

Total Views
1,313
Views on SlideShare
1,313
Embed Views
0

Actions

Likes
0
Downloads
75
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Structured Query Language (SQL) Structured Query Language (SQL) Presentation Transcript

  • GROUP MEMBERS
    ADIL SHAKIRHAMMAD YOUSAF
    AMMAR YASIR HASEEB KHALID
    AWAIS AFTAB BUTTMUDDASIR ABID
    BILAL AHMED MOHAMMED IMRAN
    FAIZA KHALID RAAZIA IRSHAD
    HAMMAD RASHEED ZULQARNAIN BAJWA
  • PrEsEnTeRs
    Hammad
    Bilal
    Awais
    View slide
  • ID : 05
    View slide
  • Introduction
    • A business need
    • Database
    “An organized collection of information”
    OR
    “Set of tables each having different class of data.”
  • 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 plain English
    • To question the database
  • What SQL can do?
    With SQL you can:
    1. Execute queries against a database
    2. Perform CRUD function:
    • CREATE New databases
    New tables 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
  • Pre-requisites for SQL
    • Relational Database
    • Tables
    • Fields
    • Records
    • Different Relationships
    • 1-1
    • 1-m
  • SYNTAX
    Statement
    Table Name
    Condition
    SELECT CustomerName, City, Country FROM Customer WHERE Country=‘USA’
    Columns
    FROM Clause
    WHERE Clause
    SELECT Clause
  • ID : 11
  • QUERIES
  • SQL Queries
  • ID : 47
  • Function Queries
    Function queries in SQL involve manipulating functions in SQL statements to retrieve desired information from the database.
    Such function queries are of two broad categories:
    • Aggregate Function Queries
    • Scalar Function Queries
  • SQL JOIN QUERIES
    SQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables.
  • Inner Join
    The INNER JOIN keyword return rows when there is at least one match in both tables.
    Syntax
    SELECT column_name(s)FROM table_name1INNER JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • Outer Join
    The OUTER JOIN clause differs from the INNER JOIN in that rows are returned even when there are no matches through the JOIN critieria 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 result of A intersect B, i.e. the inner part of a venn diagram intersection.
    An outer join of A and B gives the results of A union B, i.e. the outer parts of a venn diagram union.
  • Left Outer Join
    The LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2)
    Syntax
    SELECT column_name(s)FROM table_name1LEFT JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • Right Outer Join
    The RIGHT JOIN keyword Return all rows from the right table (table_name2), even if there are no matches in the left table (table_name1)
    Syntax
    SELECT column_name(s)FROM table_name1RIGHT JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • Full Join
    The FULL JOIN keyword return rows when there is a match in one of the tables.
    Syntax
    SELECT column_name(s)FROM table_name1FULL JOIN table_name2ON table_name1.column_name=table_name2.column_name
  • THANK YOU