Database with tables and constraints