Data extracting from database