There are broadly two methods to execute queries in database –
- Imperative – in this, code tells computer to perform certain operations in sequence. Most of the programming languages are imperative.
- Declarative – in this method, one specifies the pattern of data needed, rest all is taken care by query optimizer. Most of the SQL languages are declarative. It is easier to work with, hides database engine’s implementation details. Also these languages support parallisation across multiple machines.
MapReduce Querying –
- Neither imperative, nor declarative, combination of two.
- It is based on the map (also known as collect) and reduce (also known as fold or inject) functions that exist in many functional programming languages.
- Map and reduce are pure functions, which means they only use the data that is passed to them as input, they cannot perform additional database queries, and they must not have any side effects.
Thanks for stopping by! Hope this gives you a brief overview in to query languages for data models. Eager to hear your thoughts and chat, please leave comments below and we can discuss.