• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar

Coder Tutorial

  • Home
  • HTML
  • CSS
  • PHP
  • SQL
  • MySQL
  • JS
  • PL/SQL
  • Python
  • Java
  • Oracle

SQL

SQL tutorial

SQL Tutorial is an quick way to learn the basic elements of SQL language.
The basic SQL commands are: create, alter, drop, insert, update, delete.
Learn how to use DDL (Data Definition Language) commands and DML Statements (Data Manipulation Language).
DDL consists of defining the objects of a database. The objects of the database are: tables, columns, indexes, constraints.
DML represent commands that manipulate the database. The DML commands are: insert, update, delete.

SQL tutorial

  • SQL Create Table
  • SQL Drop Table
  • SQL Insert
  • SQL Update
  • SQL Delete
  • SQL Select
  • SQL Distinct
  • SQL Where
  • SQL And – Or
  • SQL Between
  • SQL Like
  • SQL Order By
  • SQL Group By
  • SQL Having
  • SQL AVG
  • SQL Count
  • SQL SUM
  • SQL MAX
  • SQL MIN

Filed Under: SQL

SQL MIN

SQL MIN

The SQL MIN function returns the minimum value in a select query.

MIN syntax

SELECT MIN(table_column)
FROM table_name;

MIN example

Coder books table

IDTitlePriceDescription
1Learn SQL20Learn SQL language
2Learn MySQL22Learn MySQL language
3HTML book17Learn HTML
4Learn PHP20Introduction to PHP
5Learn PHP20PHP course
SELECT MIN(price) 
FROM coder_books;

Result

17

SELECT price, MIN(price) min_price
FROM coder_books
GROUP BY price
HAVING count(*) > 1;

Result

Pricemax_price
2020

Filed Under: SQL

SQL MAX

SQL MAX

The SQL MAX function returns the maximum value in a select query.

MAX syntax

SELECT MAX(table_column)
FROM table_name;

MAX example

Coder books table

IDTitlePriceDescription
1Learn SQL20Learn SQL language
2Learn MySQL22Learn MySQL language
3HTML book17Learn HTML
4Learn PHP20Introduction to PHP
5Learn PHP20PHP course
SELECT MAX(price) 
FROM coder_books;

Result

22

SELECT price, MAX(price) max_price
FROM coder_books
GROUP BY price
HAVING count(*) > 1;

Result

Pricemax_price
2020

Filed Under: SQL

SQL SUM

SQL SUM

The SQL SUM function returns the sum value of all rows in a select query.

SUM syntax

SELECT SUM(table_column)
FROM table_name;

SUM example

Coder books table

IDTitlePriceDescription
1Learn SQL20Learn SQL language
2Learn MySQL22Learn MySQL language
3HTML book17Learn HTML
4Learn PHP20Introduction to PHP
5Learn PHP20PHP course
SELECT SUM(price) 
FROM coder_books;

Result

99

SELECT price, SUM(price) sum_price
FROM coder_books
GROUP BY price
HAVING count(*) > 1;

Result

Pricesum_price
2060

Filed Under: SQL

SQL Count

SQL Count

The SQL COUNT function returns the number of the rows in a select query.

COUNT syntax

SELECT COUNT(*) FROM table_name;

SELECT COUNT(column_name) FROM table_name;

COUNT example

Coder books table

IDTitlePriceDescription
1Learn SQL20Learn SQL language
2Learn MySQL22Learn MySQL language
3HTML book17Learn HTML
4Learn PHP20Introduction to PHP
5Learn PHP20PHP course
SELECT COUNT(*) 
FROM coder_books;

Result

5

SELECT COUNT(price) 
FROM coder_books 
WHERE price >= 20;

Result

4

SELECT price, COUNT(price) no_count
FROM coder_books
GROUP BY price
HAVING COUNT(*) > 1;

Result

Priceno_count
203

Filed Under: SQL

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to Next Page »

Primary Sidebar

Tutorials

  • HTML Tutorial
  • CSS Tutorial
  • PHP Tutorial
  • SQL Tutorial
  • MySQL Tutorial
  • JavaScript Tutorial
  • Python Tutorial
  • PL/SQL Tutorial
  • Java Tutorial
  • SQLPlus Tutorial
  • Oracle Tutorial
  • PostgreSQL Tutorial
  • Ruby Tutorial

Secondary Sidebar

    • SQL Tutorial
    • SQL Create Table
    • SQL Drop Table
    • SQL Insert
    • SQL Update
    • SQL Delete
    • SQL Select
    • SQL Distinct
    • SQL Where
    • SQL And – Or
    • SQL Between
    • SQL Like
    • SQL Order By
    • SQL Group By
    • SQL Having
    • SQL AVG
    • SQL Count
    • SQL SUM
    • SQL MAX
    • SQL MIN

Copyright  2018 - 2020 Coder Tutorial

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.