case study building recommender system inside database let' look at an actual implementation in python to make this all clearer step research question let' say you're working in video store and the manager asks you if it' possible to use the information on what movies people rent to predict what other movies they might like your boss has stored the data in mysql databaseand it' up to you to do the analysis what he is referring to is recommender systeman automated system that learns people' preferences and recommends movies and other products the customers haven' tried yet the goal of our case study is to create memory-friendly recommender system we'll achieve this using database and few extra tricks we're going to create the data ourselves for this case study so we can skip the data retrieval step and move right into data preparation and after that we can skip the data exploration step and move straight into model building step data preparation the data your boss has collected is shown in table we'll create this data ourselves for the sake of demonstration table excerpt from the client database and the movies customers rented customer movie movie movie movie jack dani wilhelmson jane dane xi liu eros mazo for each customer you get an indication of whether they've rented the movie before ( or not ( let' see what else you'll need so you can give your boss the recommender system he desires first let' connect python to mysql to create our data make connection to mysql using your username and password in the following listing we used database called "testreplace the userpasswordand database name with the appropriate values for your setup and retrieve the connection and the cursor database cursor is control structure that remembers where you are currently in the database