Bird
0
0

What is the output of this query?

medium📝 query result Q4 of 15
PostgreSQL - Full-Text Search
What is the output of this query?
SELECT to_tsvector('english', 'Cats running fast');
A'cats':1 'run':2 'fast':3
B'cats':1 'running':2 'fast':3
C'cat':1 'running':2 'fast':3
D'cat':1 'fast':3 'run':2
Step-by-Step Solution
Solution:
  1. Step 1: Understand stemming in English configuration and analyze the output tokens and positions

    English stemming reduces words to their root forms: 'Cats' -> 'cat', 'running' -> 'run'. Positions correspond to word order: 'cat' at 1, 'run' at 2, 'fast' at 3. 'cat':1 'fast':3 'run':2 matches this.
  2. Final Answer:

    'cat':1 'fast':3 'run':2 -> Option D
  3. Quick Check:

    Stemming applied = root words shown [OK]
Quick Trick: to_tsvector stems words to roots in English [OK]
Common Mistakes:
  • Ignoring stemming
  • Mixing word order
  • Using plural forms as is

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes