<?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=Base_de_dades_de_treball%3A_HR._Consultes_simples</id>
	<title>Base de dades de treball: HR. Consultes simples - 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=Base_de_dades_de_treball%3A_HR._Consultes_simples"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Base_de_dades_de_treball:_HR._Consultes_simples&amp;action=history"/>
	<updated>2026-08-30T04:21:35Z</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=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298029&amp;oldid=prev</id>
		<title>Joan: /* T4: continuem amb la teoria bàsica de SQL (secció 4) */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298029&amp;oldid=prev"/>
		<updated>2021-11-23T08:33:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;T4: continuem amb la teoria bàsica de SQL (secció 4)&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 08:33, 23 nov 2021&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-l548&quot; &gt;Línia 548:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 548:&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;ORDER BY new_salary&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;ORDER BY new_salary&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;/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;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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# notació tablename.columnname&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;SELECT  employees.first_name, employees.last_name&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;FROM employees;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# notació database.tablename.columnname&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;SELECT  HR.employees.first_name, HR.employees.last_name&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;FROM employees;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;SELECT e.first_name, e.last_name&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;FROM employees AS e;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# i la utilització de àlies ens serà molt útil (imprescindible) quan fem combinació de taules&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&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;&amp;lt;/pre&amp;gt;&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;&amp;lt;/pre&amp;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}}, novembre 2021&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}}, novembre 2021&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=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298028&amp;oldid=prev</id>
		<title>Joan: /* T4: continuem amb la teoria bàsica de SQL */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298028&amp;oldid=prev"/>
		<updated>2021-11-23T08:30:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;T4: continuem amb la teoria bàsica de SQL&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 08:30, 23 nov 2021&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-l291&quot; &gt;Línia 291:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 291:&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;Fem una explicació a classe del funcionament de l'aplicació web. Com que és la primera vegada que aquesta aplicació s'utilitza a classe, els alumnes reportaran els problmemes d'usabilitat que segur que hi haurà, i s'intentarà incorporar tots les millores proposades.&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;Fem una explicació a classe del funcionament de l'aplicació web. Com que és la primera vegada que aquesta aplicació s'utilitza a classe, els alumnes reportaran els problmemes d'usabilitat que segur que hi haurà, i s'intentarà incorporar tots les millores proposades.&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;/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;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;=T4: continuem amb la teoria bàsica de SQL=&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;=T4: continuem amb la teoria bàsica de SQL &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(secció 4)&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;&amp;lt;pre&amp;gt;&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;&amp;lt;pre&amp;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;SELECT  &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;SELECT  &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=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298027&amp;oldid=prev</id>
		<title>Joan: /* T3: aplicació BDQuest */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298027&amp;oldid=prev"/>
		<updated>2021-11-23T08:30:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;T3: aplicació BDQuest&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;http://wiki.joanillo.org/index.php?title=Base_de_dades_de_treball:_HR._Consultes_simples&amp;amp;diff=298027&amp;amp;oldid=298026&quot;&gt;Mostra els canvis&lt;/a&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298026&amp;oldid=prev</id>
		<title>Joan: Es crea la pàgina amb «=T1. sample database=  thunbnail *https://www.sqltutorial.org/sql-sample-database/  =T2: secció 1, 2, 3 i 4 del tutorial= *...».</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Base_de_dades_de_treball:_HR._Consultes_simples&amp;diff=298026&amp;oldid=prev"/>
		<updated>2021-11-23T07:47:00Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb «=T1. sample database= &lt;a href=&quot;/index.php/Fitxer:SQL-Sample-Database-Schema.png&quot; title=&quot;Fitxer:SQL-Sample-Database-Schema.png&quot;&gt; thunbnail&lt;/a&gt; *https://www.sqltutorial.org/sql-sample-database/  =T2: secció 1, 2, 3 i 4 del tutorial= *...».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=T1. sample database=&lt;br /&gt;
