<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Procediments_emmagatzemats._Condicionals%3A_IF%2C_CASE</id>
	<title>Procediments emmagatzemats. Condicionals: IF, CASE - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Procediments_emmagatzemats._Condicionals%3A_IF%2C_CASE"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Procediments_emmagatzemats._Condicionals:_IF,_CASE&amp;action=history"/>
	<updated>2026-08-30T00:54:46Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Procediments_emmagatzemats._Condicionals:_IF,_CASE&amp;diff=298794&amp;oldid=prev</id>
		<title>Joan: /* Entrega */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Procediments_emmagatzemats._Condicionals:_IF,_CASE&amp;diff=298794&amp;oldid=prev"/>
		<updated>2022-03-28T11:09:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Entrega&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ca&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versió més antiga&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisió del 11:09, 28 març 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l46&quot; &gt;Línia 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Entrega=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Entrega=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Entrega &lt;/del&gt;dins del termini &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;previst&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Entregaràs al Classroom, &lt;/ins&gt;dins del termini &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;de l'entrega, un document amb l'enunciat, el codi proposat, i el resultat que obtens per la pantalla.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Autor}}, març 2022&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Autor}}, març 2022&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Procediments_emmagatzemats._Condicionals:_IF,_CASE&amp;diff=298793&amp;oldid=prev</id>
		<title>Joan: Es crea la pàgina amb «=Feina per l'alumne= Treballarem amb la base de dades HR (Human Resources)  Realitza els següents exercicis:  '''1.''' Programar el procediment ''CategoriaSalarial(IN...».</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Procediments_emmagatzemats._Condicionals:_IF,_CASE&amp;diff=298793&amp;oldid=prev"/>
		<updated>2022-03-28T11:08:37Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb «=Feina per l&amp;#039;alumne= Treballarem amb la base de dades HR (Human Resources)  Realitza els següents exercicis:  &amp;#039;&amp;#039;&amp;#039;1.&amp;#039;&amp;#039;&amp;#039; Programar el procediment &amp;#039;&amp;#039;CategoriaSalarial(IN...».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Feina per l'alumne=&lt;br /&gt;
Treballarem amb la base de dades HR (Human Resources)&lt;br /&gt;
&lt;br /&gt;
Realitza els següents exercicis:&lt;br /&gt;
&lt;br /&gt;
'''1.''' Programar el procediment ''CategoriaSalarial(IN vlast_name, OUT vcategoria)'', de manera que si un empleat té un salari superior o igual a la mitjana dels salaris dels empleats, la seva categoria és 'SUPERIOR'. Si el salari és inferior, la seva categoria és 'INFERIOR'. Prova-ho amb tres empleats.&lt;br /&gt;
&lt;br /&gt;
'''2.''' Per trobar els anys que un empleat treballa a l'empresa pots utilitzar aquesta select:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select datediff(now(),hire_date)/365 from employees;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I si ho volem convertir a número enter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
select FLOOR(datediff(now(),hire_date)/365) from employees;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Els valors van entre 22 i 34 anys. Podem considerar que un empleat té antiguitat 'NOU' si la seva antiguitat és inferior o igual a 28 anys. En cas contrari, la seva antiguitat és 'ANTIC'.&lt;br /&gt;
&lt;br /&gt;
Programar el procediment ''Antiguitat (IN vlast_name, OUT vantiguitat)'' que doni com a resultat l'antiguitat d'un empleat. Prova-ho amb tres empleats.&lt;br /&gt;
&lt;br /&gt;
'''3.''' Sentència CASE. Considerem les següents franges d'antiguitat, i per cada franja d'antiguitat es pot proposar un increment de salari:&lt;br /&gt;
*20:23 -&amp;gt; increment 10%&lt;br /&gt;
*24:27 -&amp;gt; increment 12%&lt;br /&gt;
*28:31 -&amp;gt; increment 14%&lt;br /&gt;
*32:36 -&amp;gt; increment 16%&lt;br /&gt;
&lt;br /&gt;
Programar el procediment ''IncrementSalari (IN vlast_name)'', que doni la següent cadena:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Empleat: xxx (nom) xxx (cognom)&lt;br /&gt;
Antiguitat: xxx&lt;br /&gt;
Salari: xxx &lt;br /&gt;
Proposta increment: xxx %&lt;br /&gt;
Proposta salari: xxx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Per al retorn de carro (línia nova) pots utilitzar el caràcter '\n'.&lt;br /&gt;
&lt;br /&gt;
Prova-ho amb tres empleats.&lt;br /&gt;
&lt;br /&gt;
4. Genera el fitxer ''informe.txt'' que inclogui la informació de proposta d'increment de salaris dels empleats 'Popp','Partners', 'Taylor', 'Livingston'&lt;br /&gt;
&lt;br /&gt;
Des de la línia de comandes, pots provar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql -u alumne -pkeiL2lai -D HR -s -e &amp;quot;CALL IncrementSalari('Popp'); CALL IncrementSalari('Partners'); CALL IncrementSalari('Taylor'); CALL IncrementSalari('Livingston');&amp;quot; &amp;gt; informe.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Amb el MySQL Workbench serà una mica diferent, ho pots provar també.&lt;br /&gt;
&lt;br /&gt;
=Entrega=&lt;br /&gt;
Entrega dins del termini previst&lt;br /&gt;
{{Autor}}, març 2022&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>