How to access and use the Query page
The Feedback Query page is a powerful troubleshooting tool for Mindful Support engineers and other front-line employees who work with client data. On the Query page, you can execute read-only SQL queries to the MySQL database used by Mindful Feedback. Advanced super admins can create and re-use queries to solve common troubleshooting tasks that require analyzing a range of data for specific users or clients.
Quick access: Super-Admin Functions > Misc > Query
To access the Query page, you must log in as a super admin. To run a query:
- Open the page from the side navigation menu.
- Enter your query in the New SQL Query field, then click Run Query.
- Review the results below.
DB Schema
Before you can create queries to search the database, you need to know what is available to search. You can view the complete Feedback DB schema here.
- This schema is only available to Medallia employees, and should never be shared outside of the organization.
- The Query page offers read-only access. This means that statements like INSERT, DELETE, or UPDATE cannot be used.
Example Use Cases
Example #1 - Find a Customer ID From a User Email Address
In the example screenshot above, we want to find the name of the client (customer) who a particular user belongs to. Looking at the DB schema, we notice a few things:
- We see that the users table contains a customer_id field, which is an integer. So we can identify the client by ID, but not by name.
- We see that the customers table contains a name field, which is a varchar (text). This will be the client name. We also see that the customers table contains an ID, which we can match up to the customer_id in the users table.
SELECT customers.name
FROM customers
INNER JOIN users
ON users.customer_id = customers.id
WHERE users.email = "name@email.com"Example #2 - Find a Customer Name From a Survey ID
In this example, we want to find the name of the client associated with a particular survey, and we know the Survey ID. The story behind this use case is almost identical to the first example, but this time we use the surveys table to find a Customer ID, then match that ID to the associated entry in the customers table.
SELECT customers.name
FROM customers
INNER JOIN surveys ON surveys.customer_id = customers.id
WHERE surveys.id = "XYZ"
