From the course: Data Science on Google Cloud Platform: Designing Data Warehouses

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Joins and sub-queries

Joins and sub-queries

From the course: Data Science on Google Cloud Platform: Designing Data Warehouses

Start my 1-month free trial

Joins and sub-queries

- [Narrator] Joints and subqueries allow developers and analysts to extend and harness the full capabilities of SQL. BigQuery also supports joint, including: inner, outer and close joints. In this example, we have a look at test results for patients, who did not exercise at all. We create the query in the compost query window. We select the test results from the test results table. We then inner join it with the patient's table on the patient_id column and we also filter their exercise days equal zero. We execute the query and then we can see the results. Next, we can implement the same query using subqueries. We query the patients who do not exercise in a query. Then, we use the list of patient IDs, returned by the inner query, to select patient records from the test results table. Let us run this query and look at the results.

Contents