SQL assesment need help getting started

not sure where to start for r studio

Hi Dear

i suggest you start with the tidyverse package : type of Data , Data Manipulation,Data Visualization .

Kind Regards

thank you. can this assessment be done in r studio?

CANDIDATE PROFIECENCY ASSESSMENT:

SQL KNOWLEDGE ASSESSMENT

Purpose: Assess the candidate ability to perform basic joins, use of case statement, and understanding data and table relationships.

Definition/Logic:

MMG Patient: Patient whose current PCP (CUR_DOC_ID) is an MMG Doctor.

MMG Doctor: Doctor whose primary department (Line =1) is an MMG department (MMG_DEPT_FLAG =1)

Tables provided:

DEPT: DEPT_NAME, DEPT_ID ,MMG_DEPT_FLAG
PROVIDER: DOC_NAME, DOC_ID
PATIENT: PAT_ID , PATIENT, DOB (date of birth), CUR_DOC_ID
DOC DEPT: DOC_ID, LINE, DEPT_ID, MMG_DEPT_FLAG
VISIT: PAT_ID , VISIT_ID, DEPT_ID, VISIT_DOC_ID, VISIT_DATE

Output:

The Data that must be produced.

Your output should show

  1. Only Patients that had a visit
  2. Visit that happened at MMG dept (MMG_DEPT_FLAG = 1)
  3. Show both CUR_DOC name and VISIT_DOC Name
  4. Flag if the CUR_DOC is an MMG Provider (Use the [DOC_DEPT] table, the flag should look at Line = 1 MMG_DEPT_FLAG = 1)
  5. Create a Flag if the CUR_DOC is the same as VISIT_DOC
  6. Create Column Age at Visit (in years)
  7. The Output Must have the following Columns:
    PAT_ID, PATIENT, DOB, CUR_DOC (Name), VISIT DATE, VISIT_ID, VISIT DOC (Name), DEPT NAME, VISIT AT MMG (Flag, could be Y/N or 1/0)
    ,CUR_DOC_MMG (flag see #4, could be Y/N or 1/0), CUR DOC IS VIS DOC (flag see #5, could be Y/N or 1/0), Age at Visit

This seems to be meant to assess your proficiency with SQL, you can run SQL code from R and you can execute SQL scripts from RStudio but this is not specific to the R ecosystem.

What have you tried so far? what is your specific problem?, we are more inclined towards helping you with specific coding problems rather than doing your work for you.

Could you please turn this into a self-contained REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

If you've never heard of a reprex before, you might want to start by reading this FAQ:

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.