No, you don't need ML/AI. You need SQL

转载自:https://cyberomin.github.io/startup/2018/07/01/sql-ml-ai.html

                                 No, you don't need ML/AI. You need SQL

A while ago, I did a Twitter thread about the need to use traditional and existing tools to solve everyday business problems other than jumping on new buzzwords, sexy and often times complicated technologies.

The thread did pretty well, eventually making it to the number one spot on Hackernews. The aftermath of its mini popularity was that it sparked some interesting conversation. With a camp agreeing with what I said and another not agreeing entirely with what I said to those who called me stupid and delusional. Well, the internet can be a wild wild west.

My attempt with this article isn’t to convince you to use my approach, rather, I intend to unpack what exactly I was saying in my initial Twitter thread.

You see, as the years go by, some interesting technologies and concept spring forth — machine learning, the blockchain, artificial intelligence, virtual reality, augmented reality, etc — while some existing ones take the back seat. It’s not uncommon to hear these days about people building fantastic products today backed by blockchain. I have seen blockchain backed e-commerce services, social networks and properties. The list goes on. I hear these days for you to close that funding round quickly and early enough, you must throw in “Blockchain” even if it has no relevance in the grand scheme of things.

A while ago, it was Machine learning and Artificial Intelligence. Everybody and their mother that had a landing page with a “join the waitlist” field had ML/AI on that page. Heaven forbids you put up that initial page and there was no mention of AI. Seriously, are you really in business? But honestly, this doesn’t have to be the case. One technology I am still bullish about to this day is the SQL (Structured Query Language). This over 40 years old technology is as relevant today as it was when it first appeared in 1974. While it has gone through some refining over the years, it’s still as powerful as ever.

I have spent all of my career in technology and I spent a good part of it working in e-commerce and I saw first hand how this technology allowed us to grow and scale the business. We used this technology to our advantage, as it allowed us to explore some interesting information from the data we gathered. These data included but not limited to consumer behaviours, shopping pattern and habits. It even allowed us to predict what stock keeping unit(SKU) we should be holding and what we shouldn’t. It even allowed us to delight our customers and re-engage with those that fell along the way. Let me tell you how we did it and how you too can.

It’s always fun when I speak to founders and potential founders and they are quick to tell me how they want to use AI/ML to improve customer retention and improve lifetime value(LTV). The truth is, they don’t even need machine learning or any of those fancy stuff. A properly written SQL is what they need. In a former life, I used to write SQL queries to extract valuable information and insights from the data we generated. One time, we needed to know who the customer of the week was, the idea was to 1) recognize them and 2) reward them. This simple and unexpected gesture the company displayed toward its customers always left people super delighted and it turned them into an evangelist. It wasn’t uncommon to see messages on social media like “Wow, Konga just rewarded me with N2,000 voucher for being the customer of the week. I didn’t expect this. Thanks, guys, you are the best.”

Do this proved more effective than spending that money on advertisement, don’t get me wrong, traditional advertising still has its place, but nothing beats word of mouth from a trusted friend. Surprisingly, getting this information wasn’t that difficult. No fancy technology was needed other than the good old SQL. To get the customer of the week, we basically wrote an SQL that selects from orders table where basket size is the biggest for that week. When we get this information, we will email a nice thank you note to the customer and attach a small coupon/voucher. Guess what? 99% of these people became repeat customers. We never needed ML. We just wrote a simple SQL and got this information.

One time we needed to reconnect with customers that hadn’t shopped in a while. Since I was responsible for this, I wrote a SQL query that gathered all the customers whose last shopped date was 3 months or more. The query, yet again, was surprisingly simple. I will write a query like select from order table where last shop date is 3 or more months. When we get this information, we will send a nice “we miss you, come back and here’s X Naira voucher” email. The conversation rate for this one was always greater than 50%. And there was always a flurry of messages on social media too. In my opinion, these two strategies were and still is a lot more effective than spending on Google and Facebook ads.

