Just copied the sql queries