| Course | HI520 Database Design and SQL |
|---|---|
| Unit | Unit 5 |
| Paper type | Basic query set |
| Length | About 860 words, 6 pages double-spaced |
| Format | APA 7 student paper |
| School | Purdue University Global |
| Program | MS in Health Informatics |
| Updated | October 2026 |
Free sample paper for HI520 Unit 5
Seven Single-Table Queries, Each Preceded by the Population It Claims to Return: A Unit 5 Basic Query Set on a Pediatric Asthma Database
[Student Name]
Purdue University Global
HI520: Database Design and SQL
Unit 5 Basic Query Set
[Instructor Name]
[Date]
Calder Bay Pediatrics and every row and count are synthetic; the sources cited are real.
Conventions
All queries run against the Unit 4 schema loaded with synthetic data: 1,640 patients, 4 sites, 23 providers and 9,812 encounters across 18 months. A fixed report date of June 30, 2026, is used wherever age or recency matters, so that rerunning a query next week returns the same rows. Every query names its columns instead of using an asterisk, so a change to the table does not silently change the output, and every query that implies an order includes ORDER BY. Each is followed by its row count from the synthetic data and two lines on what it includes and excludes. The queries are grouped by the kind of mistake they guard against rather than by difficulty. Equality and list filters come first because they rarely go wrong. Date filters come next because a boundary error returns plausible results that are quietly incomplete. Comparisons involving nulls close the set, because that is where a filter can look correct and still return the wrong children.
Equality and List Filters
Query 1. Population: every diagnosis code in the table that represents persistent asthma, mild, moderate or severe, listed by code. SELECT code, description FROM diagnosis_code WHERE code LIKE 'J45.3%' OR code LIKE 'J45.4%' OR code LIKE 'J45.5%' ORDER BY code; Rows returned: 12. Includes every persistent asthma code with any fifth character, such as exacerbation or status asthmaticus. Excludes intermittent asthma and unspecified asthma, which the practice's measure counts separately, following the national severity categories (National Asthma Education and Prevention Program [NAEPP], 2007). Query 2. Population: spirometry and peak flow orders whose status is canceled, newest first. SELECT order_id, encounter_id, test_code, order_time FROM test_order WHERE test_code IN ('SPIRO', 'PEAKFLOW') AND status = 'canceled' ORDER BY order_time DESC; Rows returned: 41. Includes both test types. Excludes orders in any other status; because status is constrained to four lowercase values, no variant spellings can slip through.
Date Logic
Query 3. Population: children who were at least 5 and no older than 11 on the report date, by last name. SELECT patient_id, mrn, last_name, first_name, birth_date FROM patient WHERE birth_date BETWEEN DATE '2014-07-01' AND DATE '2021-06-30' ORDER BY last_name, first_name; Rows returned: 806. Includes a child born on July 1, 2014, who turned 12 the day after the report date. Excludes a child born June 30, 2014, already 12 on the report date. Query 4. Population: encounters that began in the second quarter of 2026, April 1 through June 30, by start time. SELECT encounter_id, patient_id, site_id, start_time FROM encounter WHERE start_time >= TIMESTAMP '2026-04-01 00:00' AND start_time < TIMESTAMP '2026-07-01 00:00' ORDER BY start_time; Rows returned: 1,724. Includes encounters at any time on June 30. Excludes encounters beginning at midnight on July 1. A filter written as BETWEEN April 1 and June 30 on a timestamp would silently drop every encounter after midnight on June 30, which is why the quarter uses a half-open range.
Comparisons That Meet Nulls
Query 5. Population: encounters in the second quarter where the recorded asthma control score indicates asthma that is not well controlled, a score of 19 or lower. SELECT encounter_id, patient_id, control_score FROM encounter WHERE start_time >= TIMESTAMP '2026-04-01 00:00' AND start_time < TIMESTAMP '2026-07-01 00:00' AND control_score <= 19 ORDER BY control_score; Rows returned: 288. The cutoff of 19 follows the validation study for the childhood control instrument (Liu et al., 2007). Excludes encounters with no score, because a comparison with a null is never true; those are counted separately in query 6. Query 6. Population: second-quarter encounters at which no control score was recorded. SELECT encounter_id, patient_id, site_id, visit_type FROM encounter WHERE start_time >= TIMESTAMP '2026-04-01 00:00' AND start_time < TIMESTAMP '2026-07-01 00:00' AND control_score IS NULL ORDER BY site_id; Rows returned: 611. Writing control_score = NULL instead would return zero rows, because nothing equals null, not even another null. Query 7. Population: patients whose primary language is missing or recorded as unknown, by medical record number. SELECT patient_id, mrn, primary_language FROM patient WHERE primary_language IS NULL OR primary_language = 'Unknown' ORDER BY mrn; Rows returned: 97. Includes both forms of missing data. A filter on primary_language = 'Unknown' alone would miss the 63 rows that are simply null.
What the Set Shows
Queries 5 and 6 together account for every second-quarter encounter with or without a low score; neither alone describes the population accurately. Treating missing values as a distinct category rather than as zero or as normal is a basic rule of handling clinical data, and the relational model treats null as unknown rather than as a value (Codd, 1970). The practice's quality team now knows that 611 of 1,724 second-quarter encounters, about 35 percent, have no control score at all, a finding that matters more than the 288 low scores among those that do.
References
Codd, E. F. (1970). A relational model of data for large shared data banks. Communications of the ACM, 13(6), 377-387. https://doi.org/10.1145/362384.362685
Liu, A. H., Zeiger, R., Sorkness, C., Mahr, T., Ostrom, N., Burgess, S., Rosenzweig, J. C., & Manjunath, R. (2007). Development and cross-sectional validation of the Childhood Asthma Control Test. Journal of Allergy and Clinical Immunology, 119(4), 817-825. https://doi.org/10.1016/j.jaci.2006.12.662
National Asthma Education and Prevention Program. (2007). Expert panel report 3: Guidelines for the diagnosis and management of asthma. National Heart, Lung, and Blood Institute.
HI520 Unit 5 instructions, in plain terms
The fifth unit usually asks for a set of single-table SQL queries against the database you built, each answering a stated question. Expect to write SELECT statements with WHERE filters, ORDER BY and named columns, and to report what each returns from your sample data. Many instructors want the population each query should return stated in a sentence before the SQL, so the result can be checked against the claim. Date boundaries and null handling are common traps, and strong submissions show awareness of both. A fixed report date makes age and recency queries repeatable. Cite a source behind any clinical threshold you use and a database text or the relational model for null logic. Present each query with its population sentence, the SQL, the row count and a short note on what it includes and excludes.
How this HI520 Unit 5 example is built
A conventions section describes the synthetic data, the fixed report date of June 30, 2026, named columns and ORDER BY wherever an order is implied, and explains the grouping by type of mistake. Two list filters return persistent asthma codes and canceled lung function orders. Two date queries follow, one fixing ages five to eleven with a birth date range and one selecting the quarter with a half-open timestamp range; the highlighted sentence explains why BETWEEN would drop late June 30 visits. Three null-aware queries close the set, including low control scores at or under the validated cutoff and encounters with no score, with a note on why equality with null returns nothing. A final section joins queries 5 and 6 into a finding about missing scores, citing the relational treatment of null.
HI520 Unit 5 rubric: what earns full points
Query sets tend to be graded on correctness, alignment between stated population and result, handling of edge cases and presentation. Correctness points require SQL that runs and returns the intended rows. Alignment carries a large share in this course: graders compare each population sentence with the filter and the row count, so vague sentences lose points even when the SQL is right. Edge cases, especially date boundaries and nulls, are where many students lose marks. Named columns, ORDER BY where implied and a fixed report date earn credit for good practice. Expect some credit for interpreting results, such as noticing missing data. Clear layout for each query, with row counts and include and exclude notes, plus APA citations for thresholds, completes the rubric.
HI520 Unit 5 help: mistakes that cost points
The most frequent error in Unit 5 is filtering a timestamp with BETWEEN and a date, which drops every row after midnight on the last day. Another is writing column = NULL, which returns no rows. Many students use SELECT with an asterisk, so output changes silently when the table changes. Age calculations based on the current date make results unrepeatable. Population sentences that are vaguer than the filter, or describe a different group, cost points. Missing values are often counted as zero or ignored rather than reported. To work through a query set for your own schema, share the table definitions, any sample data and the questions assigned, and each query can be written after its population sentence.
Get an HI520 Unit 5 example written to your instructions
Unit 5 prompts usually list the populations each query must return, sometimes against a database the instructor supplies. Paste that list with the table definitions or the database file, and add the HI520 rubric. Every query is written against those tables with its population stated first, delivered in 24-48h. First custom samples carry no charge. The paper above is an original model document written by our desk, not a submitted student paper and not an official Purdue University Global document.
More HI520 papers and MS in Health Informatics samples
- HI520 Unit 1: Discussion Post
- HI520 Unit 2: Entity Relationship Diagram
- HI520 Unit 3: Normalization Exercise
- HI520 Unit 4: Schema Build
- HI520 Unit 6: Multi-table Join Query
- HI520 Unit 7: Aggregation and Grouping Query
- HI520 Unit 8: Seminar Reflection
- HI520 Unit 9: Data Governance Memo
- HI520 Unit 10: Database Design Report
- HI510 Unit 5: Resident Assessment Exercise
- HI501 Unit 5: Usability Walkthrough
HI520 Unit 5 questions, answered
Where can I find a free HI520 Unit 5 sample paper?
The Unit 5 query set is printed in full here, seven single-table queries each preceded by its population.
Why write the population sentence first?
So the grader can check whether the filter returns exactly the group claimed, which turns each query into a testable statement.
Why use a half-open range for dates?
A timestamp filter ending at June 30 with BETWEEN drops visits after midnight; ending before July 1 keeps them.
Why does column = NULL return nothing?
In SQL nothing equals null, not even another null, so missing values must be found with IS NULL.
What did the query set reveal about the data?
About 35 percent of second-quarter encounters had no asthma control score recorded.