Inserting and Querying data