You are on page 1of 5

---Digital Payment SOS Queries---

Q. To get IMPS, BHIM, ASEPS, USSD and BHIM Aadhaar Days Count Status
Select TxnMode as'TxnType',count(distinct TxnDate)as'DaysCount',
sum(TxnVolume)as'TxnVolume',replace(Convert(varchar(20),max(TxnDate),106),' ','-')as'LastReportedOn'
fromDigiPayPro.dbo.DigiPayTransDetail where
TxnMode in ('AEPS','BHIM','BHIM Aadhaar','IMPS','USSD')
Group by TxnMode
order by 1

Q. To get RuPay Debit Card Days Count Status


select'RuPay Debit Card'as'TxnType',count(distinct TxnDate)as'DaysCount',
sum(TxnVolume)as'TxnVolume',replace(Convert(varchar(20),max(TxnDate),106),' ','-')as'LastReportedOn'
fromDigiPayPro.dbo.DebitCardPOSTransDetailDateWise
order by 1

Q. To get TxnVolume and TxnValue Status of IMPS, BHIM, USSD, NACH and BHIM Aadhaar Status
selectTxnModeas'TxnType', sum(TxnVolume)as'TxnVolume',sum(TxnValue)as'TxnValue'
fromDigiPayPro.dbo.DigiPayTransDetail
where TxnMode in ('BHIM Aadhaar','BHIM','IMPS','USSD','NACH')
group by TxnMode
order by 1

Q. To get TxnVolume and TxnValue AEPS (OFFUS Financial)/ BHIM Aadhaar Status given by NPCI
select'AEPS (OFFUS Financial)/ BHIM Aadhaar'as'TxnType',
sum(TxnVolume)as'TxnVolume',sum(TxnValue)as'TxnValue'
fromDigiPayPro.dbo.AEPSTransDetailDateWise
whereTxnType in('01','04','25','FC')
order by 1

Q. To get TxnVolume and TxnValue AEPS (OFFUS Non Financial) Status given by NPCI
select'AEPS (OFFUS Non Financial)'as'TxnType',
sum(TxnVolume)as'TxnVolume',sum(TxnValue)as'TxnValue'
fromDigiPayPro.dbo.AEPSTransDetailDateWise
whereTxnType in('05')
order by 1

Q. To get TxnVolume and TxnValueRuPay (POS) Status given by NPCI


select'RuPay (POS)'as'TxnType', sum(TxnVolume)as'TxnVolume',sum(TxnValue)as'TxnValue'
fromDigiPayPro.dbo.DebitCardPOSTransDetailDateWise where TxnType='POS'
order by 1

Q. To get TxnVolume and TxnValueRuPay (eCom) Status given by NPCI


select'RuPay (eCom)'as'TxnType',sum(TxnVolume)as'TxnVolume',sum(TxnValue)as'TxnValue'
fromDigiPayPro.dbo.DebitCardPOSTransDetailDateWise where TxnType='ECOM'
order by 1

Q. To get TxnVolume and TxnValue BBPS Status given by NPCI


select'BBPS'as'TxnType',sum(TxnVolume)as'TxnVolume',sum(TxnValue)as'TxnValue'
fromDigiPayPro.dbo.BBPSTransDetail where
TxnStatus ='Successful'
order by 1

Q. To get TxnVolume and TxnValue NETC Status given by NPCI


select'NETC'as'TxnType',sum(TxnVolume)as'TxnVolume',sum(TxnValue)as'TxnValue'
fromDigiPayPro.dbo.ETCTransDetailDateWiseConsolidated
order by 1

Q. DatewiseStatewise BHIM TxnVolume


Note: Type: 1 means 'BHIM' (i.e. BHIM + UPI without BHIM)
selectutd.TxnDate,sm.StateName as 'StateCode', sum(TxnVolume) as 'TxnVolume',sum(TxnValue) as
'TxnValue',
'1' as 'TxnType' from DigiPayPro.dbo.StateWiseTxnDetailutd
inner join StateMastersm on sm.CensusCode=utd.StateCode
where TxnType='1' and TxnDate>='1 apr 2017'
group by TxnDate,sm.StateName
order by 1,2

Q. DatewiseStatewise USSD TxnVolume


Note: Type: 2 means 'USSD'
selectutd.TxnDate,sm.StateName as 'StateCode', sum(TxnVolume) as 'TxnVolume',sum(TxnValue) as
'TxnValue',
'2' as 'TxnType' from DigiPayPro.dbo.StateWiseTxnDetailutd
inner join StateMastersm on sm.CensusCode=utd.StateCode
where TxnType='2' and TxnDate>='1 apr 2017'
group by TxnDate,sm.StateName
order by 1,2

Q. DatewiseStatewiseRupay Debit Card


Note : Type: 3 means 'Rupay Debit Card'
selectutd.TxnDate,sm.StateName as 'StateCode', sum(TxnVolume) as 'TxnVolume',sum(TxnValue) as
'TxnValue',
'3' as 'TxnType' from DigiPayPro.dbo.StateWiseTxnDetailutd
inner join StateMastersm on sm.CensusCode=utd.StateCode
where TxnType='3' and TxnDate>='1 apr 2017'
group by TxnDate,sm.StateName
order by 1,2

Q. DatewiseStatewise BHIM TxnVolume


Note : Type: 1 means 'BHIM' (i.e. BHIM + UPI without BHIM)
selectutd.TxnDate,sm.StateName as 'StateCode', count(*) as 'TxnVolume',sum(TxnValue) as 'TxnValue',
'1' as 'TxnType' from DigiPay.dbo.UPITransDetailutd
inner join BanksIFSCMasterbfm on bfm.IFSC=utd.PayerBankIFSC
inner join StateMastersm on sm.StateName=bfm.STATE
whereutd.TxnType in ('UPI without BHIM','BHIM') and TxnStatus='1' and TxnDate>='1 apr 2017'
andsm.StateName in (select distinct State from BanksIFSCMaster)
group by TxnDate,sm.StateName
order by 1,2
--- DigiPay Queries---

