Final sql script