9951 explained code solutions for 126 technologies


google-big-queryHow do I create a view in Google Big Query?


Creating a view in Google Big Query is a simple process.

  1. First, create a query that produces the desired result.
SELECT *
FROM [publicdata:samples.wikipedia]
  1. Then, create a view with the query using the CREATE VIEW statement.
CREATE VIEW my_view AS
SELECT *
FROM [publicdata:samples.wikipedia]
  1. Finally, the view can be queried as if it were a table.
SELECT *
FROM my_view

Code explanation

  • CREATE VIEW - the statement used to create the view
  • my_view - the name of the view
  • SELECT * - the query used to populate the view
  • FROM [publicdata:samples.wikipedia] - the source table

Helpful links

Edit this code on GitHub