Q. DatewiseStatewise USSD TxnVolume


Note : Type: 2 means 'USSD'.
selectutd.TxnDate,sm.StateName as 'StateCode', count(*) as 'TxnVolume',sum(TxnValue) as 'TxnValue',
'2' as 'TxnType' from DigiPay.dbo.UPITransDetailutd
inner join BanksIFSCMasterbfm on bfm.IFSC=utd.PayerBankIFSC
inner join StateMastersm on sm.StateName=bfm.STATE
whereutd.TxnType in ('USSD') and TxnStatus='1' and TxnDate>='1 apr 2017'
andsm.StateName in (select distinct State from BanksIFSCMaster)
group by TxnDate,sm.StateName
order by 1,2

Q.DatewiseStatewiseRupay Debit Card


Note : Type: 3 means 'Rupay Debit Card'
selectB.TxnDate, A.StateName as 'StateCode', sum(B.TxnVolume) as 'TxnVolume',
sum(TxnValue) as 'TxnValue',
'3' as 'TxnType',GETDATE() as 'CreatedAt' from StateMaster A
inner join
(
Select TxnDate, Y.CensusCode,sum(TxnVolume) as 'TxnVolume',sum(TxnValue) as 'TxnValue' from
(
selectTxnDate, right(PinCode,6) as 'PinCode', count(*) as 'TxnVolume',sum(TxnValue) as
'TxnValue' from DigiPay.dbo.DebitCardPOSTransDetail where ReasonCode='00'
andTxnDate>='1 apr 2017'
group by TxnDate,right(PinCode,6)
)X
inner join
(
Select distinct PinCode, sm.CensusCode from PinCodeMaster pm
inner join DigiPay.dbo.StateMastersm on sm.StateName=pm.StateName
)Y
onX.PinCode=y.PinCode
group by X.TxnDate,Y.CensusCode
)B
onA.CensusCode=B.CensusCode
group by B.TxnDate, A.StateName
order by 1,2
--- SOS Queries---
Q. To check when TxnVolume is greater than TxnValue
For Banks : To check if where TxnVolume is very very high in comparision to TxnValue (due to column
swap)
selectTxnDate, BankCode, TxnType, sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as 'TxnValue' from
BankTransDetailDateWise
whereTxnDate>='1 apr 2017' and TxnDate<='14 may 2018'
andTxnType in ('INB','MOB','OTH')
group by TxnDate, BankCode, TxnType
having sum(TxnVolume)>sum(TxnValue)
order by 1 desc

For Banks : To check if where TxnVolume is very very high in comparision to TxnValue (due to column
swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='Bank'
group by TxnDate, DataSource, TxnMode, BankCode
having sum(TxnVolume)>sum(TxnValue)
order by 1 desc

For NPCI : To check if where TxnVolume is very very high in comparision to TxnValue (due to column swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='NPCI'
group by TxnDate, DataSource, TxnMode, BankCode
having sum(TxnVolume)>sum(TxnValue)
order by 1 desc

For RBI : To check if where TxnVolume is very very high in comparision to TxnValue (due to column swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='RBI'
group by TxnDate, DataSource, TxnMode, BankCode
having sum(TxnVolume)>sum(TxnValue)
order by 1 desc

For Close Loops : To check if where TxnVolume is very very high in comparision to TxnValue (due
to column swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='Close Loops'
group by TxnDate, DataSource, TxnMode, BankCode
having sum(TxnVolume)>sum(TxnValue)
order by 1 desc
Q. To check when TxnVolume and TxnValue status of various data sources
For Banks : To check if where TxnVolume is very very high in comparision to TxnValue (due to
column swap)
selectTxnDate, BankCode, TxnType, sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as 'TxnValue' from
BankTransDetailDateWise
whereTxnDate>='1 apr 2017' and TxnDate<='14 may 2018'
andTxnType in ('INB','MOB','OTH')
group by TxnDate, BankCode, TxnType
order by 1 desc

For Banks : To check if where TxnVolume is very very high in comparision to TxnValue (due to
column swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='Bank'
group by TxnDate, DataSource, TxnMode, BankCode
order by 1 desc

For NPCI : To check if where TxnVolume is very very high in comparision to TxnValue (due to
column swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='NPCI'
group by TxnDate, DataSource, TxnMode, BankCode
order by 1 desc

For RBI : To check if where TxnVolume is very very high in comparision to TxnValue (due to
column swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='RBI'
group by TxnDate, DataSource, TxnMode, BankCode
order by 1 desc

For Close Loops : To check if where TxnVolume is very very high in comparision to TxnValue (due
to column swap)
selectTxnDate, DataSource, TxnMode, BankCode,sum(TxnVolume) as 'TxnVolume', sum(TxnValue) as
'TxnValue' from DigiPayTransDetail
whereDataSource='Close Loops'
group by TxnDate, DataSource, TxnMode, BankCode
order by 1 desc

Q. To check main counter


-- Counter 1 (For Fin Year 2017-2018
select sum(convert(decimal(18,2),txnVolume))/10000000.00 from DigiPayTransDetail where TxnDate>='1 apr
2017' and TxnDate<='31 mar 2018'

-- Counter 2 (For Fin Year 2018-2019


select sum(txnVolume)/10000000.00 from DigiPayTransDetail where TxnDate>='1 apr 2018'

You might also like