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.

See declarative vs imperative instructions.

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.

This is a programming definitions.

References

https://docs.microsoft.com/en-us/answers/questions/211050/declarative-vs-imperative-language.html

https://oracle-patches.com/en/databases/sql/query-languages-for-data-sql,-declarative-mapreduce-queries

#definition