Find T × U, and find T natural join U, given the tables below:
| name | favoriteColor |
|---|---|
| Bert | green |
| Nell | red |
| Ken | blue |
| name | age |
|---|---|
| Bert | 5 |
| Nell | 6 |
| Ken | 7 |
SQL functions include count, avg, sum, min, max (and, if you love statistics, stddev). Equivalent functions are provided in spreadsheets, but with SQL we can also combine the functions with select conditions.
Examples:
Database software may provide tools for:
Data integrity tools can't prove that data are correct — that's too hard — but can sometimes prove that changes to the data would be incorrect and disallow them.
Design a form for input of pets.
Design a report to show pets with their departments and managers Sorting in reports; in SQL (order by … asc, order by … desc)
Single-user database systems like MS Access and Openoffice.org Base provide:
Multi-user (enterprise-scale) database systems provide even more. Numerous commercial products including Oracle, IBM DB2, MS SQL Server; also high-quality free products including PostgreSQL, MySQL. Their additional advantages include:
Database systems power internet commerce. Programming languages, such as Python or Java, can be integrated with database systems: the program sends SQL statements to the database server, and processes their results, possibly writing a web page in HTML. This provides information for the millions. It also reminds us of the need for proper security in database systems, since any computer system on the internet is subject to intrusion attempts.