It's difficult to give any advice without knowing the sort of questions you were asked, can you give any examples?
When I first learnt SQL I remember finding it really fiddly and kept making syntax errors due to it being so different to traditional programming.
I did loads of multiple choice practice tests where all the answers are very similar. So frustrating at first but helps to identify all the "gotchas" of the language.
These days it might be useful to paste your non-working query into ChatGPT and ask why it's incorrect.