diff --git a/persistence-modules/spring-data-jpa-query/README.md b/persistence-modules/spring-data-jpa-query/README.md
new file mode 100644
index 0000000000..bfff3c0ef3
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/README.md
@@ -0,0 +1,22 @@
+## Spring Data JPA - Query
+
+This module contains articles about querying data using Spring Data JPA
+
+### Relevant Articles:
+- [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date)
+- [The Exists Query in Spring Data](https://www.baeldung.com/spring-data-exists-query)
+- [Customizing the Result of JPA Queries with Aggregation Functions](https://www.baeldung.com/jpa-queries-custom-result-with-aggregation-functions)
+- [Limiting Query Results with JPA and Spring Data JPA](https://www.baeldung.com/jpa-limit-query-results)
+- [Sorting Query Results with Spring Data](https://www.baeldung.com/spring-data-sorting)
+- [Spring Data JPA Query by Example](https://www.baeldung.com/spring-data-query-by-example)
+- [JPA Join Types](https://www.baeldung.com/jpa-join-types)
+- [Spring Data JPA and Named Entity Graphs](https://www.baeldung.com/spring-data-jpa-named-entity-graphs)
+
+### Eclipse Config
+After importing the project into Eclipse, you may see the following error:
+"No persistence xml file found in project"
+
+This can be ignored:
+- Project -> Properties -> Java Persistance -> JPA -> Error/Warnings -> Select Ignore on "No persistence xml file found in project"
+Or:
+- Eclipse -> Preferences - Validation - disable the "Build" execution of the JPA Validator
diff --git a/persistence-modules/spring-data-jpa-query/pom.xml b/persistence-modules/spring-data-jpa-query/pom.xml
new file mode 100644
index 0000000000..71498143c3
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/pom.xml
@@ -0,0 +1,48 @@
+
+
+ 4.0.0
+ spring-data-jpa-query
+ spring-data-jpa-query
+
+
+ com.baeldung
+ parent-boot-2
+ 0.0.1-SNAPSHOT
+ ../../parent-boot-2
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+
+ com.h2database
+ h2
+
+
+
+ net.ttddyy
+ datasource-proxy
+ ${datasource-proxy.version}
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+ org.springframework
+ spring-oxm
+
+
+
+
+ 1.4.1
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/Application.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/Application.java
new file mode 100644
index 0000000000..3ea3d113da
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/Application.java
@@ -0,0 +1,13 @@
+package com.baeldung;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+
+}
diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/Comment.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/Comment.java
new file mode 100644
index 0000000000..26c2373cbe
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/Comment.java
@@ -0,0 +1,85 @@
+package com.baeldung.aggregation.model;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import java.util.Objects;
+
+@Entity
+public class Comment {
+ @Id
+ private Integer id;
+ private Integer year;
+ private boolean approved;
+ private String content;
+ @ManyToOne
+ private Post post;
+
+ public Comment() {
+ }
+
+ public Comment(int id, int year, boolean approved, String content, Post post) {
+ this.id = id;
+ this.year = year;
+ this.approved = approved;
+ this.content = content;
+ this.post = post;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getYear() {
+ return year;
+ }
+
+ public void setYear(Integer year) {
+ this.year = year;
+ }
+
+ public boolean isApproved() {
+ return approved;
+ }
+
+ public void setApproved(boolean approved) {
+ this.approved = approved;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Post getPost() {
+ return post;
+ }
+
+ public void setPost(Post post) {
+ this.post = post;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof Comment)) {
+ return false;
+ }
+ Comment comment = (Comment) o;
+ return getId().equals(comment.getId());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getId());
+ }
+}
diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/Post.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/Post.java
new file mode 100644
index 0000000000..f396e080ae
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/Post.java
@@ -0,0 +1,75 @@
+package com.baeldung.aggregation.model;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import java.util.List;
+import java.util.Objects;
+
+@Entity
+public class Post {
+ @Id
+ private Integer id;
+ private String title;
+ private String content;
+ @OneToMany(mappedBy = "post")
+ private List comments;
+
+ public Post() {
+ }
+
+ public Post(Integer id, String title, String content) {
+ this.id = id;
+ this.title = title;
+ this.content = content;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public List getComments() {
+ return comments;
+ }
+
+ public void setComments(List comments) {
+ this.comments = comments;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof Post)) {
+ return false;
+ }
+ Post post = (Post) o;
+ return getId().equals(post.getId());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getId());
+ }
+}
diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/custom/CommentCount.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/custom/CommentCount.java
new file mode 100644
index 0000000000..510b52a47c
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/custom/CommentCount.java
@@ -0,0 +1,27 @@
+package com.baeldung.aggregation.model.custom;
+
+public class CommentCount {
+ private Integer year;
+ private Long total;
+
+ public CommentCount(Integer year, Long total) {
+ this.year = year;
+ this.total = total;
+ }
+
+ public Integer getYear() {
+ return year;
+ }
+
+ public void setYear(Integer year) {
+ this.year = year;
+ }
+
+ public Long getTotal() {
+ return total;
+ }
+
+ public void setTotal(Long total) {
+ this.total = total;
+ }
+}
diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/custom/ICommentCount.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/custom/ICommentCount.java
new file mode 100644
index 0000000000..acb25cfd49
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/model/custom/ICommentCount.java
@@ -0,0 +1,8 @@
+package com.baeldung.aggregation.model.custom;
+
+public interface ICommentCount {
+
+ Integer getYearComment();
+
+ Long getTotalComment();
+}
diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/repository/CommentRepository.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/repository/CommentRepository.java
new file mode 100644
index 0000000000..89e9345e94
--- /dev/null
+++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/repository/CommentRepository.java
@@ -0,0 +1,27 @@
+package com.baeldung.aggregation.repository;
+
+import com.baeldung.aggregation.model.Comment;
+import com.baeldung.aggregation.model.custom.CommentCount;
+import com.baeldung.aggregation.model.custom.ICommentCount;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CommentRepository extends JpaRepository {
+
+ @Query("SELECT c.year, COUNT(c.year) FROM Comment AS c GROUP BY c.year ORDER BY c.year DESC")
+ List