No, you do not need machine learning. You need SQL

Original author: Celestine Omin
  • Transfer
Some time ago I published a series of tweets about using traditional tools instead of newfangled and complex technologies.

Tweets went well and got to HackerNews. The consequence of this mini-popularity was an interesting discussion. Some agreed with me, while others called it stupidity and nonsense. Well, there are gunfights on the Internet too.

I'm not trying to convince you to use your approach. Rather, I want to explain in more detail what exactly was meant in the original speech on Twitter.

Years pass, and you see the emergence of some interesting technologies and concepts: machine learning, blockchain, artificial intelligence, virtual reality, augmented reality, etc. - while some of the old technologies fade into the background. Today it is easy to hear about the development of some fantastic products on the blockchain. I have seen blockchain services for e-commerce, social networks and real estate. The list can be continued. I hear the words: in order for you to close the round of financing faster and earlier, you need to use the word “blockchain”, even if it is not related to the project.

Some time ago, machine learning and artificial intelligence were in trend. Each new startup was engaged in ML / AI. God forbid you run the project without mentioning AI. Seriously, are you really in business? But in general, this should not be so. One technology that I still highly appreciate is SQL (Structured Query Language). This more than 40-year-old technology is as relevant today as it was in 1974. Although over the years it has changed somewhat, but it is as powerful as before.

I have been working in IT all my life, and spent most of my career in e-commerce - and saw with my own eyes how this technology helped grow and scale a business. We used it to identify interesting information in the collected data. Data includes consumer behavior, shopping patterns and habits. This technology has allowed to predict which product to keep in stock and which not. She allowed to provide better quality service and return customers. Let me tell you how we did it - you can use our experience.

It is always fun to hear from founders and potential founders of startups that they want to use AI / ML to better retain customers and increase their lifetime value [total profit or loss from a particular consumer during the period of cooperation with him - approx. trans.]. In fact, they do not need machine learning at all or some other of these fancy technologies. Properly written SQL is all they need. In my previous life, I wrote SQL queries to extract valuable information and ideas from the generated data. Once we wanted to find “customers of the week” to congratulate and reward them. Such a simple and unexpected gesture towards customers always delights people and turns them into evangelicals. You can often see posts on social networks like “Wow, Konga just rewarded me with a ₦ 2000 coupon as a client of the week. I did not expect this. Thanks guys, you're the best. ”

It turned out to be more efficient than spending money on advertising. Don't get me wrong, traditional advertising takes place, but nothing compares to a recommendation from a reliable friend. Surprisingly, getting this information turned out to be quite simple. No fancy technology is needed except the good old SQL. To identify the client of the week, we wrote a SQL query that finds an entry in the table of orders with the largest basket of orders in a week. After receiving this information, we send a letter of thanks to the client and attach a small coupon / voucher. Guess what happens next? 99% of these people become regular customers. We never needed ML. They just wrote an elementary SQL query and got this information.

One day it was necessary to reconnect with customers who had stopped shopping. Since I was doing this, I wrote a SQL query that selected all customers with a last purchase date of 3 months or more. Again, the query is surprisingly simple. After receiving this information, we e-mail a nice letter: “We miss you, come back, and here is your coupon for X Naira” [Nigeria's monetary unit - approx. trans.]. Response efficiency has always been greater than 50%. And always a flurry of messages in social networks. In my opinion, these two strategies were and remain much more efficient than spending on advertising on Google and Facebook.

We applied the same approach to newsletters. Why send a general newsletter if you can try to personalize it? Decision? I wrote SQL queries to check the contents of the cart and retrieve individual items. From these elements, we were able to generate a newsletter and target relevant content. Let's say a person bought a pair of shoes, sunglasses and a book. In the newsletter for him, we will show shoes, sunglasses and books. This is much more appropriate than sending random things. Why send a letter with a breast pump to a man who just bought a pair of sneakers? It doesn't even make sense. A typical level of viewing (open rate) of most marketing letters is from 7 to 10%. But when we did a good job, we saw an indicator in the region of 25-30%.

This is three times the industry standard. Another nice feature of these letters is that we addressed people by name. No "dear customer". Only "dear Celestine", "dear Omin" and so on. It gives a shade of humanity to everything. Shows our participation. All thanks to the good old SQL, and not some fancy machine learning.

We helped clients who for some reason did not complete orders. If they added a product to the cart, they had the intention to buy it. To help them complete the order, I wrote a SQL script, linked it to the CRON task, and this combination sent emails to customers whose baskets were last updated within 48 hours or more. Guess what happened? It worked. We traced the letters and concluded that people did return on the links from them. Again, the SQL query was very simple. He chose non-empty baskets with a last update time of 48 hours or more. Launched a daily CRON at 2 am - a time of less activity and traffic. Customers wake up and see in the mail a reminder of their forgotten basket. It's about re-engaging customers. Nothing fancy, just SQL, Bash and CRON.

Since payment is in fact still popular, SQL came in handy again. If a customer cancels orders three times in a row, they are placed on a separate “special warning” list. With the next order they call and ask if the order is really needed. Thus, we save time and nerves. For such clients, payment by fact can be turned off altogether, leaving only payment by card. In e-commerce, logistics is expensive, so it makes sense to focus on serious customers. We don't need ML or some freaky AI for this problem. Again, fairly well written SQL.

For orders that were not delivered at the promised time according to the SLA, we also used SQL queries. Were selected orders with the status “Not delivered” and the order date equal to or more than 7 days, as this is the standard delivery time. The CRON job sent letters and SMS to such clients. It is clear that customers did not applaud standing. But we at least assured that we do not give a damn and we are working to solve the problem. Nothing is as annoying as a delayed order.

This particular decision also had a significant impact on NPS [Consumer Loyalty Index - approx. trans.]. Again, good old SQL and Bash.

Bonus: Sift Science surprisingly well prevents fraud. But SQL can also be used. If a person tries to pay off three different cards and these cards are discarded one after the other, something wrong happens. The first and obvious thing to do is to temporarily block his account. You will save potential cardholders from a big headache. You do not need to store the card data, simply register in the database an attempt to check the card for a specific order number. To identify such obvious things, ML is not required, but only well-written SQL.

Machine learning and artificial intelligence are good technology. In any case, Amazon has proven the effectiveness of its business. But if you have a small online store with 1000-10000 clients, you can get by with SQL. In addition, ML / AI specialists are not cheap.

I will be glad to hear what you think.

Also popular now: