가이드 연계 퀴즈 · 중간 레벨

AI 퀴즈로 SQL 오류를 디버깅하는 방법

모호한 열, 변경된 스키마 및 작은 테스트 픽스처를 사용하여 SQL 오류 진단, 그룹화 복구 및 결과 확인을 연습합니다.

질문 1 의 8

두 개의 조인된 테이블에는 모두 ID가 포함되어 있으며 의도된 출력은 고객의 식별자입니다. 모호함을 해결하는 수리는 무엇입니까?

모든 질문 미리보기8 질문

퀴즈를 풀면 정답과 설명이 나타납니다.

  1. 두 개의 조인된 테이블에는 모두 ID가 포함되어 있으며 의도된 출력은 고객의 식별자입니다. 모호함을 해결하는 수리는 무엇입니까?
    • Qualify id with the customer table's alias
    • Choose either id because matching names imply identical values
    • Add every column to GROUP BY
    • Rename the output heading without qualifying the reference
  2. 선택한 모든 열을 GROUP BY에 추가하는 것이 고객 총계 보고서를 제대로 수정하지 못하는 이유는 무엇입니까?
    • It guarantees that all selected dates belong to the same customer summary
    • It preserves customer-level totals regardless of the added columns
    • It may change the result from one row per customer to a finer grouping
    • It automatically chooses the latest order date within each customer
  3. 표현식 끝 부분에 오류가 있습니다. 이전 토큰도 검사해야 하는 이유는 무엇입니까?
    • The marked token must always be the first incorrect token
    • Only the final clause can affect parsing near the end
    • Name-resolution errors can always be fixed by moving the marked token
    • An earlier missing comma or unmatched parenthesis can make a later token unexpected
  4. AI에게 SQL 오류를 재현하도록 요청할 때 가장 유용한 정보는 무엇입니까?
    • The query and a paraphrase of the error, without identifying the engine
    • The engine, exact error, query, minimal schema and representative test rows
    • Only a successful version from another database engine
    • Only the expected output, without the query or schema
  5. 복구된 SQL 문이 성공적으로 실행됩니다. 어떤 수표가 여전히 중요합니까?
    • Whether its rows, totals and null behavior match the intended result
    • Whether it returns the same row count, without checking values
    • Whether it has the same output headings, without checking totals
    • Whether it runs once without an error on an empty fixture
  6. A cast succeeds for most rows but fails for one unexpected text value. Which debugging step targets that failure?
    • Remove the type information from the prompt
    • Assume the query is syntactically invalid in every context
    • Include the failing value in a reduced test fixture
    • Add an unrelated join to change the execution plan
  7. Why is PostgreSQL EXPLAIN ANALYZE inappropriate as a harmless syntax check for an untrusted modifying query?
    • It never reports actual execution behavior
    • It only checks table aliases
    • It always skips the statement's write operations
    • It actually executes the statement
  8. An application query uses bound parameters. Why should a reproduction preserve their types?
    • Parameter types cannot affect a database operation
    • Substituted literals can behave differently from the original bound values
    • Every parameter should be converted to text before testing
    • A bound parameter always removes the need to check casts