BigQuery - GradedJestRisk/db-training GitHub Wiki

BigQuery

Doc

Features

SQL-compliant

OLAP (OnLine Analytical Processing), column-oriented storage

Partition

Cluster

Temporary table

View

Procedural

Concurrency control SO

Structure

Level:

  • project
  • dataset
  • table

Create table - DDL

Doc

Integrity constraints are not enforced:

  • primary key
  • foreign key

There is no sequence, or auto-incrementing fields. You should rely to external code or use GENERATE_UUID

CREATE TABLE employee(
  id STRING
);

INSERT INTO employee (id)
SELECT GENERATE_UUID()

Create, update, delete data - DML

Doc

Query - DML

Identifier (table name) are escaped with backticks.

SELECT *
FROM `dataset.products`

Access - DCL

Doc

Transaction : TCL

Not available in console queries, only in sessions and scripts.

BEGIN TRANSACTION 

DELETE FROM employee;

# ROLLBACK TRANSACTION

COMMIT TRANSACTION

Editor

Shortcut:

  • execute : Ctrl + Enter
  • complete: Ctrl + Space
  • format: Ctrl + Shift + F
  • comment : Ctrl + /
⚠️ **GitHub.com Fallback** ⚠️