Skip to content

MartinRiese/codespaces-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Playground

Setup

Create project

django-admin startproject playground .

Create app

python manage.py startapp gpa

Initialize database

python manage.py migrate

Create Admin user

python manage.py createsuperuser

Run server

python manage.py runserver

gpa query

SELECT iq.student_id, CAST(SUM(iq.product) AS decimal) AS product, CAST(SUM(iq.credit) AS decimal) AS credit, CAST(SUM(iq.product) AS decimal) / CAST(SUM(iq.credit) AS decimal) AS gpa
FROM (
SELECT g.student_id AS student_id, g.id, g.course_id , CAST(c.credit AS decimal) AS credit, c.credit * g.grade AS product 
FROM gpa_grade AS g LEFT JOIN gpa_course AS c ON g.course_id = c.id
) iq
GROUP BY iq.student_id

SELECT * FROM gpa_grade gg LEFT JOIN gpa_course AS c ON gg.course_id = c.id ;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published