Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MemSQL Telco Customer Churn Dataset
DROP DATABASE IF EXISTS churn_example;
CREATE DATABASE churn_example;
USE churn_example;
CREATE TABLE telco_customer_churn
(
customerID TEXT,
gender TEXT,
SeniorCitizen BOOLEAN,
Partner TEXT,
Dependents TEXT,
tenure INT,
PhoneService TEXT,
MultipleLines TEXT,
InternetService TEXT,
OnlineSecurity TEXT,
OnlineBackup TEXT,
DeviceProtection TEXT,
TechSupport TEXT,
StreamingTV TEXT,
StreamingMovies TEXT,
Contract TEXT,
PaperlessBilling TEXT,
PaymentMethod TEXT,
MonthlyCharges DECIMAL(13, 4),
TotalCharges DECIMAL(13, 4),
Churn TEXT,
PRIMARY KEY (customerID)
);
CREATE or REPLACE PIPELINE `telco_customer_churn` AS
LOAD DATA S3 'download.memsql.com/first-time/WA_Fn-UseC_-Telco-Customer-Churn.csv'
CONFIG '{"region": "us-east-1"}'
SKIP DUPLICATE KEY ERRORS
INTO TABLE `telco_customer_churn`
FIELDS
TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
IGNORE 1 LINES;
START PIPELINE `telco_customer_churn` FOREGROUND;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.