I don't understand how we are supposed to handle the data types for this problem.
Halfway through the sequence, the number of digits are huge. The bigint data type is insufficient to contain all the digits
You are still expected to return an int data type at the end whilst retaining the precision of the addition.
How is this problem supposed to be handled?
EDIT :I solved it literally minutes later with the decimal data type, however, I am still confused when I compare vs other solutions which do not utilise the work around I did...
It doesnt matter what the alias is, you can alias the tables whatever you want. You can alias the people table as "x" or "table1" it doesn't really matter. People normally shorthand it to "p" because its less text to type and it is intuitive to relate it to "people".
I disagree, it reads the same as your own solution. Its only unreadable if you dont understand the syntax.
lol: "this is the clever bit", 10 lines down "this is the clever bit"
bigint
(8 bytes, 63 bits for positive numbers) is sufficient for this task. The 90-th fibonacci number (n = 89
) is 61 bit long.I don't understand how we are supposed to handle the data types for this problem.
Halfway through the sequence, the number of digits are huge. The bigint data type is insufficient to contain all the digits
You are still expected to return an int data type at the end whilst retaining the precision of the addition.
How is this problem supposed to be handled?
EDIT : I solved it literally minutes later with the decimal data type, however, I am still confused when I compare vs other solutions which do not utilise the work around I did...
Very challenging kata, very good thing to learn how to count overlaps. Had to draw a lot of diagrams just visualise what my query is attempting to do.
If the intent was to use DML statements only, shouldn't there be a test case to prevent you from using DDL statements?
You can query the tables, you just need to do a select on the table name and it will appear
funny
the troll is real
This comment is hidden because it contains spoiler information about the solution
It doesnt matter what the alias is, you can alias the tables whatever you want. You can alias the people table as "x" or "table1" it doesn't really matter. People normally shorthand it to "p" because its less text to type and it is intuitive to relate it to "people".