Ad
  • Custom User Avatar

    If I repeat the above "attempt" to log the data for Ryu until I get a dataset that has Ryu in the expected top 6, the expected result for Ryu is: 42 wins, 11 losses, and his fight records are:

    id	name	won	lost	move_id
    739	Ryu	2	0	7
    187	Ryu	1	0	7
    215	Ryu	2	0	6
    236	Ryu	1	0	4
    349	Ryu	1	0	8
    368	Ryu	2	0	7
    380	Ryu	1	0	7
    415	Ryu	2	0	8
    420	Ryu	2	0	8
    499	Ryu	2	0	7
    584	Ryu	2	0	4
    721	Ryu	2	0	6
    95	Ryu	1	0	6
    106	Ryu	1	0	8
    113	Ryu	1	0	8
    133	Ryu	2	0	8
    165	Ryu	2	0	8 
    --> 17 records with lost= 0 (7x won 1, 10X won 2)
    
    35	Ryu	2	1	6 
    59	Ryu	1	1	8
    319	Ryu	2	1	4
    690	Ryu	1	1	7
    510	Ryu	2	1	4
    534	Ryu	1	1	7
    33	Ryu	2	1	4
    688	Ryu	1	1	7
    476	Ryu	1	1	8
    493	Ryu	1	1	7
    290	Ryu	1	1	7
    11 records with lost= 1 (4x 2, 7x 1)
    

    --> Here, there are 17 records with lost= 0, but only 11 are actually expected. So now we would need to exclude 6 fight records with lost= 0.

    However, of those 17, 7 have won= 1, and 10 have won= 2, which does not leave any way to proceed other than assuming lost= 1 would possibly mark a LOSS (which the description has ruled out).

    #########################
    I would consider this an ISSUE, but I cannot edit the label here...

  • Custom User Avatar

    Logging the countable results of one fighter in an "Attempt" with:
    SELECT * FROM fighters WHERE name='Ryu' AND move_id> 3 ORDER BY lost;

    results in:

    id	name	won	lost	move_id
    649	Ryu	1	0	8
    106	Ryu	1	0	4
    179	Ryu	1	0	8
    187	Ryu	1	0	6
    447	Ryu	1	0	6
    462	Ryu	1	0	4
    569	Ryu	1	0	5
    570	Ryu	1	0	5
    10	Ryu	2	0	5
    297	Ryu	2	0	8
    485	Ryu	2	0	6
    628	Ryu	2	0	5
    558	Ryu	2	0	6
    240	Ryu	2	0	6  
    --> 14 records showing 0 in column "lost"
    
    225	Ryu	1	1	4 
    377	Ryu	1	1	4
    458	Ryu	1	1	4
    58	Ryu	1	1	7
    503	Ryu	1	1	4
    478	Ryu	2	1	4
    580	Ryu	2	1	7
    309	Ryu	2	1	6
    76	Ryu	2	1	7
    295	Ryu	2	1	6
    373	Ryu	2	1	5
    185	Ryu	2	1	8
    468	Ryu	2	1	8
    472	Ryu	2	1	5
    --> 14 records not showing 0 in column "lost" (5x won= 1, 9x won= 2) --> 18+5= 23
    

    The expected result for Ryu in this attempt is: Ryu wins: 43, Ryu lost: 14.

    From this we can assume that all lost= 0 recordings mark a LOSS, and that won= 2 is not a DRAW, but a WIN with special points that have to be accounted for in the query. But if so, how would we arrive at 43?

    As won= 1 has been declared as a regular win and lost= 0 seems to be counted as 1, it seems fair to think those five results with won= 1 should be counted as 1 each. That would mean the 9 won= 2 records had to be multiplied with some factor, but 43- 5= 38, and 38/ 9= 4,2222, which would be a bit odd. Are the data just broken here?

  • Custom User Avatar

    I love this kata, especially its LOTR part

  • Custom User Avatar

    Hello I'm a beginner so this sentence made me confused:
    'Practise some SQL fundamentals by making a simple database on a topic you feel familiar with. Or use mine, populated with a wealth of Sailor Moon trivia.'
    I tapped query: 'create database dog;' thinking I have a task to make database on a topic that im familiar with. But this was not at all the assignment.

    Please make assignment more clear by deleting mentioned above sentence.

  • Custom User Avatar

    THANK YOU- This solved the issue I was having!

  • Custom User Avatar
  • Custom User Avatar

    The problem description is quiet vague for me.

  • Custom User Avatar

    this was fun, had me confused with the amount of records returned for a second (was using inner join instead of left)

  • Custom User Avatar
  • Custom User Avatar

    Please use the appropriate tag (Use issue and suggestion tags only if there is something wrong / to improve the kata itself) and refrain from posting working solutions in the discourse.

    Thank you 😃.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I like your attitude towards grumpy people!

  • Custom User Avatar

    When asking Google for help, make sure to also look up the SQL server you're using

  • Custom User Avatar

    dont know why everyone is ragging on this kata, I thought it was fine. The columns to merge on are a bit confusing I suppose.

  • Custom User Avatar

    Please change the description. I had to read the comments to solve this kata. It is poorly described!

  • Loading more items...