What is SQL?
Structured Query Language, used to manage and query relational databases.
What is BigQuery?
A cloud-based data warehouse service by Google for querying large datasets using SQL.
How do you create a client object in BigQuery?
Use client = bigquery.Client() in Python.
What is a dataset in BigQuery?
A container for tables, similar to a folder in a file system.
What is a table schema?
The structure of a table, including column names, data types, and descriptions.
How do you list tables in a dataset?
Use list(client.list_tables(dataset)).
What does SELECT do?
Retrieves specified columns from a table.
What does FROM specify?
The table from which to retrieve data.
What does WHERE do?
Filters rows based on a condition.
How do you select all columns?
Use SELECT *.
What is GROUP BY used for?
Groups rows with the same values into summary rows.
What does COUNT() do?
Returns the number of rows in a group or column.
What is HAVING used for?
Filters groups based on aggregate conditions (used after GROUP BY).
What does ORDER BY do?
Sorts the result set by specified columns.
What does ASC/DESC mean?
ASC: ascending order (default), DESC: descending order.
How do you extract part of a date?
Use EXTRACT, e.g., EXTRACT(DAY FROM date_column).
What is a DATE format?
YYYY-MM-DD (e.g., 2019-01-01).
What is a DATETIME format?
YYYY-MM-DD HH:MM:SS (includes time).
What is aliasing in SQL?
Renaming a column or table using AS for readability.
What is a CTE (Common Table Expression)?
A temporary named result set defined within a query using WITH.
How do you join two tables?
Use JOIN with ON to specify matching columns.
What is an INNER JOIN?
Returns only rows with matching values in both tables.
What is a LEFT JOIN?
Returns all rows from the left table and matched rows from the right table (NULL if no match).
What is a RIGHT JOIN?
Returns all rows from the right table and matched rows from the left table.