[[Fitxer:SQL-Sample-Database-Schema.png | thunbnail]]&lt;br /&gt;
*https://www.sqltutorial.org/sql-sample-database/&lt;br /&gt;
&lt;br /&gt;
=T2: secció 1, 2, 3 i 4 del tutorial=&lt;br /&gt;
*https://www.sqltutorial.org/&lt;br /&gt;
Per executr online els exemples:&lt;br /&gt;
*https://www.sqltutorial.org/seeit/&lt;br /&gt;
&lt;br /&gt;
Les consultes executades a classe (que són les que hi ha al tutorial que estem seguint), corresponents a aquestes seccions del tutorial:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
$ cd /home/joan/DAM_M02_2122/UF2/HR&lt;br /&gt;
$ mysql -h localhost -u alumne -pkeiL2lai --verbose HR &amp;lt; ./apunts_sqltutorial.sql &amp;gt; sortida.txt&lt;br /&gt;
&lt;br /&gt;
Section 1: Introduction to SQL&lt;br /&gt;
================================&lt;br /&gt;
https://www.sqltutorial.org/what-is-sql/&lt;br /&gt;
&lt;br /&gt;
What is SQL – give you a brief overview of the SQL language and its popular dialects.&lt;br /&gt;
SQL Syntax – provide you with the syntax of the SQL language.&lt;br /&gt;
SQL Sample Database – introduce you to an HR sample database.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Section 2: Querying Data&lt;br /&gt;
=================================&lt;br /&gt;
https://www.sqltutorial.org/sql-select/&lt;br /&gt;
&lt;br /&gt;
SELECT Statement – show you how to query data from a single table by using the simplest form of the SELECT statement.&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
SELECT &lt;br /&gt;
    select_list&lt;br /&gt;
FROM&lt;br /&gt;
    table_name;&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM table_name;&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Besides the SELECT and FROM clauses, the SELECT statement can contain many other clauses such as&lt;br /&gt;
&lt;br /&gt;
 WHERE – for filtering data based on a specified condition.&lt;br /&gt;
 ORDER BY – for sorting the result set.&lt;br /&gt;
 LIMIT – for limiting rows returned.&lt;br /&gt;
 JOIN – for querying data from multiple related tables.&lt;br /&gt;
 GROUP BY – for grouping data based on one or more columns.&lt;br /&gt;
 HAVING – for filtering groups.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM employees;&lt;br /&gt;
&lt;br /&gt;
SELECT &lt;br /&gt;
    employee_id, &lt;br /&gt;
    first_name, &lt;br /&gt;
    last_name, &lt;br /&gt;
    hire_date&lt;br /&gt;
FROM&lt;br /&gt;
    employees;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, hire_date FROM employees;&lt;br /&gt;
&lt;br /&gt;
# diferències entre MySQL, SQL Server, SQLite:&lt;br /&gt;
SELECT &lt;br /&gt;
    employee_id,&lt;br /&gt;
    first_name,&lt;br /&gt;
    last_name,&lt;br /&gt;
    FLOOR(DATEDIFF('2021-01-01', hire_date) / 365) YoS&lt;br /&gt;
FROM&lt;br /&gt;
    employees;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Section 3: Sorting Data&lt;br /&gt;
================================&lt;br /&gt;
https://www.sqltutorial.org/sql-order-by/&lt;br /&gt;
&lt;br /&gt;
ORDER BY Clause – sort the data by one or more columns in the ascending and/or descending order.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
SELECT &lt;br /&gt;
    column1, column2&lt;br /&gt;
FROM&lt;br /&gt;
    table_name&lt;br /&gt;
ORDER BY column1 ASC , &lt;br /&gt;
         column2 DESC;&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, hire_date, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY first_name;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, hire_date, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, hire_date, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY hire_date;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, hire_date, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY hire_date DESC;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Section 4: Filtering Data&lt;br /&gt;
================================&lt;br /&gt;
https://www.sqltutorial.org/sql-distinct/&lt;br /&gt;
&lt;br /&gt;
DISTINCT  – show you how to remove duplicates from the result set.&lt;br /&gt;
LIMIT – constrain a number of rows returned by a query using the LIMIT and OFFSET clause.&lt;br /&gt;
FETCH – learn how to skip N rows in a result set before starting to return any rows.&lt;br /&gt;
WHERE Clause – filter data based on specified conditions.&lt;br /&gt;
Comparison operators – learn how to use the comparison operators including greater than, greater than or equal, less than, less than or equal, equal, and not equal to form the condition in the WHERE clause.&lt;br /&gt;
Logical operators – introduce the logical operators and how to use them to test for the truth of a condition.&lt;br /&gt;
AND operator – combine multiple Boolean expressions using the AND logical operator.&lt;br /&gt;
OR operator – show you how to use another logical operator OR to combine multiple Boolean expressions.&lt;br /&gt;
BETWEEN Operator – guide you to use the BETWEEN operator to select data within a range of values.&lt;br /&gt;
IN Operator – show you how to use the IN operator to check whether a value is in the list of values.&lt;br /&gt;
LIKE Operator –  query data based on a specified pattern.&lt;br /&gt;
IS NULL Operator – introduce the NULL concepts and show you how to check whether an expression is NULL or not.&lt;br /&gt;
NOT operator – show you how to negate a Boolean expression by using the NOT operator.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
SELECT DISTINCT&lt;br /&gt;
    column1, column2, ...&lt;br /&gt;
