- Left navigation: project explorer, datasets, tables, Data Transfer, Dataform, Scheduled Queries, Monitoring, Job Explorer, and Assets.
- Center: SQL editor where you author and run queries.
- Right / details pane: schema, metadata, job details, and execution graphs.
demo_dataset) with tables such as sales. You can delete datasets from the UI — deletion is permanent (subject to BigQuery time travel retention). Be cautious.
Deleting a dataset permanently removes its objects. BigQuery supports time travel for a limited retention period (by default 7 days), which can allow recovery of recent changes, but it’s best to treat deletions as irreversible unless you have appropriate backups or export copies.
Creating a dataset
You can create a dataset via the UI (select your project → Create dataset) or directly with SQL in the editor. Replacekodekloud-gcp-training with your GCP project ID if different.
demo_dataset appears — it will initially contain no tables.
Creating a table (employees)
Create anemployees table with the following schema:
CREATE TABLE statement, click the table in the left explorer to inspect:
- Schema
- Last modified timestamp
- Data location
- Row count
- Table properties
Inserting sample rows
Insert sample employee records:Querying the table
Run a simple query to return all rows ordered by employee ID:- Visualize — create charts from query results
- View as JSON — inspect rows as JSON objects
- Save results — download as CSV, save to Google Drive, or export to Google Cloud Storage
Creating and using views
Views are virtual representations of queries — they do not duplicate data and always return up-to-date results because they run the underlying query at query time. Views are useful to simplify complex logic, encapsulate transformations, and control field exposure. Create a view that concatenates first and last name and computes days employed:full_name and the computed days_employed column alongside other fields.
Quick reference table
| Action | Console / SQL | Example |
|---|---|---|
| Create dataset | UI or SQL | CREATE SCHEMA IF NOT EXISTS \<project>.demo_dataset“ |
| Create table | SQL | CREATE TABLE \<project>.demo_dataset.employees` (…)` |
| Insert data | SQL | Use INSERT INTO with VALUES or SELECT from other sources |
| Query data | SQL | SELECT * FROM \<project>.demo_dataset.employees“ |
| Create view | SQL | CREATE OR REPLACE VIEW \<project>.demo_dataset.employee_summary` AS …` |
| Export results | Console UI | Save results to CSV, Drive, or GCS from the query results pane |
Best practices and tips
- Use descriptive dataset and table names and include metadata (descriptions) for discoverability.
- Inspect job details and the execution graph for expensive or long-running queries.
- Prefer views to expose consistent business logic without duplicating data.
- Use GCS and BigQuery Data Transfer Service for scheduled imports and external data loads.
- Monitor “Last modified” and row counts to validate DML operations.
Links and references
- BigQuery console overview: https://cloud.google.com/bigquery/docs
- Google Cloud Storage (GCS): https://cloud.google.com/storage
- BigQuery Data Transfer Service: https://cloud.google.com/bigquery-transfer
- BigQuery time travel: https://cloud.google.com/bigquery/docs/time-travel
- Dataform on Google Cloud: https://cloud.google.com/dataform/docs
- Use the BigQuery editor to create datasets, tables, and views either via SQL or the UI.
- Check job details and execution graphs for query diagnostics.
- Use the table “Last modified” metadata to confirm data changes.
- Views provide virtual, up-to-date representations of underlying data and are useful for sharing reusable logic across teams.