select * from sheets

Run SQL on Google Sheets™ for advanced data analysis and processing

Get Started →
demo

Advanced analysis

Leverage the full power of SQL: join or union data from multiple sheets, apply window functions, use common table expressions, and more.
SELECT
    deps.Name AS Department,
    emps."Full Name" AS Employee,
    emps."Annual Salary" AS Salary,
    SUM("Annual Salary") OVER (
      PARTITION BY
        emps."Department Id"
    ) AS TotalSalaryPerDepartment
  FROM
    "Employees!A1:N1001?headers=1" AS emps
  JOIN "Departments!A1:B8?headers=1" AS deps
  WHERE emps."Department Id" = deps.Id
  
UPDATE "Tasks!A1:H500?headers=1"
    SET Status = 'Overdue',
    LastUpdated = DATETIME('now'),
    OverdueReason = 'Missed deadline'
WHERE DueDate < DATETIME('now')
  AND Status  NOT IN ('Completed', 'Cancelled')
  AND Priority IN ('High', 'Urgent')

Bulk updates

The UPDATE statement enables advanced batch updates in Google Sheets, supporting complex filtering, dynamic calculations, and efficient large-scale modifications.

Bulk deletes

The DELETE statement offers a precise way to remove rows based on complex conditions, enabling efficient and consistent data management compared to manual methods in Google Sheets.
DELETE FROM "Tasks!A1:H500?headers=1"
    WHERE Status IN ('Completed', 'Cancelled')
    AND ProjectID IN (101, 102)
    AND Tags NOT LIKE '%Critical%'
    AND LastUpdated < DATE('now', '-30 days')
  
INSERT INTO
    "A2:D2"
    SELECT
      json_extract(value, '$.flag') flag,
      json_extract(value, '$.cca3') cca3,
      json_extract(value, '$.name.common') name
    FROM
      json_each(
        fetch (
          'https://restcountries.com/v3.1/all'
        )
      )
    

Bulk inserts

The INSERT statement enables you to merge data from multiple sheets into one and import JSON data from any API.

Pay as you go pricing

Buy query credits to use the product whenever you need to — no monthly subscription required.
SELECT * FROM SheetQuery.Pricing
    
    -----------------------
    | Key      | Value    |
    -----------------------
    | 1 query  | 1 credit |
    | 1 credit | $0.02    |
    -----------------------
    
Get Started →