Cell membranes can maintain a difference in electrical charg…
Cell membranes can maintain a difference in electrical charge between the inte- rior of the cell and the extracellular fluid. What is this charge difference called? A. excitabilityB. the membrane potentialC. the action potentialD. the sodium-potassium pump
Read DetailsA retail company wants to calculate the change in daily sale…
A retail company wants to calculate the change in daily sales compared to the prior day. Which window function concept is most directly applied here? OPTIONS:A. Aggregating data with GROUP BYB. Accessing the previous row using LAGC. Accessing the next row using LEADD. Filtering data with WHERE ANSWER:B EXPLANATION:LAG retrieves the previous row’s value, which allows day-over-day comparisons.
Read DetailsAn e-commerce analyst wants to compare each day’s sales to t…
An e-commerce analyst wants to compare each day’s sales to the previous day’s sales in order to spot drops in performance. Which SQL window function is best suited for this? OPTIONS:A. SUM OVER (PARTITION BY day)B. LAG with ORDER BY sale_dateC. LEAD with ORDER BY sale_dateD. ROW_NUMBER with PARTITION BY sale_date ANSWER:B EXPLANATION:LAG allows access to the previous row’s value when ordered by date, which is exactly what the analyst needs. LEAD looks forward (C), SUM aggregates without comparing rows (A), and ROW_NUMBER just assigns sequence numbers (D).
Read DetailsA recruiter wants to assign each applicant a unique number i…
A recruiter wants to assign each applicant a unique number in order of application date: SELECT applicant_id, application_date, ROW_NUMBER() OVER (ORDER BY application_date) AS row_num FROM applicants; What does the row_num column show? OPTIONS:A. A sequential number for each applicant, ordered by application dateB. The count of applicants who applied on the same dayC. The average application date per applicantD. The difference in days between applications ANSWER:A EXPLANATION:ROW_NUMBER() generates a sequential number based on the specified ordering, with no ties allowed.
Read DetailsA 19 y.o. male is found unconscious and unresponsive on his…
A 19 y.o. male is found unconscious and unresponsive on his bed. He has an empty bottle of Elavil, which you recognize as a tricyclic antidepressant medication. His mother states she just refilled the medication three days ago. The patient has snoring respirations, dry skin, and is warm. ECG shows wide complex tachycardia at 170; BP is 70/40, RR is 8, and shallow; the pulse is weak and rapid at the carotid, no radial. BGL is 100. After controlling the airway and providing oxygenation, you establish an IV and start a fluid bolus of 250 mL. You contact a base hospital and request which medication and dosage? (policy 4601)
Read DetailsAn energy company is analyzing electricity usage. Instead of…
An energy company is analyzing electricity usage. Instead of comparing today’s consumption to yesterday’s, they want to compare it to the same day one week earlier. How can this be achieved with LAG? OPTIONS:A. Use LAG with a partitionB. Use LAG with an offset of 7C. Use LEAD with an offset of 7D. Use GROUP BY week instead of day ANSWER:B EXPLANATION:Adding an offset parameter to LAG allows comparisons several rows back (e.g., LAG(value, 7) for a 7-day lookback).
Read DetailsA hospital tracks patient wait times in the emergency depart…
A hospital tracks patient wait times in the emergency department. Times are partitioned by day of the week and ordered by arrival time. If the hospital uses NTH_VALUE(wait_time, 3), what does the returned value represent? A) The third-longest wait time on that day B) The average of the first three wait times on that day C) The wait time of the third patient to arrive on that day D) The last patient’s wait time on that day Correct Answer: The wait time of the third patient to arrive on that day Explanation:Nth value returns the specified position within the ordered window. Since the data is ordered by arrival time, the third value corresponds to the third patient who arrived that day. It does not mean the third-longest time, an average, or the last patient’s wait time.
Read DetailsA logistics company wants to calculate each driver’s average…
A logistics company wants to calculate each driver’s average delivery time compared to the overall company average. Why are window functions a good choice here? OPTIONS:A. They permanently store averages in the databaseB. They allow calculations across related rows without reducing the datasetC. They are faster than all other SQL approachesD. They eliminate the need for any joins ANSWER:B EXPLANATION:Window functions allow calculations across groups (like averages by driver or company-wide) while keeping all rows visible. They don’t permanently store values (A), don’t always guarantee faster performance (C), and don’t eliminate the need for joins (D).
Read Details