The Google Fusion Tables API v1 has been deprecated as of May 3rd, 2016. The API will continue to work until August 1st, 2017, and will shut down on that date. A migration guide is available outlining the steps to take to migrate to v2.

Reference

Important: The Fusion Tables SQL API has been officially deprecated as of June 26, 2012 and will be shut down after January 14, 2013. Please see the migration guide for instructions on how to move to the new API.

Audience

This documentation is intended for programmers who are writing client applications that interact with Google Fusion Tables. It is assumed that you are familiar with the concepts of Google Fusion Tables API programming, as described in the Developer's Guide. This Reference contains syntax and rules for constructing Google Fusion Tables API calls.

Syntax Conventions

In the syntaxes shown in this Reference, the following conventions are used:

SymbolMeaning
{ }The clause within the braces is optional.
|A vertical pipe separates items in a list when any one item can be used.
*An asterisk placed after a syntax clause indicates zero or more clauses of that form can be used, separated by commas.

General syntax rules

The Google Fusion Tables API supports a subset of the SQL querying language, including SELECT, INSERT, UPDATE, and DELETE statements, as well as additional statements for getting information about tables. When using these statements in a Google Fusion Tables API application:

  • Submit SHOW TABLES, CREATE TABLE, and CREATE VIEW statements with the encid parameter to obtain table IDs in the response as encrypted strings.

  • Submit SHOW TABLES, DESCRIBE, and SELECT statements as HTTP GET requests to the following URL, where <statement> follows the syntax in SHOW TABLES, DESCRIBE, or SELECT:

    https://www.google.com/fusiontables/api/query?sql=<statement>

  • Submit INSERT, UPDATE, and DELETE statements as HTTP POST requests to the following URL:

    https://www.google.com/fusiontables/api/query

    In the body of the POST, include a sql=<statement> parameter, where <statement> follows the syntax in INSERT, UPDATE, or DELETE.

  • With each API call, whether a GET or POST request, include an Authorization header in order to maintain the established authentication. For more information, see Authentication.
  • If your programming environment requires it, escape the space characters in the Google Fusion Tables API statement. For example, some environments may require that you replace spaces in URLs with "%20" or spaces in bash scripts with "+".
  • Unlike in SQL, do not place a semicolon (;) at the end of a statement. The exception is when constructing a list of INSERT statements.

URL encoding

A note before we launch into the API: URL encoding is required in all URL parameters in GET and POST requests, including within Google Fusion Tables API statements. In the examples and syntaxes shown in our documentation, we omit this encoding to make the statements more readable.

SHOW TABLES

To get the names and encrypted IDs of tables to which your application has access, use the following syntax in an HTTP GET request (omit the encid parameter if you want to obtain numeric table IDs):

SHOW TABLES encid=true

Returns

Zero or more lines, each containing a comma-separated table ID and table name.

Example

Note: The example is shown without the required URL encoding for the sake of readability. If you cut and paste, run it through an encoder before use.

SHOW TABLES encid=true

Example output:

table id,name
1e7y6mtqv891111111111_aa123aaaa_CvWhg9gc,Volunteers
1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc,Airline Routes
1e7y6mtqv893zzz33_cc456cccc33_CvW9gc3333,Cities
1qcv1e7y689444444yyy4_dddd789dd_CvWh778c,MV Sales
1e7y6mtqv8922jjj22222_bbb246bbb579kkh9lu,MV Sales
1v1e7y689cdf6666sss66_fffff579f33nmihgpo,StoreInventory
1e7y6mtqv899hhh_999sdfjj226jccj98_jjg9ss,SaleInformation
1mqv1e7y68977_77aaa7s962s_CvWhg9gcabcdef,Animal Food

DESCRIBE

To get the names and data types of the columns in tables to which your application has access, use the following syntax in an HTTP GET request:

DESCRIBE <table_id>
SyntaxDescription
<table_id> The unique table ID of the table from which you want to get data. It must be a table on which you have the necessary permissions.

Returns

Zero or more lines, each containing a comma-separated column ID, column name, and data type. The data type is one of the types listed under <type> in the CREATE TABLE syntax.

Example

Note: The example is shown without the required URL encoding for the sake of readability. If you cut and paste, run it through an encoder before use.

DESCRIBE 1mqv1e7y68977_77aaa7s962s_CvWhg9gcabcdef

