from django.shortcuts import render
from django.db import connections
from django.shortcuts import redirect
from django.http import Http404
from django.db.utils import IntegrityError



with connections['default'].cursor() as cursor:
    cursor.execute(f'''
        SELECT ship_type,
        CAST(AVG(technical_efficiency_number)AS decimal(10,2)) AS ave
        FROM co2emission_reduced
        GROUP BY ship_type
        ''')
    result = cursor.fetchall()
print(result)
9a2f5117c2463946d00b4d43c62f26a0d7c8fb73
<mask token>

<mask token>
with connections['default'].cursor() as cursor:
    cursor.execute(
        f"""
        SELECT ship_type,
        CAST(AVG(technical_efficiency_number)AS decimal(10,2)) AS ave
        FROM co2emission_reduced
        GROUP BY ship_type
        """
        )
    result = cursor.fetchall()
print(result)

from django.shortcuts import render
from django.db import connections
from django.shortcuts import redirect
from django.http import Http404
from django.db.utils import IntegrityError
with connections['default'].cursor() as cursor:
    cursor.execute(
        f"""
        SELECT ship_type,
        CAST(AVG(technical_efficiency_number)AS decimal(10,2)) AS ave
        FROM co2emission_reduced
        GROUP BY ship_type
        """
        )
    result = cursor.fetchall()
print(result)

from django.shortcuts import render
from django.db import connections
from django.shortcuts import redirect
from django.http import Http404
from django.db.utils import IntegrityError



with connections['default'].cursor() as cursor:
    cursor.execute(f'''
        SELECT ship_type,
        CAST(AVG(technical_efficiency_number)AS decimal(10,2)) AS ave
        FROM co2emission_reduced
        GROUP BY ship_type
        ''')
    result = cursor.fetchall()
print(result)