Skip to content

Commit 6d3fa4c

Browse files
author
Mohamed Sarwat
committed
Update README.md
1 parent ab900de commit 6d3fa4c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,22 @@ Similarly, materialized recommenders can be removed with the following command:
109109
DROP RECOMMENDER MovieRec
110110
```
111111

112+
### More Comples Queries
113+
The main benefit of implementation the recommendation functionality inside a database enine (PostgreSQL) is to allow for integration with traditional database operations, e.g., selection, projection, join.
114+
For example, the following query recommends the top 10 Comedy movies to user 1.
115+
In order to do that, the query joins the recommendation with the Movies table and apply a filter on the movies genre column (genre LIKE '%Comedy%').
116+
117+
118+
```
119+
SELECT * FROM MovieRatings R, Movies M
120+
RECOMMEND R.itemid TO R.userid ON R.ratingval
121+
USING ItemCosCF
122+
WHERE R.userid = 1 AND M.movieid = R.itemid AND M.genre LIKE '%Comedy%'
123+
ORDER BY R.ratingval
124+
LIMIT 10
125+
```
126+
127+
128+
112129
### Support or Contact
113130
Having trouble with RecDB ? contact [email protected] and we’ll help you sort it out.

0 commit comments

Comments
 (0)