added database + sql code