The Error Log stores errors. This will include trying to delete a record with foreign key constraints or any number of other possible errors you may run into. For more information, search foreign key on the Wiki. The error log is useful for diagnosing issues.
Navigate to Admin->Error Log and select the method you want to use to find the error log you are looking for. This includes Find, List, or Run Query.
This will show the actual SQL command for an error. Depending on the error this will either be filled in or not.
This will show the stack trace at the time of the error.
This will show the connection and browser information for the user at the time of the error.