You're getting a cartesian product:
10*2 = 20. Each count is returning 20, so what you get is:select count(r.reg_no) as Total_Registration -- results in 10*2 = 20
, count(r.reg_no) - count(c.cancellation_id) as actual_Attendance -- results in 20-20 => 0
from registration r
, cancellation c;
Try something like this:SQL> select count(*) from emp;
COUNT(*)
----------
14
SQL> select count(*) from dept;
COUNT(*)
----------
8
SQL> select e.cnt cnt_emp
2 , d.cnt cnt_dept
3 , e.cnt-d.cnt test
4 from ( select count(*) cnt
5 from emp
6 ) e
7 , ( select count(*) cnt
8 from dept
9 ) d
10 /
CNT_EMP CNT_DEPT TEST
---------- ---------- ----------
14 8 6
SQL>
HTH,
MHE