Fix that Query
SQL Professor
100

Select * 

from analytics.source.ecw_logs

Should always use STAGING table, not SOURCE tables. They are always nearly 1:1.

100

What does SQL stand for?

Structured Query Language

200

select

name_employee_full

from analytics.staging.stg_adp_paid_time_off 

left join analytics.common.dim_employees 

on analytics.staging.stg_adp_paid_time_off.worker_id = analytics.common.dim_employees.employee_id

where

requested_date_off >= '2024-6-15'

and requested_date_off => '2024-07-15'

Answer: The second line is redundant

requested_date_off >= '2024-6-15'

and requested_date_off => '2024-07-15'

200
What is the most commonly used SQL command?

SELECT

300

select a.patient_id, 

a.encounter_date,

a.encounter_id

from ANALYTICS.STAGING.STG_ECW_ENCOUNTERS a

join ANALYTICS.PRODUCTS.ACTIVE_PATIENT_LIST b 

where last_psychiatrist_name like '%Gupta%'

Missing clause joining the two tables

such as: b.patient_account_number = a.patient_id

300

What application does Talkiatry use to host SQL?

Snowflake.

400

select count(encounter_id),

primary_provider_name

from ANALYTICS.MARTS.MART_MINDBRIDGE_TJBS

When adding a formula such as count, need to include the other columns as a grouping

400

What does CTE stand for?

Common Table Expression