8 kyu
Register for the Party (SQL for Beginners #3)
22,568 of 22,570MaikelNabil
Loading description...
Fundamentals
SQL
Databases
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
From my understanding of this exercise, when doing different tasks with SQL (querying, changing, creating) is each respective task supposed to end with a ';' or can there just be one at the end?
Mybe that's just me but from the way the exercise is worded, I assumed it was expected to write a query that would ONLY insert the new row IF the participant was age 21 or older. Another way to understand it would be that at any attempt that you try to add a particpant younger than 21 to the table, it would change the 'attending' column to False.
Both ways seem too hard for a Kyu 8 level, but well... the wording should really be reconsidered.
For my fellow strugglers: You need to first simply insert your row and then just print the table with the age-condition.
This is easy, but sometimes we forget about semicolons in SQL, good exercise
why won't using INSERT into participants Values (value1,value2,value3) work....
It works, but the description for this task is too vague, it's unclear how the outcome should look like.
You need to finish first (INSERT INTO) query with ; and then follow it with second query: SELECT * FROM participants;
This was supposed to be easy but one popular programming character made it tricky
Absolutely loved this train! Good excercise.
double quotes exist
yeah agree that the kata description could be clearer on what the output should be. But this can be easily fixed. I had to read the discourse comments before trying it out that the author wanted the results to be displayed back after the insert command. ;)
I would suggest to update the Kata description to one where the output is a bit clearer. It is supposed to be for beginners and I saw a lot of comments of people struggling to understand that you need to insert AND show the resuts. Those are two queries and it can be confusing for someone just starting.But overall, it's good for practice.
Bumping, because 3 years later it still hasn't been updated xD
The second query is already written, the only thing you should do is complete the insert query.
I fail to see what's confusing there.
I believe some of the katas I have trained on are missing some key information about the expected outcome. Here's a bit tricky because it says just insert, but not show, which is what makes the difference between doing just one query, or two, which is what you need here.
This comment has been hidden.
This task was not quite obvious for me. I've tried to perform insert-select query, until I saw in discuss that it was necessary to put ; after the first query to separate insert from select.
That SELECT part that you have to add was horrendous, easily the worst kata I've done.
This kata is bad written. I thought that was about insert-select. Also, the condition wasn't necesary. It's a simple excersice to insert. Some kate are more complicates to understand because was bad written.
I don't know what you're talking about, if you insert an age less than 21 your code won't pass the tests. Unless you're saying that doesn't add anything useful to the exercise.
I only miss one little detail from the description. At a beginner level it's not evident how to separete an insert from a select after it (not even evident it has to be separated to be precise). As it's a must to leave the select there, could you please add a half row to the description stating that we have to use a ";" to separete commands? Thanks :)
That got me also. Thanks for your comment
Ditto! That extra ";" needed had me rewriting the INSERT statement in enough ways that I thought there was something definity wrong on the other end.
I'm at 5 kyu, but this is the first "insert" kata I've come across. Thanks for widening the skill pool!
Great kata, thank you! :)
The instructions are not clear. If I only insert a record for myself, how are you to expect 3 records to be returned. (only 1 record will come back) Also the instructions do not say whether to insert myelf as over 21 or not. (This will determine how many records may come back)
The party is for individuals 21 years old or above. The task is to attend, then you have to be +21. There are other attending individuals in the database. The test will return 3 results if you inserted a correct row to the database.
Great Kata for Kyu 8 level.
Thanks!
I'm not sure there's any value in making description as difficult to understand as you did. Simple "write an insert statement" would be better.
Just added this. Thanks a lot for your comment!
Dont forget to remove the comments in the initial solution editor. Hopefully you don't do what I did and pushed the comments, "//Your Code Here", to the next line instead of completely removing them thinking it was an SQL comment and then proceeded to submit the solution, it's not an SQL comment. :) Since I pushed it to the next line, it seems like the interpretor processed my insert then silently or gracefully exited afterwords without processing the subsequent SELECT statement at the bottom. I was bamboozled for a bit, more than I'd like to admit.
// Your code here (not an SQL comment; the interpretor will error out--hopefully not silently) vs -- Your code here (SQL comment the SQL interpretor will skip)
My Example:
SELECT 'Dont forget to remove the forward slash comments below when you do the insert' FROM participants;
//Your Code Here
SELECT * FROM participants;
Thanks a lot for this helpful comment. I've updated the commented phrase in the cata.
The table content is not tested.
Can you explain more what do you mean?
The task is to insert some data but the tests check only what's returned by a query and not what's in the table after that.
There are 3 tests which check the content of the table. One test checks the names column to make sure it has no empty values, one checks the age column to make sure it's +21, and one checks the attending coumn to make sure all the values are true. What else should I look for?
Ok. Now I get it. I'll add a test to fix this. Thanks!
I've edited the tests. Now you must use an insert statement for the tests to pass.