PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in SQL data manipulation, including conditional filtering, NULL handling, aggregation, and computing conditional percentages across related tables.

  • Medium
  • Meta
  • Data Manipulation (SQL/Python)
  • Data Engineer

Return count and renewal percentage of unreturned good copies

Company: Meta

Role: Data Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

Tables: copies(copy_id, condition), checkouts(copy_id, checkout_date, return_date, renewal_count). Write a single SQL query that returns one row with two columns: ( 1) total_unreturned_good_copies: the count of active checkouts (return_date IS NULL) for copies whose condition = 'good' (exact match), and ( 2) pct_renewals_gt_2: among those active checkouts, the percentage with renewal_count > 2 (return a decimal fraction 0– 1).

Quick Answer: This question evaluates proficiency in SQL data manipulation, including conditional filtering, NULL handling, aggregation, and computing conditional percentages across related tables.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Compute ad impression conversion rates - Meta (medium)
  • Count unconnected posts and reactions - Meta (medium)
  • Count heavy callers in 7 days - Meta (medium)
  • Write SQL for call metrics - Meta (medium)
  • Write SQL for multi-account metrics - Meta (medium)