educative.io

What "alternate rows" means in the 1st question?

Can someone plz explain what needs to be done in the first question with
“Which query/queries will return alternate rows from a table containing customer data”?

Even while seeing the right answers I still can’t get it :nerd_face:
Thx!


Course: https://www.educative.io/collection/5352985413550080/6335716377231360
Lesson: https://www.educative.io/collection/page/5352985413550080/6335716377231360/5707471738896384


Course: https://www.educative.io/collection/5352985413550080/6335716377231360
Lesson: https://www.educative.io/collection/page/5352985413550080/6335716377231360/5707471738896384

Hey @Dmitry_Polovinkin !

I hope you are doing great! I noticed your feedback on the course, “An Introductory Guide to SQL”, and I’m glad you reached out to us. In your statement, you asked: “What “alternate rows” means in the 1st question?”

This is a question “Which query/queries will return alternate rows from a table containing customer data?” in the quiz with a few options. Alternate row refers to every other row . Suppose we have the following table:

rowId customerId customerName
1 201 Jennifer
2 204 Anna
3 205 Johnny
4 206 Nina
5 208 Kim

The alternate rows would be 1, 3, and 5 in case mod(rowId,2)=1 is used and it would be 2 and 4 if mod(rowId,2)=0 is used. You can find the details of mod() function in SQL here.

As per the question, option and 1 and 2 from the given options in the quiz question are correct.

I hope it answers your question. Happy learning!