Example output:

column id,name,type
col0,animal,string
col1,favorite_food,string
col4,population size,number
col5,location,location
col6,timestamp,datetime

CREATE TABLE

To create a new table, use the following syntax in an HTTP POST request:

CREATE TABLE <table_name> (<column_name>: <type> {, <column_name>: <type>}*)

Note: To obtain the table ID as an encrypted string, add the encid parameter to your authenticated POST request to the URL below.

https://www.google.com/fusiontables/api/query?encid=true
SyntaxDescription
<table_name>A name for the table.

Can include letters, numbers, white space, and special characters. If the table name is anything besides a letter followed by letters, digits, and underscore characters or if it is a reserved keyword, surround the name with quotes. Examples: 'My Table', 'Birds&Reptiles', and 'circle'.
<column_name>A name for a column in the new table.

Can include letters, numbers, white space, and special characters. If the column name is anything besides a letter followed by letters, digits, and underscore characters or if it is a reserved keyword, surround the name with quotes. Examples: 'Volcano Name', 'SELECT', and 'circle'. Note: Column names are case sensitive.

In addition to the column names you specify in the CREATE TABLE statement, Google Fusion Tables creates a column named ROWID that contains an automatically-assigned, unique ID number for each row.
<type>The type of data that will be stored in the column. One of the following:

Returns

If successful, returns the table ID of the new table. If any column is not set to one of the supported types, returns the error "Unknown column type."

Example

Note: The example is shown without the required URL encoding for the sake of readability.

CREATE TABLE 'Animal Food' (animal: STRING, fav_food: STRING, 'population size': NUMBER, location: LOCATION, timestamp: DATETIME)

Example output:

tableid
1e7y6mtqv8922jjj22222_bbb246bbb579kkh9lu

CREATE VIEW

To create a new view, use the following syntax in an HTTP POST request:

CREATE VIEW <view_name>

AS (SELECT  <column_spec> {, <column_spec>}*

FROM <table_id>

{WHERE <filter_condition> { AND <filter_condition> }*})

Note: To obtain the table ID as an encrypted string, add the encid parameter to your authenticated POST request to the URL below.

https://www.google.com/fusiontables/api/query?encid=true
https://developers.google.com/fusiontables/docs/developers_guide#encid
SyntaxDescription
<view_name>A name for the view.

Can include letters, numbers, white space, and special characters. If the view name is anything besides a letter followed by letters, digits, and underscore characters or if it is a reserved keyword, surround the name with quotes. Examples: 'My View' and 'circle'.
<column_spec>

Tells which columns you want to include in the new view.

Use any of the following:

  • <column_name> — described later in this table.
  • <column_name> AS <alias> — alias described later in this table.
  • * — use an asterisk to retrieve all columns in the table. Note: * is not supported in FusionTablesLayer queries. Use <location_column> instead.

The base table's implicit ROWID column will automatically be part of the view. Row IDs for rows included in the view will be the same as they are in the base table.

<column_name>The name of a column in the table. Case sensitive. To find out what columns are available in a given table, use DESCRIBE. If the column name is anything besides a letter followed by letters, digits, and underscore characters or if it is a reserved keyword, surround the name with quotes; examples, 'Volcano Name', 'SELECT', and 'circle'. Note: Column names are case sensitive.
<alias>A name for the column in the view. If the alias is anything besides a letter followed by letters, digits, and underscore characters or if it is a reserved keyword, surround the name with quotes; examples, 'Geological feature', 'SELECT', and 'circle'.
<table_id>The unique table ID of the table from which you want to create the view. It must be a table on which you have the necessary permissions.

Note: You cannot create views for a merged table.

<filter_condition>

A Boolean expression (returns TRUE or FALSE). Only table rows where the condition is TRUE will be included in the results of the SELECT. Use AND to combine multiple filters into a single query. OR is not supported.

<column_condition>

Used in the WHERE clause. The syntax is: <column_name> <operator> <value>

<column_name> is described earlier in this table.

For <operator>, use only =.

The <value> can be either of the following:

  • <number> — a floating point number or integer.
  • '<string>' — a text string in quotes. If the string contains quote characters, precede each quote character with a backslash (\).

Setting this equality is very powerful. It restricts data that can be inserted into the new view. Any new data has to match the value specified in the equality. For example, if your equality statement is 'location' = 'Spain', any new rows added to the view must have a location equal to "Spain".

