SELECT TOP 100
       h.PROCHI,
       d.sex,
       d.Calculated_Age,
       h.DateTimeSampled,
       h.LocalClinicalCodeDescription,
       h.QuantityValue,
       h.QuantityUnit,
       h.RangeLowValue,
       h.RangeHighValue,
       h.Interpretation
FROM Project_12345..HaematologyRestructured h
INNER JOIN Project_12345..Demography_Current d
    ON h.PROCHI = d.PROCHI
ORDER BY NEWID()
with engine.connect() as conn:
    df = pd.read_sql("""
        SELECT TOP 100
               h.PROCHI,
               d.sex,
               d.Calculated_Age,
               h.DateTimeSampled,
               h.LocalClinicalCodeDescription,
               h.QuantityValue,
               h.QuantityUnit,
               h.RangeLowValue,
               h.RangeHighValue,
               h.Interpretation
        FROM Project_12345..HaematologyRestructured h
        INNER JOIN Project_12345..Demography_Current d
            ON h.PROCHI = d.PROCHI
        ORDER BY NEWID()
    """, conn)

df.head()
df <- dbGetQuery(conn, "
    SELECT TOP 100
           h.PROCHI,
           d.sex,
           d.Calculated_Age,
           h.DateTimeSampled,
           h.LocalClinicalCodeDescription,
           h.QuantityValue,
           h.QuantityUnit,
           h.RangeLowValue,
           h.RangeHighValue,
           h.Interpretation
    FROM Project_12345..HaematologyRestructured h
    INNER JOIN Project_12345..Demography_Current d
        ON h.PROCHI = d.PROCHI
    ORDER BY NEWID()
")

head(df)