SQL syntax Language 

Table of contents

Retrieving data. SELECT statement

1.Simple SELECT statements.
2.Eliminating duplicate rows. The DISTINCT keyword.
3.Sorting the result set. The ORDER BY clause.
4.Filtering Rows. The WHERE clause.
5.Comparison predicates.
6.Logical operations AND, OR, and NOT and three-valued logic (3VL).
7.Checking the value to fall within a range. The BETWEEN predicate.
8.Checking the value to be in a set. The IN predicate.
9.Renaming the fields, and calculations in result set.
10.Finding a substring. The LIKE predicate.
11.Checking the availability/absence of a value. The IS NULL predicate.
12.Summary values. Aggregate functions.
13.Grouping rows. The GROUP BY clause.
14.Filtering data by summary values. The HAVING clause.
15.Ordering clauses in SELECT statement.
16.The SELECT statement syntax.
17.Using multiple tables in a query. The FROM clause.
18.Cartesian product and equi-joins.
19.Renaming tables. Using qualifying names for identification of fields.
20.Join operations. The JOIN clauses.
21.The realization of set-theoretic operations with the SELECT statement.
22.Checking availability of records. The EXISTS predicate.
23.Using the SOME|ANY and ALL keywords.
24.Subqueries in the WHERE clause.
25.Subqueries in the FROM and SELECT clauses.
26.Type conversions.
27.CASE statement.
28.Functions Transact-SQL handling datetime data types.
29.String functions in MS SQL SERVER 2000

Data modification statements

30.INSERT statement.
31.UPDATE statement.
32.DELETE statement.

Appendices

33.Appendix 1. About educational databases.
34.Appendix 2. The list of exercises.

How to do it in SQL?

1.How to combine the values of two columns into one without use of UNION and JOIN?
2.How to add a new column into the table between the available columns?
3.How to select TOP N rows from a table for each group?
4.How to delete duplicate rows in the table?
5.How to delete duplicates in the presence of a primary key?
6.How to calculate running totals?
7.How to construct a query that selects all columns except a certain one without specifying them?





Index | Next

Home SELECT exercises (rating stages) DML exercises Developers