You are on page 1of 9

QUERY NAME: Creating a Table.

A table is created by using the QUERY 'create table table name' along with the attribute's names and their
respective data types.

SYNTAX:

OUTPUT:

QUERY NAME: INSERT INTO statement


The INSERT INTO statement is used to insert new records in a table.

SYNTAX:

OUTPUT:

QUERY NAME: SELECT Statement


The SELECT* statement is used to select all datas from a database.
SYNTAX:

OUTPUT:

QUERY NAME: SELECT statement


The SELECT statement is used to select data from a database.

SYNTAX:

OUTPUT:

QUERY NAME: DROP TABLE Statement


The DROP TABLE statement is used to drop an existing table in a database.

SYNTAX:

QUERY NAME: SELECT DISTINCT Statement


The SELECT DISTINCT statement is used to return only distinct (different) values.

SYNTAX:

OUTPUT:
QUERY NAME: WHERE clause
The WHERE clause is used to filter records.

SYNTAX:

OUTPUT:

QUERY NAME: MATHEMTICAL EXPRESSION


SYNTAX:

OUTPUT:

QUERY NAME: Aliases

SQL aliases are used to give a table, or a column in a table, a temporary name.

An alias is created with the AS keyword.

SYNTAX:

OUTPUT:
QUERY NAME: LIKE OPERATER

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.

There are two wildcards often used in conjunction with the LIKE operator:

  The percent sign (%) represents zero, one, or multiple characters


  The underscore sign (_) represents one, single character

SYNTAX:

OUTPUT:

QUERY NAME: IN OPT


SYNTAX:

OUTPUT:

QUERY NAME: NOT IN


SYNTAX:

OUTPUT:

QUERY NAME: ORDER BY ASC


SYNTAX:

OUTPUT:
QUERY NAME: ORDER BY DESC
SYNTAX:

OUTPUT:

QUERY NAME: BETWEEN CLAUSE


SYNTAX:

OUTPUT:

QUERY NAME: NOT BETWEEN CLAUSE


SYNTAX:

OUTPUT:
QUERY NAME: UNION operator
The UNION operator is used to combine the result-set of two or more SELECT statements.

SYNTAX:

OUTPUT:

QUERY NAME: NULL VALUES


A field with a NULL value is a field with no value.

SYNTAX:

OUTPUT:

QUERY NAME: RENAME


SYNTAX:

OUTPUT:
QUERY NAME: INDEX
SYNTAX:

OUTPUT:

QUERY NAME: ALTER TABLE


The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.

SYNTAX:

OUTPUT:

QUERY NAME: DROP INDEX


The DROP INDEX statement is used to delete an index in a table

SYNTAX:

QUERY NAME: AGGREGATE FUNCTION (MAXIMUM)


The MAX () function returns the largest value of the selected column

SYNTAX:

OUTPUT:
QUERY NAME: MIN
The MIN () function returns the smallest value of the selected column

SYNTAX:

OUTPUT:

QUERY NAME: COUNT


The COUNT () function returns the number of rows that matches a specified criterion.

SYNTAX:

OUTPUT:

QUERY NAME: AVG


The AVG () function returns the average value of a numeric column.

SYNTAX:

OUTPUT:

QUERY NAME: SUM


The SUM () function returns the total sum of a numeric column.

SYNTAX:

OUTPUT:

QUERY NAME: GROUP BY


The GROUP BY statement groups rows that have the same values into summary rows,

SYNTAX:
OUTPUT:

You might also like