Re: "I know what is under the table" or "I know what under the table is"?
Yes, exactly. It's possible to create a situation in which "I know what the end of the rainbow is" could be correct, but it doesn't match the situation you described.
Do you know what's in my hand?
Yes, I know what is in your hand.
Do you know what is [hiding] under the table?
I know what is under the table.
I'm not a teacher, but I write for a living. Please don't ask me about 2nd conditionals, but I'm a safe bet for what reads well in (American) English.