First of all I'd like to say that I don't have much experience but I started learning dbs after having a couple of subjects related to dbs at my university (so please keep that in mind while you're reading this).
I already asked this question on stackoverflow but I didn't get a conclusive answer so I thought it might be a good idea to ask the same question here since this site is focused solely on databases and their ins and outs.
I want to change a single element of a nested array using the UPDATE, DELETE or INSERT commands. In this case I wanted to update a single element of an array by swapping out one of the 'lastName' values for another using the UPDATE command (the syntax I'm using is probably wrong but that's the most I could work out from what I've read in the official documentation). I used dbfiddle to test out if what I am doing would work before putting anything into the real database as to not make any unnecessary mistakes. Here is what I have written in dbfiddle https://dbfiddle.uk/?rdbms=postgres_10&fiddle=ecc2329efea6af28636b3537d46b6c01
I'd be grateful if someone could clarify what I'm doing wrong. If you have any suggestions on how this sort of thing should be done, I'd be more than happy to get some constructive feedback.