We applied this same thinking to newsletters. I mean, why send a generic newsletter to everyone when you could attempt to personalize it? Solution? I wrote SQL queries to check basket content and extract individual items. From these items, we could build a newsletter off it and target relevant content. For instance, say a person bought a pair of shoe, sunglasses and a book. For their newsletter, we will show include shoes, sunglasses and books. This was a lot more relevant than sending random stuff. I mean, why send a letter with breast pumps to a man that just bought a pair of sneakers? It doesn’t even make sense. The typical open rate for most marketing emails is anywhere between 7 - 10%. But when we did our work well, we saw close to 25 - 30%.

This is three times more than the industry standard. Another nice touch for those emails was that we addressed people by their names. No Dear Customer. It was always Dear Celestine, Dear Omin, etc. It brought a human touch to the whole game. It showed we cared. All of these happened courtesy of the good old SQL, not some fancy machine learning.

For those customers who couldn’t complete their orders for one reason or another, we didn’t let them drop off too. For as long as they added an item to their cart, that suggests that they had intentions of buying. To get them to check out, I wrote a nice SQL script, paired it with a CRON job and this combination fired an email to customers whose carts had a last updated period of 48 hours or more. Guess what? It worked. Because we could track these emails, we could tell people came back to complete their orders based on those emails. Yet again, the SQL for this was super simple. It selected from the cart where the state is not empty and last update period was more than or equal to 48hrs. We set the CRON to run at 2 AM every day, this was period with less activity and traffic. Customers will then wake up to emails reminding them about their abandoned carts. Talk about reengagement. Nothing fancy here, just SQL, Bash and CRON in action.

Since payment on delivery(POD) was big and still is a thing, SQL yet again came in handy. Customers that will cancel orders three consecutive times, we placed them under a high alert bucket. Next time they made an order, we called and made sure they actually needed the order. This way, we saved time and unnecessary stress. Altogether, POD can be disabled for these customers and the only payment method will be a card or a wallet. In e-commerce, logistics is expensive, so it made sense to focus on serious customers. We didn’t need ML or some fancy AI for this problem. Again, well-written SQL was all we needed.

For orders that weren’t delivered during our SLA window, we used SQL queries to manage customer expectations too. We selected from orders where status is not delivered and order date >= 7 days. As this is the standard delivery period. We paired this with a CRON job that fires email and SMS to customers. While customers didn’t immediately jump and clapped for us. At the very least, it reassured them that we actually cared and were working to solve the problem. Nothing is as annoying as delayed orders.

This particular solution also had a dramatic effect on our NPS. Again, good old SQL + Bash saving the day.

Bonus: Sift Science is doing an amazing job with fraud prevention. But SQL can come in handy too. If a person tries to checkout with 3 different cards at the same time and these cards bounced, something funny is happening. The first and obvious thing to do here is to block their account temporary for a while. You will be saving the potential card owners a lot of headaches. You don’t need to store card details, just store card checkout attempt for a particular order number and you will be fine. These are low hanging fruits that need no ML but a well-written SQL.

I am knocking on ML/AI. These technologies have their place, if anything, Amazon has proven their effectiveness. But if you’re running a small online store with between 1,000 - 10,000 customers, then you can still very much live on SQL. Besides, the ML/AI talents aren’t a dime a dozen.

You run an e-commerce store and you need help on any of these? Reach out, I am always happy to listen to your problem.

I'll love to hear from you

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 215,794评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,050评论 3 391
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 161,587评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,861评论 1 290
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,901评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,898评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,832评论 3 416
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,617评论 0 271
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,077评论 1 308
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,349评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,483评论 1 345
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,199评论 5 341
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,824评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,442评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,632评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,474评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,393评论 2 352

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,322评论 0 10
  • 十岁的我,用一双胖乎乎的小手,握着一支葫芦丝,嘴巴努力的撮着,嘴唇高高的撅起,小脸鼓的圆圆的,吹奏出没人能听...
    莘莘学子521阅读 290评论 0 6
  • 题记:游园而有所感,遂得绝句。 若英怀风简书诗集 1.游园感怀 文/若英怀风 序: 花是花, 蝶非蝶。花始开,蝶未...
    草莓味的艾比姑娘阅读 431评论 0 1
  • 习惯了一个人 其实我并不喜欢一个人。
    经飞阅读 158评论 0 0