In declarative programming you expresses the logic of a program without defining every step the program needs to take to achieve the goal. (What should the program accomplish?)
Or as put on Wikipedia it ‘expresses the logic of a computation without describing its control flow.’
This is in contrast to a imperative programming where you tell the program more exactly what to do.
In a declarative query language like SQL, you specify what data you want, and how you want it transformed (grouped, sorted, aggregated), but not how the database should deliver you the results.
A declarative programming or query language is less specific about how leaving it up to the interpreter to optimise that aspect, and you can focus on the what.
It seems like programming languages don’t have to be either imperative or declarative, but often have aspects of both.