output
stringclasses 10
values | input
stringclasses 4
values | instruction
stringclasses 10
values |
---|---|---|
SELECT
(COALESCE(ce.customer_due,0)) due_amount
FROM customer c
INNER JOIN eb_customer_extension ce ON ce.customer_id=c.customer_id
where c.account_number='$account_number' AND c.dealer_id = 1; | $account_number | To find the due amount for a specific customer with account_number |
SELECT p.paid_on, p.payment_mode, p.paid_amount, p.receipt_no
FROM acc_payment_details p
INNER JOIN customer c ON p.customer_id = c.customer_id
WHERE p.dealer_id = 1 AND c.account_number = '$account_number'
ORDER BY p.paid_on DESC; | $account_number | To find the payment details for a specific customer with account_number |
SELECT COALESCE( c.first_name, '' ) first_name, COALESCE( c.last_name, '' ) last_name,cs.service_start_date,cs.service_end_date,
CASE WHEN cs.status=1 THEN 'Active' ELSE 'Deactive' END as Status,p.pname,s.serial_number,bs.display_name
FROM customer c
INNER JOIN customer_device cd ON cd.customer_id = c.customer_id AND cd.device_closed_on IS NULL
INNER JOIN eb_stock s ON s.serial_number = cd.box_number
INNER JOIN backend_setups bs ON bs.backend_setup_id = s.backend_setup_id
INNER JOIN eb_customer_service cs ON cs.stock_id_v2 = s.stock_id
INNER JOIN eb_products p ON cs.product_id_v2 = p.product_id AND p.plugin_id = 4
LEFT JOIN eb_customer_service cs1 ON cs1.customer_service_id = cs.parent_service_id and cs1.plugin_id = 4
INNER JOIN employee e ON e.employee_id = cs.created_by
WHERE c.account_number = '$account_number'
and (case when cs.parent_service_id=0 then cs.status=1 when cs.parent_service_id>0 then cs1.status = 1
else (cs.status=1 OR cs.status = 0) end)
AND c.dealer_id =1
ORDER BY s.serial_number,cs1.customer_service_id,cs.status DESC | $account_number | To find the Customer services details for a specific customer with account_number |
SELECT deposit_amount FROM employee WHERE dist_subdist_lcocode='$dist_subdist_lcocode' AND dealer_id=1 | $dist_subdist_lcocode | To find the employee deposit amount for a specific employee with dist_subdist_lcocode |
SELECT count(distinct s.customer_id_v2) total_active_customers
FROM eb_stock s
INNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id and bs.setup_for=5
INNER JOIN customer_group cg ON cg.customer_id=s.customer_id_v2
INNER JOIN employee e ON e.employee_id=s.reseller_v2
WHERE s.status=1 AND s.dealer_id=1 AND s.is_trash=0 AND e.dist_subdist_lcocode='$dist_subdist_lcocode' AND s.customer_id_v2>0
| $dist_subdist_lcocode | To find the total customer's under specific employee (LCO) with dist_subdist_lcocode |
SELECT count(distinct s.customer_id_v2) total_active_customers
FROM eb_stock s
INNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id and bs.setup_for=5
INNER JOIN customer_group cg ON cg.customer_id=s.customer_id_v2
WHERE s.status=1 AND s.dealer_id=1 AND s.is_trash=0 AND s.customer_id_v2>0 | To find the total active customer's under Mso |
|
SELECT count(distinct s.customer_id_v2) total_deactive_customers
FROM eb_stock s
INNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id
WHERE s.status=2 AND s.dealer_id=1 AND s.is_trash=0 AND s.customer_id_v2>0
AND s.customer_id_v2 not in(
SELECT s.customer_id_v2 FROM eb_stock s
INNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id
WHERE s.status=1 AND s.dealer_id=1 AND s.is_trash=0 AND s.customer_id_v2>0) | To find the total deactive customer's under MSO |
|
select COUNT(DISTINCT s.stock_id) count_active
FROM eb_stock s
INNER JOIN eb_stock_location esl ON esl.location_id=s.stock_location
INNER JOIN backend_setups bs ON s.backend_setup_id=bs.backend_setup_id AND bs.setup_for=5
WHERE s.status=1 and s.is_trash=0 AND s.dealer_id=1 | To find the total active stb count under MSO |
|
select COUNT(DISTINCT s.stock_id) count_deactive
FROM eb_stock s
INNER JOIN eb_stock_location esl ON esl.location_id=s.stock_location
INNER JOIN backend_setups bs ON s.backend_setup_id=bs.backend_setup_id AND bs.setup_for=5
WHERE s.status=2 and s.is_trash=0 AND s.dealer_id=1 | To find the total deactive stb count under MSO |
|
select sum(x.total_current_month_bill) as current_month_total_amount
from(select coalesce(sum(ab.total_amount ) ,'0.00') total_current_month_bill
from acc_billing ab WHERE ab.dealer_id = 1 AND ab.bill_month = '$bill_month'
UNION ALL
select SUM( adj.total_bill_adj * -1 ) as total_current_month_bill
from customer_billing_adjustment adj
INNER JOIN acc_billing b on b.billing_id = adj.billing_id and b.bill_month = '$bill_month'
WHERE adj.dealer_id = 1) x | $bill_month | To get the cusrrent month billling under MSO with $bill_month |
No dataset card yet
New: Create and edit this dataset card directly on the website!
Contribute a Dataset Card- Downloads last month
- 19