Table Setup
BigQuery Setup
Step 1: Create a Google Cloud Project
Create a new Google project by following the first three steps here.
Note: In step 2, you will be asked to enable billing in your Google Cloud Project. Since the table you will work with is very small and BigQuery has a free tier, executing the small queries shown in the video won't cost anything. Make sure to delete the table you create when you're done.
Suggested name for the Google Cloud Project:
claude-skills-laborskills-training-labNote your
Project ID
Step 2: Create a Dataset
- Go to console.cloud.google.com/bigquery
- Click the three dots next to your project ID
- Click "Create dataset"
- Dataset ID:
marketing - Choose your region (e.g.,
us-west1) - Click Create Dataset
Step 3: Upload CSV Data
- Click the three dots next to your
marketingdataset - Click "Create table"
- Source: Upload → select your CSV file (campaign_performance_4weeks.csv)
- Table name:
campaign_performance - Schema: Check "Auto detect"
- Click Create table
BigQuery MCP Server Setup
To create the credentials needed to connect to BigQuery, there is more than one option. You can review them here. For this course, we went with the option of creating a service account.
Step 1: Create a Service Account
- Go to console.cloud.google.com/iam-admin/serviceaccounts
- Select your project (e.g.,
claude-skills-lab) - Click "Create Service Account"
- Name:
claude-bigquery-reader - Click Create and Continue
- Grant roles:
roles/bigquery.dataViewerroles/bigquery.user
- Click Continue and then Done
Step 2: Create JSON Key
- Click on the service account you just created
- Go to the Keys tab
- Click Add Key → Create new key
- Choose JSON
- Download the file (keep it safe!)
Step 3: Add MCP to Claude Desktop Config
Install the MCP toolbox (you only need to install the toolbox server; you don't need to run it)
In Claude Desktop, go to:
Settings→Developer→Edit Configand add:
{
"mcpServers": {
"bigquery": {
"command": "./PATH/TO/toolbox",
"args": ["--prebuilt","bigquery","--stdio"],
"env": {
"BIGQUERY_PROJECT": "your_BigQuery_Project_ID",
"GOOGLE_APPLICATION_CREDENTIALS":"path/to/JSON_Key"
}
}
}
}
- Restart Claude Desktop to load the new settings.
References
SQLite Setup
There is more than one way to create a SQLite database. Here's the Pythonic way.
Step 1: Install pandas (if needed)
pip install pandas
Step 2: Write the Python script
import pandas as pd
import sqlite3
# Read the CSV file
df = pd.read_csv('yourfile.csv')
# Connect to SQLite database (creates it if it doesn't exist)
conn = sqlite3.connect('mydatabase.db')
# Import CSV data into a table
df.to_sql('tablename', conn, if_exists='replace', index=False)
# Close the connection
conn.close()
Step 3: Run the script
python your_script.py
This will create the database mydatabase.db in your current working directory.
Step 4: Verify the import
import sqlite3
conn = sqlite3.connect('mydatabase.db')
cursor = conn.cursor()
# Check the data
cursor.execute('SELECT * FROM tablename LIMIT 5')
print(cursor.fetchall())
conn.close()