[Community Puzzle] Parse SQL Queries

My PHP code fails validation 2 “Drop Tables” but the Goal states “For simplicity there are no commands to manipulate tables and only one table to select from. Nothing more advanced than basic SELECT.” and there is nothing in the Goal or Input sections to suggest that tables will need to be dropped or what output is expected.

My code also fails validation 4 “Ternary Operator” but the Goal states “Since this is an easy puzzle the only condition you need to check for is if the values are equal.” and no examples of ternary operators appear in the Goal or Input sections to suggest that they are expected or how to deal with them.

I’m stumped as to what to do?

Test case and validator names are by themselves misleading :unamused:. You can assume that validators look alike the test case sturctures.

A trap is about identifying numerical columns and numerical values.
Remember “numbers” include both integers and float-point numbers.

4 Likes

Ahhh. My [double] bad for not reading the goal as closely as I thought I had then taking the validator titles at face value and looking in the wrong places for the problem.

Thanks.

Good puzzle, thanks!

1 Like

I just started working on this, and it looks like a good (very educational) puzzle.

Question: Are there Multiple conditions in some of these (in other words, things after “WHERE” that are “OR” or “AND”)?

If so, why is there not an example of that in a test case?

Thanks

1 Like

No, they are not tested.

There are no multiple conditions.

I am beginner in codinggame. I am finding it difficult to solve this puzzle.If we dont get any idea on how to proceed further and remain stuck will there be a possibility to learn from solutions who have already submitted the solution

6 Likes

You should try an easier puzzle.

Where do you put the query?

1 Like

Hi, for the “ORDER BY DESC” testcase, it seems like you can pass it without implementing ordering. I haven’t implemented it yet but still passed it. Maybe it should be edited?

1 Like

Good observation. As the author has deleted their account, I have taken the liberty of editing that testcase.

2 Likes

Dear fellas developers.
I just arrived on the so-called SQL exercise , where I thought the goal might be to make us write some SQL , in order to extract correctly the expected datas (columns and rows).
However, I absolutely don’t get what is expected from us. The presentation of the exercise is the most confusing I’ve ever seen. I suppose a good presentation should at least present :
1_ the tables from wich we apply our SQL-requests.
2_ The result we are supposed to find. (a new one at each question).
3_ eventually tell use where they want us to write the request , (a string in a console.log ? or a string attributed to a given variable name ? or else… )

I suppose I’m the dumb one , and that you all understood the exercise fast, clear and obvious. Would you guide me on what do they expect from us here ?
A thousand thanks.

6 Likes

Have you read the statement and study the example at the bottom? I think they have more or less described what you have asked for. Also, the default code tells you how to output your answer.

It is not a SQL puzzle … you don’t have to write the good SQL request to find something in the database, you have to write a programm that interpret and execute a given SQL request.

1 Like

This is the worst puzzle, so you have to answer each question with the exact words like the testcases, if I want to change my answer with a different scenario it is impossible and always is an error although the syntax is correct.
Can someone tell me if I am mistaken or what is going on ?

It is NOT a database allowing you to query whatsoever.
It has preset, fixed, inputs and outputs.
Because it is just a puzzle, not a DB. All puzzles behave in the same way.
Judging it to be bad based on the fact that it is not a DB and it does not accept alternative queries is unfair.

But for its unclear definition of requirements and statements, personally I do not think this is a great puzzle.

do you solve it?
I am stuck, I found the answer for every scenario but still cant solve the puzzle. is there any way ?

Which validators have you failed?

i am completly agree with, as my first puzzle in coding game and really understand the interface, this puzzle is completly shit… you never use it that way…