If the column on which the equality is based is not included in the view, the value will be set automatically for all new rows added to the view. For example, new rows in the view will automatically be assigned the value 'Spain' in the 'location' column of the base table.

Formulas and variables are not supported.

Returns

If successful, returns the table ID of the new view.

Examples

Note: The examples are shown without the required URL encoding for the sake of readability. If you cut and paste, run it through an encoder before use.

To create a view from table 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc with the location as "Canada":

CREATE VIEW animals AS (SELECT * FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE location = 'Canada')

Example output:

tableid
1v1e7y689cdf6666sss66_fffff579f33nmihgpo

To create a view with two columns, animal and region, from table 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc:

CREATE VIEW animals AS (SELECT animal, location AS region FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc)

Example output:

tableid
1e7y6mtqv899hhh_999sdfjj226jccj98_jjg9ss

To create a view with two columns, animal and favorite_food, from table 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc with the location as "China":

CREATE VIEW animals AS (SELECT animal, favorite_food AS food FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE location = 'China')

Example output:

tableid
1mqv1e7y68977_77aaa7s962s_CvWhg9gcabcdef

SELECT

To query for data, use the following syntax in an HTTP GET request:

SELECT  <column_spec> {, <column_spec>}* FROM <table_id>

{ WHERE <filter_condition> | <spatial_condition> { AND <filter_condition> }* }

{ GROUP BY <column_name> {, <column_name>}* }

{ ORDER BY <column_spec> { ASC | DESC } | <spatial_relationship> }

{ OFFSET <number> }

{ LIMIT <number> }

Note: Fusion Tables returns data in UTF-8 format.

SyntaxDescription
<column_spec>

Tells which columns you want to include in the output of the SELECT. When used in an ORDER BY clause, tells which column to use when sorting the rows in the result set. You must include in the SELECT statement any columns that you are sorting on (see the examples below).

Use any of the following:

  • <column_name> — described later in this table.
  • <aggregate_spec> — described later in this table.
  • ROWID — retrieve the <row_id> for use in a later INSERT, UPDATE, or DELETE statement.
  • * — use an asterisk to retrieve all columns in the table (except the row IDs).

Note: ORDER BY affects the order in which tabular data is returned, not how it is rendered in layers. You cannot control the order in which map objects, such as polygons, are rendered in a Fusion Table layer.

<column_name>The name of a column in the table. Case sensitive. To find out what columns are available in a given table, use DESCRIBE. If the column name is anything besides a letter followed by letters, digits, and underscore characters or if it is a reserved keyword, surround the name with single quotes; examples, 'Volcano Name', 'SELECT', and 'circle'.

Note: Column names are case sensitive.
<aggregate_spec>

An aggregation specification applies a function to all the values of one column from the retrieved records. It returns the one number , the result of the function, instead of the column value.

Use any of the following functions (which behave exactly like their SQL counterparts):

  • COUNT( )
  • SUM ( <column_name> )
  • AVERAGE ( <column_name> )
  • MAXIMUM ( <column_name> )
  • MINIMUM ( <column_name> )

If the SELECT statement contains a <spatial_condition> or <spatial_relationship>, the query can not be aggregated by the <location_column> used in the <spatial_condition> or <spatial_relationship>.

<table_id> The unique table ID of the table from which you want to get data. It must be a table on which you have the necessary permissions.
<filter_condition>

A Boolean expression (returns TRUE or FALSE). Only table rows where the condition is TRUE will be included in the results of the SELECT. Use AND to combine multiple filters into a single query. OR is not supported. This is a pre-aggregation filter: it is applied before the functions in the <aggregate_spec> are calculated.

Use one of the following:

  • <column_condition>
  • <row_condition>
<column_condition>

Used in the WHERE clause. The syntax is: <column_name> <operator> <value>

<column_name> is described earlier in this table.

For <operator>, use one of the following with a <number>:

  • >, <, >=, <=, =

For <operator>, use one of the following with a <string>:

  • >, <, >=, <=, =
  • LIKE
  • MATCHES (equivalent to LIKE)
  • STARTS WITH
  • ENDS WITH
  • CONTAINS
  • CONTAINS IGNORING CASE
  • DOES NOT CONTAIN
  • NOT EQUAL TO
  • IN

