Query to create database