database code designe