๐ Overview
This overview goes over setting up AI Query with a new or existing database in four simple steps.
Step 1: Create an Account
Navigate to aiquery.co (opens in a new tab), and create a new AI Query account.
Step 2: Subscribe to a Plan
When getting started with AI Query, you have a choice of subscribing to a Monthly or Yearly subscription plan. Select the subscription plan, pay and you will now be ready to start your journey.
Step 3: Setup a Database
On the AI Query Dashboard, navigate to Databases.
If you already have a database setup, simply proceed to Step 4.
If you have to setup a new database, navigate to Add New Database:
- Enter a
Namefor your database - Select the
Typeof the database
At this point, you have two options that allow you to define your database:
If you decide to go with the fastest and recommended approach:
- Click
Import From Script - Copy/paste your exported database schema from your database server
- Click
Import
If you decide to go with the manual approach:
- Click
Create First Table - Enter the
Namefor your table - Click
+ Add Columnand enter theNameandTypefor each field in the table (repeat for each field in the table) - Click
โto save - Click
+ Add Tableto repeat the steps above for each table
Step 4: Try Out a Query
On the AI Query Dashboard, navigate to Query Playground and
select the Database.
For example purposes we will use the Demo database.
Select Create Query as the Query Type for the Query Prompt.
Below is a Query Prompt we want to use to generate a SQL Query:
get all customers with more than 10 ordersNow click โถ to generate the SQL Query .
SELECT c.customer_id, c.first_name, c.last_name, COUNT(o.order_id) AS order_count
FROM Customers c
JOIN Orders o ON c.customer_id = o.customer_id
GROUP BY c.customer_id, c.first_name, c.last_name
HAVING COUNT(o.order_id) > 10;You'll see that you get a SQL Query generated based on the Query Prompt you specified! ๐คฉ