SQL

SQL GROUP BY

The SQL GROUP BY clause is used in conjunction with the SELECT statement to organize the same data into groups. This GROUP BY clause follows the WHERE clause in the SELECT statement. Syntax SELECT columnname(s) FROM tablename WHERE condition GROUP BY columnname(s) ORDER BY columnname(s);   Example Let’s take a example table “STUDENTS”. ID NAME …

SQL GROUP BY Read More »

SQL Syntax

The syntax of structured query language is a unique set of rules and guidelines. The Syntax of SQL is defined and maintained by ISO and ANSI standards. SQL keywords are NOT case sensitive SELECT and select is same in SQL statements. Some Most Important Statements In SQL:   SQL SELECT Statement Fetches data from a …

SQL Syntax Read More »

SQL BETWEEN Operator

SQL BETWEEN operator checks if the value is within the range of values.The values can be numbers, text, or dates. It can be used in the SELECT, INCLUDE, UPDATE, or Delete statement. Syntax SELECT columnname(s) FROM tablename WHERE columnname BETWEEN value1 AND value2;   Example Consider the following table named “Students”. Id Name Address DOB …

SQL BETWEEN Operator Read More »

SQL UNION Operator

The SQL UNION operator is used to combine the result sets of 2 or more SELECT statements.It Removes duplicate rows between various SELECT statements. To use this UNION operator, each SELECT statement must have The same number of columns selected. The same number of column expressions. Type the same data and have it in the …

SQL UNION Operator Read More »

SQL MIN and MAX Functions

SQL MIN() & MAX() functions are used to find the lowest(minimum) value and largest(maximum) value of the column. SQL MIN() Function The MIN() function provides the lowest value of the selected column. Syntax SELECT MIN(columnname) FROM tablename WHERE condition;   SQL MAX() Function Function MAX () provides the largest value of the selected column. Syntax …

SQL MIN and MAX Functions Read More »

SQL UNIQUE Constraint

The UNIQUE constraint prevents two records from having the same values ​​in a column.The UNIQUE constraint guarantees that all values ​​in a column are unique. The UNIQUE and PRIMARY KEY both provide a guarantee for uniqueness of column or column sets. SQL UNIQUE Constraint – CREATE TABLE The following SQL query creates a table called …

SQL UNIQUE Constraint Read More »