select distinct t1.customer_details from customers as t1 join customers_and_services as t2 on t1.customer_id  =  t2.customer_id where t2.service_id  =  (select service_id from services group by service_id order by count(*) asc limit 1)
Find the details of the customers who have used the least-used service .
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Details VARCHAR(255),
PRIMARY KEY (Service_ID)
);
CREATE TABLE Customers (
Customer_ID INTEGER NOT NULL,
Customer_Details VARCHAR(255) NOT NULL,
PRIMARY KEY (Customer_ID)
);
CREATE TABLE Channels (
Channel_ID INTEGER NOT NULL,
Channel_Details VARCHAR(255) NOT NULL,
PRIMARY KEY (Channel_ID)
);
CREATE TABLE Customers_and_Services (
Customers_and_Services_ID INTEGER NOT NULL,
Customer_ID INTEGER,
Service_ID INTEGER,
Customers_and_Services_Details CHAR(15) NOT NULL,
PRIMARY KEY (Customers_and_Services_ID),
FOREIGN KEY (Service_ID) REFERENCES Services (Service_ID),
FOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID)
);
CREATE TABLE Customer_Interactions (
Customer_Interaction_ID INTEGER NOT NULL,
Channel_ID INTEGER,
Customer_ID INTEGER,
Service_ID INTEGER,
Status_Code CHAR(15),
Services_and_Channels_Details VARCHAR(255),
PRIMARY KEY (Customer_Interaction_ID),
FOREIGN KEY (Service_ID) REFERENCES Services (Service_ID),
FOREIGN KEY (Channel_ID) REFERENCES Channels (Channel_ID),
FOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID)
);
CREATE TABLE Integration_Platform (
Integration_Platform_ID INTEGER NOT NULL,
Customer_Interaction_ID INTEGER NOT NULL,
Integration_Platform_Details VARCHAR(255) NOT NULL,
PRIMARY KEY (Integration_Platform_ID),
FOREIGN KEY (Customer_Interaction_ID) REFERENCES Customer_Interactions (Customer_Interaction_ID)
);
CREATE TABLE Analytical_Layer (
Analytical_ID INTEGER NOT NULL,
Customers_and_Services_ID VARCHAR(40) NOT NULL,
Pattern_Recognition VARCHAR(255) NOT NULL,
Analytical_Layer_Type_Code CHAR(15),
PRIMARY KEY (Analytical_ID),
FOREIGN KEY (Customers_and_Services_ID) REFERENCES Customers_and_Services (Customers_and_Services_ID)
);
INSERT INTO `Customers` (`Customer_ID`, `Customer_Details`) VALUES (12, 'Amalia Johnston')
INSERT INTO `Channels` (`Channel_ID`, `Channel_Details`) VALUES (16, '15 ij')
INSERT INTO `Services` (`Service_ID`, `Service_Details`) VALUES (313, 'driving license')
INSERT INTO `Customers_and_Services` (`Customers_and_Services_ID`, `Customer_ID`, `Service_ID`, `Customers_and_Services_Details`) VALUES (123, 12, 313, 'Satisfied')
INSERT INTO `Customer_Interactions` (`Customer_Interaction_ID`, `Channel_ID`, `Customer_ID`, `Service_ID`, `Status_Code`, `Services_and_Channels_Details`) VALUES (13, 16, 98, 828, 'Close', 'bad')
INSERT INTO `Integration_Platform` (`Integration_Platform_ID`, `Customer_Interaction_ID`, `Integration_Platform_Details`) VALUES (299, 225, 'Success')
INSERT INTO `Analytical_Layer` (`Analytical_ID`, `Customers_and_Services_ID`, `Pattern_Recognition`, `Analytical_Layer_Type_Code`) VALUES (11, '123', 'Normal', 'Bottom')