Re: : Promedios de notas

From: Date: Tue, 19 Nov 2002 23:40:55 +0000
Subject: Re: : Promedios de notas
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-29485@lists.php.net to get a copy of this message
<html> <body> <b>Aqui envio las tablas de despligue de las notas para que se entienda mejor.. </b> <table WIDTH='100' border=0> <tr><td> </td></tr> </table><br><br> <table WIDTH='200' border=1> <tr><td><b CLASS="Notas">Notas:</b></td></tr> <tr><td> <!-- Inicio Fila 1--> <table border=0 width=100%> <tr> <th CLASS="th_tabla_periodo"> <center><b> Primer Semestre del Año 2002 </b></center> </th> </tr> <tr> <td> <br> <table border=1 width=100%> <tr><td><b CLASS="nombre_materia"> Matemáticas: </b> </td> </tr> <tr> <th CLASS="th_tipo_nota"><b>Tipo evaluacion</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 1</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 2</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 3</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 4</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 5</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 6</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 7</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 8</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 9</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 10</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>Prom.</b></th> </tr> <tr> <td CLASS="td_tipo_nota">Pruebas.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>6.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>3.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4.3</SPAN></td> </tr> <tr> <td CLASS="td_tipo_nota">Trabajos.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>5.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>6.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>5.5</SPAN></td> </tr> </table> <table border=0 align=right WIDTH='160'> <tr><td align=right CLASS="td_prom_asignatura" WIDTH='73%'>Prom. Asignatura</td><td WIDTH='27%' CLASS="td_nota_prom_asignatura"><!-- BEGIN nota_promedio_asignatura_tpl -->0<!-- END nota_promedio_asignatura_tpl --></td></tr> </table><br><br> <table border=1 width=100%> <tr><td><b CLASS="nombre_materia"> Castellano: </b> </td> </tr> <tr> <th CLASS="th_tipo_nota"><b>Tipo evaluacion</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 1</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 2</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 3</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 4</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 5</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 6</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 7</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 8</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 9</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 10</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>Prom.</b></th> </tr> <tr> <td CLASS="td_tipo_nota">Control Oral.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>5.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>3.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4</SPAN></td> </tr> <tr> <td CLASS="td_tipo_nota">Pruebas.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>7.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>7</SPAN></td> </tr> <tr> <td CLASS="td_tipo_nota">Trabajos.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>2.8</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>2.8</SPAN></td> </tr> </table> <table border=0 align=right WIDTH='160'> <tr><td align=right CLASS="td_prom_asignatura" WIDTH='73%'>Prom. Asignatura</td><td WIDTH='27%' CLASS="td_nota_prom_asignatura"><!-- BEGIN nota_promedio_asignatura_tpl -->0<!-- END nota_promedio_asignatura_tpl --></td></tr> </table><br> </td> </tr> <tr> <td> <table border=0 align=right WIDTH='160'> <tr><td align=right CLASS="td_prom_periodo" WIDTH='73%'>Prom. <!-- BEGIN promedio_periodo_tpl -->Primer Semestre<!-- END promedio_periodo_tpl --></td><td WIDTH='27%' CLASS="td_nota_prom_periodo"><!-- BEGIN nota_promedio_periodo_tpl -->0<!-- END nota_promedio_periodo_tpl --></td></tr> </table> </td> </tr> </table> <br><br> <table border=0 width=100%> <tr> <th CLASS="th_tabla_periodo"> <center><b> Segundo Semestre del Año 2002 </b></center> </th> </tr> <tr> <td> <br> <table border=1 width=100%> <tr><td><b CLASS="nombre_materia"> Matemáticas: </b> </td> </tr> <tr> <th CLASS="th_tipo_nota"><b>Tipo evaluacion</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 1</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 2</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 3</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 4</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 5</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 6</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 7</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 8</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 9</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 10</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>Prom.</b></th> </tr> <tr> <td CLASS="td_tipo_nota">Pruebas.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>5.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>6.5</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>5.1</SPAN></td> </tr> <tr> <td CLASS="td_tipo_nota">Trabajos.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>6.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>6.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>6.0</SPAN></td> </tr> </table> <table border=0 align=right WIDTH='160'> <tr><td align=right CLASS="td_prom_asignatura" WIDTH='73%'>Prom. Asignatura</td><td WIDTH='27%' CLASS="td_nota_prom_asignatura"><!-- BEGIN nota_promedio_asignatura_tpl -->0<!-- END nota_promedio_asignatura_tpl --></td></tr> </table><br><br> <table border=1 width=100%> <tr><td><b CLASS="nombre_materia"> Castellano: </b> </td> </tr> <tr> <th CLASS="th_tipo_nota"><b>Tipo Evaluacion</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 1</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 2</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 3</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 4</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 5</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 6</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 7</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 8</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 9</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>N 10</b></th> <th NOWRAP WIDTH='5%' CLASS="th_tabla_notas"><b>Prom.</b></th> </tr> <tr> <td CLASS="td_tipo_nota">Control Oral.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>2.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4.5</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>3.1</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>4.7</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>3.5</SPAN></td> </tr> <tr> <td CLASS="td_tipo_nota">Pruebas.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>7.0</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_mayor_4'>7</SPAN></td> </tr> <tr> <td CLASS="td_tipo_nota">Trabajos.</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>2.8</SPAN></td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas">&nbsp;</td> <td NOWRAP WIDTH='5%' CLASS="td_tabla_notas"><SPAN CLASS='nota_menor_4'>2.8</SPAN></td> </tr> </table> <table border=0 align=right WIDTH='160'> <tr><td align=right CLASS="td_prom_asignatura" WIDTH='73%'>Prom. Asignatura</td><td WIDTH='27%' CLASS="td_nota_prom_asignatura"><!-- BEGIN nota_promedio_asignatura_tpl -->0<!-- END nota_promedio_asignatura_tpl --></td></tr> </table><br> </td> </tr> <tr> <td> <table border=0 align=right WIDTH='160'> <tr><td align=right CLASS="td_prom_periodo" WIDTH='73%'>Prom. <!-- BEGIN promedio_periodo_tpl -->Segundo Semestre<!-- END promedio_periodo_tpl --></td><td WIDTH='27%' CLASS="td_nota_prom_periodo"><!-- BEGIN nota_promedio_periodo_tpl -->0<!-- END nota_promedio_periodo_tpl --></td></tr> </table> </td> </tr> </table> <br><br> </td></tr><!-- Fin Fila 1--> <tr><td> <!-- Inicio Fila 2--> <table border=0 align=right WIDTH='162'> <tr><td align=right CLASS="td_prom_Anual" WIDTH='73%'>Prom. Anual</td><td WIDTH='27%' CLASS="td_nota_prom_anual"><!-- BEGIN nota_promedio_anual_tpl -->0<!-- END nota_promedio_anual_tpl --></td></tr> </table> </td></tr><!-- Fin Fila 2--> </table> <br> la tabla de nombre "notas" de donde obtengo los datos tiene los siguientes campos: <br> alumno |año | periodo |asignatura | tipo_evaluacion |numero_evaluacion | nota <br><br><br> los promedios caculados que aparecen en las tablas los llevé a cavo con la <br> siguiente consulta sql: <br> Select Avg(nota) from notas where alumno='$alumno' and año='$año' and <br> periodo='$periodo' and asignatura='$asignatura' <br> and tipo_evalucion='$tipo_evaluacion' <br> <br> ahora sólo me faltan calcular los promedios del primer y segundo semestre <br> y el promedio en el año... <br><br> ahora...¿como podria calcular el promedio de la asignatura (ver tabla), <br> del periodo como en este caso semestres y el promedio anual con solo utilizar <br> consultas sql???? <br> espero que ahora si me hallan entendido <br> muchas gracias <br> </body> </html> --- Serguei Vicario Manjón <svicario@comunet.es> escribió: > > >Select Avg(nota) from notas where año='2002' and > >periodo='primer semestre' and > asignatura='castellano' > >and tipo_evalucion='trabajos' > > > > > >ahora mi pregunta es: > > > >¿¿¿¿como podria hacer otra consulta para obtener > los > >promedios de: > > > >una asignatura especifica. > >de un periodo especifico. > >y de un año especifico > > > >solo con consultas sql???????????? > > Hola, > perdona pero no te entiendo bien, no eso lo que hace > la consulta que envias. > > Con la clausula where restinges diciendo año, > periodo, asignatura y > tipo_evaluacion. > Si lo que quieres es que sea menos restrictiva quita > clausulas where y asi > la consulta sera mas general. > > Por favor, si no es lo que estas buscando podrias > volver a explicarlo > porque no entiendo muy bien tu pregunta. > > Un saludo > Serguei > > > --------------------------------------------------------------------- > Archivo On-line: http://www.phpes.com/ > via news: news://news.phpes.com/ > Manual PHP en español: http://www.php.net/manual/es/ > Para dar de baja la suscripción, mande un mensaje a: > lista-unsubscribe@phpes.com > _________________________________________________________ Do You Yahoo!? Información de Estados Unidos y América Latina, en Yahoo! Noticias. Visítanos en http://noticias.espanol.yahoo.com

« previous php.general.es (#29485) next »