SQL Query Examples


 Back to the main menu

The following queries are only examples and any use of these queries in a company or critical environment signifies the prior knowledge and acceptance, on behalf of the implentor, that the authors of this software are not liable for damages or losses in use of these queries. No guarantees are made as to the quality or reliabity of the queries listed below. They are listed to help database designers/creators in their work by showing an example.


Example SELECT Query
This obtains information an account table and only returns the accounts with logins of 1 or more, ordered alphabetically by the person's name.

SELECT * FROM accounts WHERE LoginCount > 1 ORDER BY Name
Example DELETE Query
This query deletes one row of data from a product table.

DELETE FROM products WHERE ProductID=5 LIMIT 1