The <value> can be one of the following:

  • <number> — A floating point number or integer.
  • '<string>' — A text string in quotes. If the string contains quote characters, precede each quote character with a backslash (\).
  • (<number>{, <number>}) | ('<string>'{, '<string>'}) — For IN only. A list of one or more values. Format date and location values as strings.

Filtering on LOCATION

When filtering on a column of type LOCATION, the value will behave like the underlying text or string data type. The following is not recommended:

SELECT * FROM <table_id> WHERE latitude > <number> AND latitude < <number> AND longitude > <number> AND longitude < <number>

Instead, use a <spatial_condition> with a <rectangle> geometry, as described later in this table.

Filtering on DATETIME

When filtering on a column of type DATETIME, the <value> should be formatted as one of the following supported formats:

  • MMM dd, yy
  • MM/dd/yy
  • MM-dd-yy
  • MMM-dd-yy
  • yyyy.MM.dd
  • dd-MMM-yy
  • MMM/yy
  • MMM yy
  • dd/MMM/yy
  • yyyy

Filtering on formulas or variables

Formulas and variables are not supported.

<row_condition>

Used in the WHERE clause. The syntax is: ROWID = '<string>'

  • ROWID — Use a row ID that you obtained from a previous SELECT.
  • '<string>' — A text string in quotes. If the string contains quote characters, precede each quote character with a backslash (\).
<spatial_condition>

Used in the WHERE clause. The syntax is: ST_INTERSECTS(<location_column>, <geometry>)

For <location_column>, use a <column_name> in your table that contains location data.

For <geometry>, use one of the following:

  • <circle>
  • <rectangle>

ST_INTERSECTS cannot be combined with ORDER BY ST_DISTANCE.

<circle>

The syntax is: CIRCLE(<coordinate>, <radius>)

<coordinate> is the center of the circle.

For <radius>, use an integer value to represent the radius of the circle in meters.

<rectangle>

The syntax is: RECTANGLE(<lower_left_corner>, <upper_right_corner>)

Use two <coordinate> to define a rectangular bounding box.

<coordinate>

LATLNG(<number>, <number>) — A latitude, longitude pair describing a point in decimal degrees. Separate with a comma. A space is optional.

Note that it is the reverse order of how a point is specified in KML.

GROUP BY

Places the output rows into groups that share a common value in one column (see <column_name> earlier in this table). The purpose is to calculate summary data for each group and display only one row per group. Each row contains the fields that were used to create the group and one or more aggregate results for the other included fields.

If the SELECT statement contains a <spatial_condition> or <spatial_relationship>, the query can not be grouped by the <location_column> used in the <spatial_condition> or <spatial_relationship>.

ORDER BY Sorts the output rows using the values in a single column or <spatial_relationship>. You must include in the SELECT statement any columns that you are sorting on.
<spatial_relationship>

Used in the ORDER BY clause. The syntax is: ST_DISTANCE(<location_column>, <coordinate>)

For <location_column>, use a <column_name> in your table that contains location data.

Listing the <location_column> as a <column_spec> is optional when using ORDER BY ST_DISTANCE.

ORDER BY ST_DISTANCE cannot be combined with any of the ST_INTERSECTS conditions.

ASC | DESCUse ASC to sort the values in the query result set in ascending order (A-Z, 1-100). Use DESC for descending order (Z-A, 100-1). Default: ASC.
OFFSETSkips the first <number> rows. The first row returned is from position <number> + 1.
LIMITReturns only a given number of rows. The purpose is to avoid getting more data than can be handled by the application or computer resources on the receiving end.
<number>An integer. Must be a literal, not an expression.

Returns

One or more lines of comma-separated-value output. The first line is a header row containing a comma-separated list of the columns that were included in the query result set. This is followed by zero or more lines containing comma-separated values for those columns.

Optionally, add the parameter hdrs=false to suppress the header row and return only zero or more lines of data values.

Examples

Note: The examples are shown without the required URL encoding for the sake of readability. If you cut and paste, run it through an encoder before use.

Find all the animals whose favorite food is fish, ordered by the size of the population:

SELECT animal, 'population size' FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE favorite_food = 'fish' ORDER BY 'population size'

Note: A SELECT statement to a table marked public and exportable can be written directly in the URL bar of your browser because it doesn't require authentication and is sent as a GET request. Try this example in your browser.

