MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 1st, 2007, 04:00 AM
HalitYesil HalitYesil is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 HalitYesil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 54 sec
Reputation Power: 0
To calculate the students' end of year mark in school data base with one query

to calculate the students' end of year mark in school data base with one query

Code:
SELECT
     student.snumber AS 'Student Number',
     student.name AS 'First Name',
     student.lastname AS 'Last Name',
     SUM( smarks.smark ) AS 'Total Mark',
     COUNT( * ) AS 'Total Lesson',
     (SUM( smarks.smark ) / COUNT( * )) AS 'Marks End Of Year'
FROM
     students AS student
  LEFT JOIN
     smarks
   ON
     smarks.student_id = student.id
  LEFT JOIN
     lessons AS lesson
   ON
     lesson.lesson_id = smarks.lesson_id
GROUP BY
   student.snumber
ORDER BY
   'Marks End Of Year' DESC

mysqlturkiye.org to check Turkish examples,take a look at this adress

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > To calculate the students' end of year mark in school data base with one query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT