Check out example codes for "get sum sqlite android". It will help you in understanding the concepts better.

Code Example 1

Cursor cursor = db.rawQuery("SELECT SUM(" + DbHelper.CART_TOTAL + ") as Total FROM " + DbHelper.CART_TABLE, null);

 if (cur.moveToFirst()) {

 int total = cursor.getInt(cursor.getColumnIndex("Total"));// get final total

Learn ReactJs, React Native from akashmittal.com