Hi Mohan - since users can use multiple roles, and the data partitions are usually attached to roles, we would not know this as there is no mechanism to say what data partition was in use when a user created a ticket. That information is not kept anywhere. As for the second one - this is complex. The way that users are linked to their access type is via the usp_contact table. The UUID in the usp_contact table is mapped to the UUID in the ca_contact table. The CA Contact table is where you will find the userID etc. So you will have to build some joins between the ca_contact and usp_contact, and then usp_contact to the access_type_v2 table where the access types are stored. Unfortunately something like this is outside the scope of support, so we are not able to assist you on this one. You can see if other folks here in the communities have done that before and may be willing to share thier work with you. Additionally, just as a side note, it would be a better practice to differentiate those cases in a different way, possibly by using a custom field that is a checkbox or something so that you can easily pull a report of those cases if needed, without having to build all sorts of custom joins etc.
Hope this helps a bit.
Thanks,
Jon I.