DDL Flashcards

1
Q

CREATE
OPTIONS
AS SELECT

A

CREATE TABLE mydataset.top_words
OPTIONS(
description=”Top ten words per Shakespeare corpus”
) AS
SELECT
corpus,
ARRAY_AGG(STRUCT(word, word_count) ORDER BY word_count DESC LIMIT 10) AS top_words
FROM bigquery-public-data.samples.shakespeare
GROUP BY corpus;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

CREATE FUNCTION

A
CREATE [TEMP] FUNCTION mydataset.multiplyInputs(
    x FLOAT64, y FLOAT64
)
RETURNS FLOAT64
AS (x * y);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

CREATE PROCEDURE

A

CREATE PROCEDURE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

CREATE EXTERNAL TABLE

A

CREATE OR REPLACE EXTERNAL TABLE mydataset.sales
OPTIONS (
format = ‘CSV’,
uris = [‘gs://mybucket/sales.csv’]);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly