Category Archives: SQL

SQL Tutorial

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,… Read More »

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 ID Title Price Description 1 Learn SQL 20 Learn SQL language 2 Learn MySQL 22 Learn MySQL language 3 HTML book 17 Learn HTML 4 Learn PHP 20 Introduction to PHP 5 Learn… Read More »

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 ID Title Price Description 1 Learn SQL 20 Learn SQL language 2 Learn MySQL 22 Learn MySQL language 3 HTML book 17 Learn HTML 4 Learn PHP 20 Introduction to PHP 5 Learn… Read More »

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 ID Title Price Description 1 Learn SQL 20 Learn SQL language 2 Learn MySQL 22 Learn MySQL language 3 HTML book 17 Learn HTML 4 Learn PHP 20 Introduction to… Read More »

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 ID Title Price Description 1 Learn SQL 20 Learn SQL language 2 Learn MySQL 22 Learn MySQL language 3 HTML book 17 Learn HTML 4 Learn PHP… Read More »

SQL AVG

SQL AVG The SQL AVG function returns the average in a select query. AVG syntax SELECT AVG(table_column) FROM table_name; AVG example Coder books table ID Title Price Description 1 Learn SQL 20 Learn SQL language 2 Learn MySQL 22 Learn MySQL language 3 HTML book 17 Learn HTML 4 Learn PHP 20 Introduction to PHP 5 Learn PHP… Read More »

SQL Having

SQL Having The SQL HAVING is typically used with a GROUP BY clause. The HAVING is used to return records where aggregate values meet the specified conditions. Having syntax SELECT column_name1, column_name2, function(column_name1) FROM table_name GROUP BY column_name1, column_name2 HAVING function(column_name1) operator value Having example Coder books table ID Title Price Description 1 Learn SQL 20 Learn SQL… Read More »

SQL Group By

SQL Group By The SQL GROUP BY is used when at least one of the aggregation functions is used in a select query. The aggregate functions are: count, max, min, sum, avg. Group By syntax SELECT column_name1, column_name2, function(column_name1) FROM table_name GROUP BY column_name1, column_name2 Group By example Coder books table ID Title Price Description 1 Learn SQL… Read More »

SQL Order By

SQL Order By The SQL ORDER BY is used to sort the records of a select query. Order By syntax SELECT * FROM table_name ORDER BY column_name ASC | DESC; Order By example Coder books table ID Title Price Description 1 Learn SQL 20 Learn SQL language 2 Learn MySQL 22 Learn MySQL language 3 HTML book 17… Read More »

SQL Like

SQL Like The SQL LIKE is used to return lines if the operand matches a pattern in a select query. Like syntax SELECT * FROM table_name WHERE column_name LIKE pattern; Like example Coder books table ID Title Price Description 1 Learn SQL 20 Learn SQL language 2 Learn MySQL 22 Learn MySQL language 3 HTML book 17 Learn… Read More »