Database design & basic queries