0% found this document useful (0 votes)
100 views2 pages

Six Clauses of SQL Queries

The document describes the syntax and usage of the SQL SELECT statement. It groups records by student and filters for those enrolled in 2 or more classes, ordering the output by highest grade. The SELECT statement includes the columns to display, tables to query from, join conditions to link tables, optional grouping and filtering with HAVING, and ordering with ORDER BY.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views2 pages

Six Clauses of SQL Queries

The document describes the syntax and usage of the SQL SELECT statement. It groups records by student and filters for those enrolled in 2 or more classes, ordering the output by highest grade. The SELECT statement includes the columns to display, tables to query from, join conditions to link tables, optional grouping and filtering with HAVING, and ordering with ORDER BY.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Counts number of

classed enrolled in

Groups by each
student

Filter condition to
show only students
who have enrolled
in 2 or more classes

Orders the output


Output by maximum grade
first.
Syntax of Select
1. Includes the
column to be shown These two are
mandatory
2. From the tables

Example Usage of Select 3. The join condition to link the


tables in 2, so the relevant rows can
be fetched

4. Grouping on the fields in select if


records needs to be cosolidated

5. Having clause to filter the records


based on the gropping.
Union to
join two set 6. Order by a field in select

Sub query

You might also like