FastPrepTest Execution Success Rate
Problem · Database

Test Execution Success Rate

EasyLenskart logoLenskartFULLTIMEOA

Problem statement

The table test_results stores test-result strings. Compare values case-insensitively.

  • true is a successful valid result.
  • false is an unsuccessful valid result.
  • null and strings containing only whitespace are ignored.

Return one column, success_rate, equal to 100 * true_count / valid_count, rounded to two decimal places. If valid_count is 0, return 0.00. An exact halfway value rounds up.

Input table

test_results
ColumnMeaning
result_positionOne-based input position
result_valueCase-insensitive test-result string

Table schema

MySQLPostgreSQLPandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

test_results

One row per test execution result.

ColumnTypeNullableDescription
result_positionPKIntegerNo
result_valueTextNo

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
success_rateDecimalNoPercentage rounded to two decimal places.

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • The test_results table has between 1 and 10^5 rows.
  • result_position is unique and non-null.
  • result_value is non-null and is a case variant of true, false, or null, or it contains only whitespace.

More Lenskart problems