-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplaint_responder.sql
More file actions
36 lines (28 loc) · 1.05 KB
/
complaint_responder.sql
File metadata and controls
36 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
create database ai_complaint_responder;
use ai_complaint_responder;
create table complaints(
Id INT AUTO_INCREMENT PRIMARY KEY,
Customer_name TEXT NOT NULL,
Customer_email TEXT NOT NULL,
Complaint_text TEXT NOT NULL,
Predicted_category VARCHAR(100),
Auto_response TEXT,
Timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE complaints
ADD COLUMN Complaint_status VARCHAR(50) DEFAULT 'Pending',
ADD COLUMN Followup TEXT,
ADD COLUMN Admin_note TEXT;
desc complaints;
select * from complaints;
select DISTINCT(Predicted_category) from complaints;
select* from customers;
SELECT Complaint_status FROM complaints
WHERE C_id = 1003
ORDER BY Timestamp DESC
LIMIT 1;
update complaints set Predicted_category = "Customer Support" where Predicted_category = "Customer Service";
-- Technical Issue', 'Payment Issue', 'Account Issue',
-- 'Delivery Delay', 'Service Issue', 'Product Damage',
-- 'Login Trouble', 'App Bug', 'Wrong Item', 'Customer Support'
select * from complaints where Predicted_category="Customer support";