Example output:

animal
penguin
bear
seal
albatross

Circle Intersection

Find all pharmacies within a 5,000-meter radius from the given location.

SELECT 'Store Name', Pharmacy, Hours FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE Pharmacy='yes' AND ST_INTERSECTS(Address, CIRCLE(LATLNG(37.3242,-121.9806),5000))

Example output:

Store Name,Pharmacy,Hours
Zmart,yes,9am-10pm

Rectangle Intersection

Find all stores within the specified rectangular bounding box, ordered by Hours.

SELECT 'Store Name', Pharmacy, Hours FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE ST_INTERSECTS(Address, RECTANGLE(LATLNG(37.0242,-122.2806), LATLNG(37.5242,-121.6806))) ORDER BY Hours

Note: A SELECT statement to a table marked public and exportable can be written directly in the URL bar of your browser because it doesn't require authentication and is sent as a GET request. Try this example in your browser.

Example output:

Store Name,Pharmacy,Address
Zmart,yes,"Santa Clara, CA"

Order by Distance

Find 10 rows nearest to the given location.

SELECT 'Store Name', Hours, Address FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc ORDER BY ST_DISTANCE(Address, LATLNG(37.5242,-121.6806)) LIMIT 10

Example output:

Store Name,Hours
Zmart,9am-10pm

INSERT

To insert one or more rows in a table, use the following syntax in an HTTP POST request:

INSERT INTO <table_id> (<column_name> {, <column_name>}*) VALUES (<value> {, <value>}*)
{ {;INSERT INTO <table_id> (<column_name> {, <column_name>}*) VALUES (<value> {, <value>}*)}* ;}

Note: You can list up to 500 INSERTs, separated by semicolons, as long as the total size of the data does not exceed 1 MB and the total number of table cells being added does not exceed 10,000 cells. The calculation may not be obvious. For example, if you have 100 columns in your table and your INSERT statement includes only 10 columns, the number of cells being added is still 100.

SyntaxDescription
<table_id>The unique table ID of the table into which you want to add rows. It must be a table on which you have the necessary permissions.
<column_name>The name of a column, or a list of column names separated by commas. Must exactly match the column names that have already been defined for the table. To find out what columns are in a given table, use DESCRIBE.

Note: Column names are case sensitive.
<value>The floating point number, integer, or string value that you want to assign to the column, or a list of values separated by commas. If the value is a string that contains quote characters, precede each quote character with a backslash (\). To leave the column empty, assign it the empty string ('').

In a column of type LOCATION, the value can be a string containing an address, city name, country name, or latitude/longitude pair. The string can also use KML code to specify a point, line, or polygon, as follows:

  • Point:
    <Point>
    <coordinates> lng,lat[,alt] </coordinates>
    </Point>
    
  • Line:
    <LineString>
    <coordinates> lng,lat[,alt] lng,lat[,alt] ... </coordinates>
    </LineString>
    
  • Polygon (specify the coordinates in counter-clockwise order):
    <Polygon>
    <outerBoundaryIs>
    <coordinates> lng,lat[,alt] lng,lat[,alt] ... </coordinates>
    </outerBoundaryIs>
    </Polygon>
    

For more information, see Working With Geographic Data in the Google Fusion Tables API Developer's Guide. For details on KML syntax, see the entries for Point, LineString, and Polygon in the KML Reference.

; Separator for listing multiple INSERT statements in a single POST request. (See note above table for INSERT constraints.)

Returns

If successful, returns the row ID of each new row.

Examples

Note: The examples are shown without the required URL encoding for the sake of readability. If you cut and paste a command, run it through an encoder before use.

A single INSERT statement:

INSERT INTO 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc (animal, favorite_food) VALUES ('cat','milk')

A list of INSERT statements:

INSERT INTO 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc (animal, favorite_food) VALUES ('cat','milk');
INSERT INTO 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc (animal, favorite_food) VALUES ('dog','bone');
INSERT INTO 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc (animal, favorite_food) VALUES ('fish','algae');
INSERT INTO 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc (animal, favorite_food) VALUES ('bird','worm');
INSERT INTO 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc (animal, favorite_food) VALUES ('monkey','fruit');

UPDATE

To modify data in one or more columns of an existing row in a table, use the following syntax in an HTTP POST request:

