Update database system

Update system and format to match SQL more closely. Add `where`
function.