FROM&lt;br /&gt;
    table1;&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
SELECT salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT DISTINCT salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT job_id, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY job_id, salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT DISTINCT job_id, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY job_id, salary DESC;&lt;br /&gt;
&lt;br /&gt;
# valors nuls&lt;br /&gt;
SELECT DISTINCT phone_number&lt;br /&gt;
FROM employees;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
SELECT &lt;br /&gt;
    column_list&lt;br /&gt;
FROM&lt;br /&gt;
    table1&lt;br /&gt;
ORDER BY column_list&lt;br /&gt;
LIMIT row_count OFFSET offset;&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
SELECT  employee_id, first_name, last_name&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY first_name;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY first_name&lt;br /&gt;
LIMIT 5;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY first_name&lt;br /&gt;
LIMIT 5 OFFSET 3;&lt;br /&gt;
&lt;br /&gt;
# en mysql es pot fer d'una forma més curta:&lt;br /&gt;
SELECT employee_id, first_name, last_name&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY first_name&lt;br /&gt;
LIMIT 3 , 5;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY salary DESC&lt;br /&gt;
LIMIT 5;&lt;br /&gt;
&lt;br /&gt;
# el 2n salari més alt el trobarem de la següent manera:&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY salary DESC&lt;br /&gt;
LIMIT 1 OFFSET 1;&lt;br /&gt;
&lt;br /&gt;
SELECT DISTINCT salary&lt;br /&gt;
FROM employees&lt;br /&gt;
ORDER BY salary DESC&lt;br /&gt;
LIMIT 1 , 1;&lt;br /&gt;
&lt;br /&gt;
# per saber qui són les persones que cobren 17000:&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE salary = 17000;&lt;br /&gt;
&lt;br /&gt;
# podem combinar totes dues. Això són les subqueries (subconsultes):&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE salary = (SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 , 1);&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
SELECT &lt;br /&gt;
    column1, column2, ...&lt;br /&gt;
FROM&lt;br /&gt;
    table&lt;br /&gt;
WHERE&lt;br /&gt;
    condition;&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE salary &amp;gt; 14000&lt;br /&gt;
ORDER BY salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, department_id&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE department_id = 5&lt;br /&gt;
ORDER BY first_name;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE last_name = 'Chen';&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, hire_date&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE hire_date &amp;gt;= '1999-01-01'&lt;br /&gt;
ORDER BY hire_date DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, hire_date&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE YEAR (hire_date) = 1999&lt;br /&gt;
ORDER BY hire_date DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE last_name = 'Himuro'; &lt;br /&gt;
&lt;br /&gt;
# compte amb el NULL que funciona de manera diferent:&lt;br /&gt;
SELECT employee_id, first_name, last_name, phone_number&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE phone_number = NULL;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, phone_number&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE phone_number IS NULL;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, department_id&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE department_id &amp;lt;&amp;gt; 8&lt;br /&gt;
ORDER BY first_name , last_name;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, department_id&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE department_id &amp;lt;&amp;gt; 8 AND department_id &amp;lt;&amp;gt; 10&lt;br /&gt;
ORDER BY first_name , last_name; &lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE salary &amp;gt; 10000&lt;br /&gt;
ORDER BY salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE salary &amp;gt; 10000 AND department_id = 8&lt;br /&gt;
ORDER BY salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE salary &amp;lt; 10000&lt;br /&gt;
ORDER BY salary DESC;&lt;br /&gt;
&lt;br /&gt;
SELECT employee_id, first_name, last_name, salary&lt;br /&gt;
FROM employees&lt;br /&gt;
WHERE salary &amp;gt;= 9000&lt;br /&gt;
ORDER BY salary;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=T3: aplicació BDQuest=&lt;br /&gt;
*http://bdquest.joanillo.org&lt;br /&gt;
[[Fitxer:Select employees.png | thumbnail]]&lt;br /&gt;
&lt;br /&gt;
Fem una explicació a classe del funcionament de l'aplicació web. Com que és la primera vegada que aquesta aplicació s'utilitza a classe, els alumnes reportaran els problmemes d'usabilitat que segur que hi haurà, i s'intentarà incorporar tots les millores proposades.&lt;br /&gt;
&lt;br /&gt;
{{Autor}}, novembre 2021&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>