SQL is a specialized language for updating, deleting, and requesting information from databases. SQL is an ANSI and ISO standard, and is the standard database query language. Database products from Oracle and Microsoft SQL Server supports SQL. Certified by ANSI and ISO, SQL has become a database query language standard.It serves both industry-level and academic needs and is used on both individual computers and corporate servers. The SQL queries are the most common and essential SQL operations. Via an SQL query, one can search the database for the information needed. SQL queries are executed with the “SELECT” statement.SELECT retrieves data from one or more tables, or expressions.
A query includes a list of columns to be included in the final result immediately following the
SELECT
keyword. An asterisk ("*
") can also be used to specify that the query should return all columns of the queried tables. SELECT
is the most complex statement in SQL, with optional keywords and clauses that include:- The
FROM
clause which indicates the table(s) from which data is to be retrieved. TheFROM
JOIN
subclauses to specify the rules for joining tables. clause can include optional - The
WHERE
clause includes a comparison predicate, which restricts the rows returned by the query. TheWHERE
clause eliminates all rows from the result set for which the comparison predicate does not evaluate to True. - The
GROUP BY
clause is used to project rows having common values into a smaller set of rows.GROUP BY
is often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. TheWHERE
clause is applied before theGROUP BY
clause. - The
HAVING
clause includes a predicate used to filter rows resulting from theGROUP BY
GROUP BY
clause, aggregation functions can be used in theHAVING
clause predicate. clause. Because it acts on the results of the - The
ORDER BY
clause identifies which columns are used to sort the resulting data, and in which direction they should be sorted (options are ascending or descending). Without anORDER BY
clause, the order of rows returned by an SQL query is undefined.
What Can SQL do?
- SQL can execute queries against a database
- SQL can retrieve data from a database
- SQL can insert records in a database
- SQL can update records in a database
- SQL can delete records from a database
- SQL can create new databases
- SQL can create new tables in a database
- SQL can create stored procedures in a database
- SQL can create views in a database
- SQL can set permissions on tables, procedures, and views
No comments:
Post a Comment