# Limitations for database values

The following table lists limitations on various database values in Derby.

Table 1. Database limitations
Value | Limit
--- | ---
Maximum columns in a table | 1,012
Maximum columns in a view | 5,000
Maximum indexes on a table | 32,767 or storage capacity
Maximum tables referenced in an SQL statement or a view | Storage capacity
Maximum elements in a select list | 1,012
Maximum predicates in a WHERE or HAVING clause | Storage capacity
Maximum number of columns in a GROUP BY clause | 32,677
Maximum number of columns in an ORDER BY clause | 1,012
Maximum number of prepared statements | Storage capacity
Maximum declared cursors in a program | Storage capacity
Maximum number of cursors opened at one time | Storage capacity
Maximum number of constraints on a table | Storage capacity
Maximum level of subquery nesting | Storage capacity
Maximum number of subqueries in a single statement | Storage capacity
Maximum number of rows changed in a unit of work | Storage capacity
Maximum constants in a statement | Storage capacity
Maximum depth of cascaded triggers | 16

Parent topic: Derby limitations
Related reference
DATE, TIME, and TIMESTAMP limitations
Limitations on identifier length
Numeric limitations
String limitations
XML limitations