Search⌘ K
AI Features

Question: Common Table Expressions

Understand how to apply common table expressions (CTEs) in MySQL to classify suppliers by delivery risk levels based on performance metrics. Learn to write queries that use CASE expressions within CTEs to filter and order supplier data, enabling focused SLA review and enhanced reporting.

Question

Given the following structure of the Suppliers table:

Field

Type

SupplierID

int

SupplierName

varchar(50)

Email

varchar(50)

Phone

varchar(15)

Address

varchar(100)

OnTimeDeliveryRate

decimal(5,2)

AvgLeadTime

int

Where, SupplierID is the primary key. The table contains information about the supplier of products.

The operations team wants a focused list of suppliers that might need closer SLA reviewAn SLA review is the evaluation of a Service Level Agreement to ensure agreed service standards and performance metrics are being met.. You are asked to ...