Search⌘ K
AI Features

Question: Import JSON Data

Explore the process of importing JSON Lines (JSONL) data into MySQL using LOAD DATA INFILE. Learn how to parse JSON objects line-by-line, handle conditional updates for supplier performance metrics, and ensure data accuracy for reports and SLA tracking. This lesson helps you apply complex import rules and update existing tables reliably.

Question

Given the following structure of the Customers table:

Field

Type

CustomerID

int

CustomerName

varchar(50)

Email

varchar(50)

Phone

varchar(15)

Address

varchar(100)

LastLogin

date

CreatedAt

timestamp

CustomerTier

enum('New','Regular','VIP')

ReferralID

int

LoyaltyPoints

int

LastPurchaseDate

date

IsChurnRisk

tinyint(1)

Where, CustomerID is the primary key and ReferralID is self-referencing to CustomerID. The table contains information about customers. The table includes a Boolean column IsChurnRisk, which indicates whether a customer is considered at risk of churning ( ...