Designing and building the database