UPDATE <table_id>
SET <column_name> = <value> {, <column_name> = <value> }*
WHERE ROWID = <row_id>
SyntaxDescription
<table_id>The unique table ID of the table that you want to update. It must be a table for which you have the necessary permissions.
<column_name>The name of a column where you want to modify the data. Must be a column name that has already been defined for the table. Must exactly match the column names that have already been defined for the table. Note: Column names are case sensitive.

To find out what columns are available in a given table, use DESCRIBE. In a merged table, this must not be the column that was used to define the merge (the primary key); if you want to change a primary key value, do so in the base table instead.
<value>The floating point number, integer, or string value that you want to assign to the column. If the value is a string that contains quote characters, precede each quote character with a backslash (\).

In a column of type LOCATION, the value can be a string containing an address, city name, country name, or latitude/longitude pair. The string can also use KML code to specify a point, line, or polygon, as follows:

  • Point:
    <Point>
    <coordinates> lng,lat[,alt] </coordinates>
    </Point>
    
  • Line:
    <LineString>
    <coordinates> lng,lat[,alt] lng,lat[,alt] ... </coordinates>
    </LineString>
    
  • Polygon (specify the coordinates in counter-clockwise order):
    <Polygon>
    <outerBoundaryIs>
    <LinearRing>
    <coordinates> lng,lat[,alt] lng,lat[,alt] ... </coordinates>
    </LinearRing>
    </outerBoundaryIs>
    </Polygon>
    

For more information, see Working With Geographic Data in the Google Fusion Tables API Developer's Guide. For details on KML syntax, see the entries for Point, LineString, and Polygon in the KML Reference.

<row_id>The ID of the row you want to update. A quoted string. To get the row ID, perform a SELECT before the UPDATE.

Example

Note: The example is shown without the required URL encoding for the sake of readability. If you cut and paste, run it through an encoder before use.

First, get some information about cats:

SELECT favorite_food, ROWID FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE animal='cat'

This yields the cat's row ID and current favorite food:

favorite_food,rowid
milk,1

Now you can use the row ID to construct the UPDATE:

UPDATE 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc SET favorite_food = 'fish' WHERE rowid='1'

DELETE

To delete a single row or all rows from a table, use the following syntax in an HTTP POST request:

DELETE FROM <table_id>{ WHERE ROWID = <row_id>}
SyntaxDescription
<table_id>The unique table ID of the base table from which you want to delete one or more rows.
<row_id>The ID of the row you want to delete. A quoted string. To get the row ID, perform a SELECT before the DELETE.

Examples

Note: The examples are shown without the required URL encoding for the sake of readability. If you cut and paste, run it through an encoder before use.

To delete all rows from table 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc, run the query:

DELETE FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc

To delete only information about cats, first find out where the cat's information is:

SELECT ROWID FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE animal='cat'

This yields the row ID of the cat:

rowid
1

Now you can use the row ID to construct the DELETE statement:

DELETE FROM 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc WHERE rowid='1'

DROP TABLE

To delete tables to which your application has access, use the following syntax in an HTTP POST request:

DROP TABLE <table_id>
SyntaxDescription
<table_id>The unique table ID of the table that you want to delete.

Returns

If successful, returns "ok". If the table doesn't exist, returns an error.

Example

Note: The example is shown without the required URL encoding for the sake of readability. If you cut and paste, run it through an encoder before use.

DROP TABLE 1tqv1e7y689555xxx5_eeee345ee_CvWxxxhg9gc

Reserved words

Fusion Tables has many reserved words. We recommend you not use them as table, view, or column names. If, however, you need to for some reason, make sure you enclose them in single quotes.

AND
ASC
AS
BY
CASE
CIRCLE
CONTAINS
CONTAIN
CREATE
DELETE
DESCRIBE
DESC
DOES
DROP
ENDS
EQUAL
FROM
GROUP
IGNORING
IN
INSERT
INTO
LATLNG
LIKE
LIMIT
MATCHES
NEAR
NOT
OFFSET
ORDER
POLYGON
RECTANGLE
ROWID
SELECT
SET
SHOW
SKIP
ST_DISTANCE
ST_INTERSECTS
STARTS
TABLES
TABLE
TO
UPDATE
VALUES
VIEW
WHERE
WITH
ID
NUMBER
DOCID
STRING