<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL_Tutorial</id>
		<title>PostgreSQL Tutorial - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL_Tutorial"/>
		<link rel="alternate" type="text/html" href="https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;action=history"/>
		<updated>2026-06-19T01:17:46Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=2011&amp;oldid=prev</id>
		<title>Dondi: /* Running PostgreSQL on the Lab Machines */ It actually is 9.2 :-\</title>
		<link rel="alternate" type="text/html" href="https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=2011&amp;oldid=prev"/>
				<updated>2015-10-01T21:38:29Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Running PostgreSQL on the Lab Machines: &lt;/span&gt; It actually is 9.2 :-\&lt;/span&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:38, 1 October 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L10&quot; &gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Server Groups&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Server Groups&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#** Servers (1)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#** Servers (1)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;#*** PostgreSQL 9.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;4 &lt;/del&gt;(localhost:5432)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;#*** PostgreSQL 9.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2 &lt;/ins&gt;(localhost:5432)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Double-click on &amp;#039;&amp;#039;PostgreSQL 9.4 (localhost:5432)&amp;#039;&amp;#039; to connect to the database server&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Double-click on &amp;#039;&amp;#039;PostgreSQL 9.4 (localhost:5432)&amp;#039;&amp;#039; to connect to the database server&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The password to start the server was given in class&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The password to start the server was given in class&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dondi</name></author>	</entry>

	<entry>
		<id>https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=2010&amp;oldid=prev</id>
		<title>Dondi: Small title correction.</title>
		<link rel="alternate" type="text/html" href="https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=2010&amp;oldid=prev"/>
				<updated>2015-10-01T21:19:35Z</updated>
		
		<summary type="html">&lt;p&gt;Small title correction.&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:19, 1 October 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L3&quot; &gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;But first, a little leadoff cartoon: http://xkcd.com/327&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;But first, a little leadoff cartoon: http://xkcd.com/327&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;== Running PostgreSQL on the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Keck &lt;/del&gt;Lab &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Windows &lt;/del&gt;Machines ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;== Running PostgreSQL on the Lab Machines ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Login to the computer as usual&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Login to the computer as usual&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L10&quot; &gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Server Groups&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Server Groups&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#** Servers (1)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#** Servers (1)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;#*** PostgreSQL 9.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2 &lt;/del&gt;(localhost:5432)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;#*** PostgreSQL 9.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;4 &lt;/ins&gt;(localhost:5432)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Double-click on &amp;#039;&amp;#039;PostgreSQL 9.4 (localhost:5432)&amp;#039;&amp;#039; to connect to the database server&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Double-click on &amp;#039;&amp;#039;PostgreSQL 9.4 (localhost:5432)&amp;#039;&amp;#039; to connect to the database server&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;# The password to start the server &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is simply &amp;#039;&amp;#039;keck&amp;#039;&amp;#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;# The password to start the server &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;was given in class&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Creating a Database ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Creating a Database ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dondi</name></author>	</entry>

	<entry>
		<id>https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=211&amp;oldid=prev</id>
		<title>Dondi: /* Creating a Database */ Version update.</title>
		<link rel="alternate" type="text/html" href="https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=211&amp;oldid=prev"/>
				<updated>2015-08-30T06:43:42Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Creating a Database: &lt;/span&gt; Version update.&lt;/span&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 06:43, 30 August 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L16&quot; &gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Creating a Database ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Creating a Database ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;Once the server is running, the red &amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039; disappears from the &amp;#039;&amp;#039;PostgreSQL 9.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2 &lt;/del&gt;(localhost:5432)&amp;#039;&amp;#039; icon, and additional icons appear beneath it.&amp;#160; If you click on the &amp;#039;&amp;#039;&amp;#039;+&amp;#039;&amp;#039;&amp;#039; button to the left of the &amp;#039;&amp;#039;Databases&amp;#039;&amp;#039; icon, you will see the databases that are currently available.&amp;#160; Initially, you will see a single database called &amp;#039;&amp;#039;&amp;#039;postgres&amp;#039;&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;Once the server is running, the red &amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039; disappears from the &amp;#039;&amp;#039;PostgreSQL 9.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;4 &lt;/ins&gt;(localhost:5432)&amp;#039;&amp;#039; icon, and additional icons appear beneath it.&amp;#160; If you click on the &amp;#039;&amp;#039;&amp;#039;+&amp;#039;&amp;#039;&amp;#039; button to the left of the &amp;#039;&amp;#039;Databases&amp;#039;&amp;#039; icon, you will see the databases that are currently available.&amp;#160; Initially, you will see a single database called &amp;#039;&amp;#039;&amp;#039;postgres&amp;#039;&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To do your work and practice some SQL, it is recommended that you work on a database of your own.&amp;#160; To create a database, right-click on the &amp;#039;&amp;#039;Databases&amp;#039;&amp;#039; icon and choose &amp;#039;&amp;#039;New Database...&amp;#039;&amp;#039; from the menu that appears.&amp;#160; In the &amp;#039;&amp;#039;&amp;#039;New Database&amp;#039;&amp;#039;&amp;#039; dialog, the only information you need to supply is your new database&amp;#039;s name.&amp;#160; To avoid confusion in case multiple students use the same computer, use your Keck lab username as the name of your database.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To do your work and practice some SQL, it is recommended that you work on a database of your own.&amp;#160; To create a database, right-click on the &amp;#039;&amp;#039;Databases&amp;#039;&amp;#039; icon and choose &amp;#039;&amp;#039;New Database...&amp;#039;&amp;#039; from the menu that appears.&amp;#160; In the &amp;#039;&amp;#039;&amp;#039;New Database&amp;#039;&amp;#039;&amp;#039; dialog, the only information you need to supply is your new database&amp;#039;s name.&amp;#160; To avoid confusion in case multiple students use the same computer, use your Keck lab username as the name of your database.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dondi</name></author>	</entry>

	<entry>
		<id>https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=210&amp;oldid=prev</id>
		<title>Dondi: /* Running PostgreSQL on the Keck Lab Windows Machines */ Slight version update.</title>
		<link rel="alternate" type="text/html" href="https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=210&amp;oldid=prev"/>
				<updated>2015-08-30T05:42:32Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Running PostgreSQL on the Keck Lab Windows Machines: &lt;/span&gt; Slight version update.&lt;/span&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 05:42, 30 August 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L11&quot; &gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#** Servers (1)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#** Servers (1)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#*** PostgreSQL 9.2 (localhost:5432)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#*** PostgreSQL 9.2 (localhost:5432)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;# Double-click on &amp;#039;&amp;#039;PostgreSQL 9.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2 &lt;/del&gt;(localhost:5432)&amp;#039;&amp;#039; to connect to the database server&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;# Double-click on &amp;#039;&amp;#039;PostgreSQL 9.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;4 &lt;/ins&gt;(localhost:5432)&amp;#039;&amp;#039; to connect to the database server&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The password to start the server is simply &amp;#039;&amp;#039;keck&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The password to start the server is simply &amp;#039;&amp;#039;keck&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dondi</name></author>	</entry>

	<entry>
		<id>https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=209&amp;oldid=prev</id>
		<title>Dondi: Initial transcription.</title>
		<link rel="alternate" type="text/html" href="https://xmlpipedb.lmucs.io/biodb/fall2015/index.php?title=PostgreSQL_Tutorial&amp;diff=209&amp;oldid=prev"/>
				<updated>2015-08-30T05:42:12Z</updated>
		
		<summary type="html">&lt;p&gt;Initial transcription.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page gives you a tutorial-style walkthrough for using PostgreSQL.  The walkthrough assumes that you’ve been set up for PostgreSQL use within the Keck lab infrastructure.&lt;br /&gt;
&lt;br /&gt;
But first, a little leadoff cartoon: http://xkcd.com/327&lt;br /&gt;
&lt;br /&gt;
== Running PostgreSQL on the Keck Lab Windows Machines ==&lt;br /&gt;
&lt;br /&gt;
# Login to the computer as usual&lt;br /&gt;
# From the &amp;#039;&amp;#039;Start&amp;#039;&amp;#039;/Windows icon menu, launch &amp;#039;&amp;#039;&amp;#039;pgAdmin III&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# The &amp;#039;&amp;#039;&amp;#039;pgAdmin III&amp;#039;&amp;#039;&amp;#039; window starts with a hierarchical view on the left that starts with three layers:&lt;br /&gt;
#* Server Groups&lt;br /&gt;
#** Servers (1)&lt;br /&gt;
#*** PostgreSQL 9.2 (localhost:5432)&lt;br /&gt;
# Double-click on &amp;#039;&amp;#039;PostgreSQL 9.2 (localhost:5432)&amp;#039;&amp;#039; to connect to the database server&lt;br /&gt;
# The password to start the server is simply &amp;#039;&amp;#039;keck&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Creating a Database ==&lt;br /&gt;
&lt;br /&gt;
Once the server is running, the red &amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039; disappears from the &amp;#039;&amp;#039;PostgreSQL 9.2 (localhost:5432)&amp;#039;&amp;#039; icon, and additional icons appear beneath it.  If you click on the &amp;#039;&amp;#039;&amp;#039;+&amp;#039;&amp;#039;&amp;#039; button to the left of the &amp;#039;&amp;#039;Databases&amp;#039;&amp;#039; icon, you will see the databases that are currently available.  Initially, you will see a single database called &amp;#039;&amp;#039;&amp;#039;postgres&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To do your work and practice some SQL, it is recommended that you work on a database of your own.  To create a database, right-click on the &amp;#039;&amp;#039;Databases&amp;#039;&amp;#039; icon and choose &amp;#039;&amp;#039;New Database...&amp;#039;&amp;#039; from the menu that appears.  In the &amp;#039;&amp;#039;&amp;#039;New Database&amp;#039;&amp;#039;&amp;#039; dialog, the only information you need to supply is your new database&amp;#039;s name.  To avoid confusion in case multiple students use the same computer, use your Keck lab username as the name of your database.&lt;br /&gt;
&lt;br /&gt;
When you click &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;, you will return to the main &amp;#039;&amp;#039;&amp;#039;pgAdmin III&amp;#039;&amp;#039;&amp;#039; window and you should see your new database underneath the &amp;#039;&amp;#039;Databases&amp;#039;&amp;#039; icon.&lt;br /&gt;
&lt;br /&gt;
Note that you only need to go through this creation process once; that database will remain available until it is explicitly deleted.&lt;br /&gt;
&lt;br /&gt;
== Connecting to a Database ==&lt;br /&gt;
&lt;br /&gt;
To start using a database, click on its icon.  The red &amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039; disappears from the database icon and you should now be able to work.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough: Loading the Sample Movie Table Into Your Database ==&lt;br /&gt;
&lt;br /&gt;
Before we can dive into SQL, we need to set up some information that we can access.  In doing this, you will see how data in a plain text file can find its way into a full-fledged relational table.&lt;br /&gt;
&lt;br /&gt;
We will load up the &amp;#039;&amp;#039;movie_titles.txt&amp;#039;&amp;#039; file in &amp;#039;&amp;#039;~dondi/xmlpipedb/data&amp;#039;&amp;#039; into your own database.  If you &amp;#039;&amp;#039;&amp;#039;cat&amp;#039;&amp;#039;&amp;#039; that file, you will see that it looks like this:&lt;br /&gt;
&lt;br /&gt;
 17761,2003,Levity&lt;br /&gt;
 17762,1997,Gattaca&lt;br /&gt;
 17763,1978,Interiors&lt;br /&gt;
 17764,1998,Shakespeare in Love&lt;br /&gt;
 17765,1969,Godzilla&amp;#039;s Revenge&lt;br /&gt;
 17766,2002,Where the Wild Things Are and Other Maurice Sendak Stories&lt;br /&gt;
 17767,2004,Fidel Castro: American Experience&lt;br /&gt;
 17768,2000,Epoch&lt;br /&gt;
 17769,2003,The Company&lt;br /&gt;
 17770,2003,Alien Hunter&lt;br /&gt;
&lt;br /&gt;
(this is from the end of the file)&lt;br /&gt;
&lt;br /&gt;
Looking at the information, we recognize that this file consists of a movie ID, a year, and a title.  Thus, we need to prepare a table with these columns in our database.&lt;br /&gt;
&lt;br /&gt;
=== Create the Movie Table ===&lt;br /&gt;
&lt;br /&gt;
Switching back to &amp;#039;&amp;#039;&amp;#039;pgAdmin III&amp;#039;&amp;#039;&amp;#039;, click the SQL button in the toolbar.  A new window with an &amp;#039;&amp;#039;&amp;#039;SQL Editor&amp;#039;&amp;#039;&amp;#039; tab appears.  The following command will create your &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table; type this into that tab:&lt;br /&gt;
&lt;br /&gt;
 create table movie (id int primary key, year int, title varchar)&lt;br /&gt;
&lt;br /&gt;
As always, watch out for typos!  When ready, click on the &amp;#039;&amp;#039;&amp;#039;Execute query&amp;#039;&amp;#039;&amp;#039; button in the toolbar.  (its button looks like a green play button)&lt;br /&gt;
&lt;br /&gt;
Upon executing the query, the following should appear in the &amp;#039;&amp;#039;&amp;#039;Messages&amp;#039;&amp;#039;&amp;#039; tab of the &amp;#039;&amp;#039;Output Pane&amp;#039;&amp;#039; in the bottom half of the window:&lt;br /&gt;
&lt;br /&gt;
 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index &amp;quot;movie_pkey&amp;quot; for table &amp;quot;movie&amp;quot;&lt;br /&gt;
 Query returned successfully with no result in 101 ms.&lt;br /&gt;
&lt;br /&gt;
To assure yourself that the &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table is indeed there, type and execute this query:&lt;br /&gt;
&lt;br /&gt;
 select * from movie&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Data Output&amp;#039;&amp;#039;&amp;#039; tab of the &amp;#039;&amp;#039;Output Pane&amp;#039;&amp;#039; should now show an empty tabular display with headings for &amp;#039;&amp;#039;&amp;#039;id integer&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;year integer&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;title character varying&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Prepare Data for Insertion into the Movie Table ===&lt;br /&gt;
&lt;br /&gt;
At this point, you have a &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table, but no data: that information currently resides in &amp;#039;&amp;#039;movie_titles.txt&amp;#039;&amp;#039; over in the Keck lab&amp;#039;s &amp;#039;&amp;#039;my.cs.lmu.edu&amp;#039;&amp;#039; server.  How do we get that data into our &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table?&lt;br /&gt;
&lt;br /&gt;
Recall that the SQL command for adding data has this format:&lt;br /&gt;
&lt;br /&gt;
 insert into &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;table&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;columns&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;) values (&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;values&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
In other words, this text data:&lt;br /&gt;
&lt;br /&gt;
 17761,2003,Levity&lt;br /&gt;
 17762,1997,Gattaca&lt;br /&gt;
 17763,1978,Interiors&lt;br /&gt;
 17764,1998,Shakespeare in Love&lt;br /&gt;
 17765,1969,Godzilla&amp;#039;s Revenge&lt;br /&gt;
 17766,2002,Where the Wild Things Are and Other Maurice Sendak Stories&lt;br /&gt;
 17767,2004,Fidel Castro: American Experience&lt;br /&gt;
 17768,2000,Epoch&lt;br /&gt;
 17769,2003,The Company&lt;br /&gt;
 17770,2003,Alien Hunter&lt;br /&gt;
&lt;br /&gt;
...must be made to look like this:&lt;br /&gt;
&lt;br /&gt;
 insert into movie(id, year, title) values (17761,2003,&amp;#039;Levity&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17762,1997,&amp;#039;Gattaca&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17763,1978,&amp;#039;Interiors&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17764,1998,&amp;#039;Shakespeare in Love&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17765,1969,&amp;#039;Godzilla&amp;#039;&amp;#039;s Revenge&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17766,2002,&amp;#039;Where the Wild Things Are and Other Maurice Sendak Stories&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17767,2004,&amp;#039;Fidel Castro: American Experience&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17768,2000,&amp;#039;Epoch&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17769,2003,&amp;#039;The Company&amp;#039;);&lt;br /&gt;
 insert into movie(id, year, title) values (17770,2003,&amp;#039;Alien Hunter&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
Note a few rules here that might not be very obvious:&lt;br /&gt;
* Text values need to be enclosed between single quotes; numbers don&amp;#039;t.&lt;br /&gt;
* Note, in the case of movie 17765, &amp;#039;&amp;#039;Godzilla&amp;#039;s Revenge&amp;#039;&amp;#039;, that the &amp;#039;&amp;#039;movie title itself&amp;#039;&amp;#039; contains a single quote (apostrophe).  To distinguish an “in-text” apostrophe from a “wrapper” apostrophe, we double it up; that&amp;#039;s why the SQL above shows &amp;#039;&amp;#039;Godzilla&amp;#039;s Revenge&amp;#039;&amp;#039; with the apostrophe converted into two.&lt;br /&gt;
* When performing multiple SQL queries, the semicolon (;) is used to distinguish one query from another.  Think of the semicolon as playing the same role that periods (.) do in plain English sentences.&lt;br /&gt;
&lt;br /&gt;
Hmmmmm...do we have a program that can do this?  We need to take the lines in the &amp;#039;&amp;#039;movie_titles.txt&amp;#039;&amp;#039; file and convert them into valid SQL &amp;#039;&amp;#039;insert&amp;#039;&amp;#039; commands.  Why yes we do, and you have already used it: &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Since this is a tutorial, we won&amp;#039;t spend time to explain exactly how we come up with the &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039; command below.  But you should be able to see the pieces:&lt;br /&gt;
* We need to turn all single apostrophes into doubles.&lt;br /&gt;
* We then need to “wrap” the titles at the end around single quotes.&lt;br /&gt;
* Finally, we append the &amp;#039;&amp;#039;insert&amp;#039;&amp;#039; command before each line, and&lt;br /&gt;
* end each line with a parenthesis and semicolon.&lt;br /&gt;
&lt;br /&gt;
Finally, we somehow need to get the data into the PostgreSQL server running on your workstation.  For this, we will use the built-in web server of the &amp;#039;&amp;#039;my.cs.lmu.edu&amp;#039;&amp;#039; host: we will deposit the results of &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039; into a file that a &amp;#039;&amp;#039;web browser&amp;#039;&amp;#039; can then display.  From the web browser, we can copy and paste the &amp;#039;&amp;#039;insert&amp;#039;&amp;#039; statements into the &amp;#039;&amp;#039;&amp;#039;pgAdmin III&amp;#039;&amp;#039;&amp;#039; SQL window.&lt;br /&gt;
&lt;br /&gt;
All that said (no pun intended), this is the command that you want (invoke it from &amp;#039;&amp;#039;~dondi/xmlpipedb/data&amp;#039;&amp;#039;):&lt;br /&gt;
&lt;br /&gt;
 cat movie_titles.txt | sed &amp;quot;s/&amp;#039;/&amp;#039;&amp;amp;apos;/g&amp;quot; | sed &amp;quot;s/,/,&amp;#039;/2&amp;quot; | sed &amp;quot;s/^/insert into movie(id,year,title) values(/g&amp;quot; | sed &amp;quot;s/$/&amp;#039;);/g&amp;quot; &amp;gt; ~/public_html/movie.sql.txt&lt;br /&gt;
&lt;br /&gt;
At this point, you can probably work out the &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039; commands.  The portion we will explain just a little bit more is the last section, &amp;lt;code&amp;gt;&amp;amp;gt; ~/public_html/movie.sql.txt&amp;lt;/code&amp;gt;.  We have not needed to use the &amp;#039;&amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;&amp;#039; symbol before, but now it is just what we need: it “sends” the result of the prior &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039; commands into a file.  That file is placed in your &amp;#039;&amp;#039;public_html&amp;#039;&amp;#039; folder, which, if you recall, is visible on the web as http://my.cs.lmu.edu/~your_username/.&lt;br /&gt;
&lt;br /&gt;
=== Insert! ===&lt;br /&gt;
&lt;br /&gt;
Finally, we can feed these 17,770 &amp;#039;&amp;#039;insert&amp;#039;&amp;#039; statements (quick, how did we know this?) into PostgreSQL.  Open a new browser tab or window and go to http://my.cs.lmu.edu/~username/movie.sql.txt (remember to substitute &amp;#039;&amp;#039;username&amp;#039;&amp;#039; with your Keck lab &amp;#039;&amp;#039;ssh&amp;#039;&amp;#039;/&amp;#039;&amp;#039;PuTTY&amp;#039;&amp;#039; login.  You should see your fresh &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039; product in the browser.  From here, &amp;#039;&amp;#039;&amp;#039;Select All&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Copy&amp;#039;&amp;#039;&amp;#039; the commands.&lt;br /&gt;
&lt;br /&gt;
Switch to the &amp;#039;&amp;#039;&amp;#039;pgAdmin III&amp;#039;&amp;#039;&amp;#039; SQL window, empty out the &amp;#039;&amp;#039;&amp;#039;SQL Editor&amp;#039;&amp;#039;&amp;#039; tab, then &amp;#039;&amp;#039;&amp;#039;Paste&amp;#039;&amp;#039;&amp;#039; your &amp;#039;&amp;#039;insert&amp;#039;&amp;#039; statements into the tab.  Finally, execute the query (the green play button, remember?) and let it work.  With 17,770 records, this takes a &amp;#039;&amp;#039;little&amp;#039;&amp;#039; bit longer than prior commands that you have run.&lt;br /&gt;
&lt;br /&gt;
In the end, the &amp;#039;&amp;#039;&amp;#039;Messages&amp;#039;&amp;#039;&amp;#039; tab in the &amp;#039;&amp;#039;Output Pane&amp;#039;&amp;#039; should say something like:&lt;br /&gt;
&lt;br /&gt;
 Query returned successfully: one row affected, 2325 ms execution time.&lt;br /&gt;
&lt;br /&gt;
(exact execution times will vary)&lt;br /&gt;
&lt;br /&gt;
Once more, check your work; re-execute this:&lt;br /&gt;
&lt;br /&gt;
 select * from movie&lt;br /&gt;
&lt;br /&gt;
This time, you should see a fully-populated &amp;#039;&amp;#039;&amp;#039;Data Output&amp;#039;&amp;#039;&amp;#039; tab, with...17,770 rows.&lt;br /&gt;
&lt;br /&gt;
== Walkthrough: Adding a Few More Tables ==&lt;br /&gt;
&lt;br /&gt;
To make our database a little more interesting, will create a couple more tables and load them with some data.  The rest of the tutorial will be based on these tables and their content.&lt;br /&gt;
&lt;br /&gt;
At this stage, you’ve already seen these commands in some form, so we’ll skip the explanation and go right to the commands.  Copy, paste, and run this (you successfully copied and pasted 17,770 &amp;#039;&amp;#039;insert&amp;#039;&amp;#039; commands previously, so this should be no sweat!):&lt;br /&gt;
&lt;br /&gt;
 create table member (id int primary key, name varchar);&lt;br /&gt;
 create table rating (movie int references movie(id), member int references member(id), rating int);&lt;br /&gt;
 insert into member(id, name) values (6, &amp;#039;Natalie&amp;#039;);&lt;br /&gt;
 insert into member(id, name) values (8, &amp;#039;Boomer&amp;#039;);&lt;br /&gt;
 insert into member(id, name) values (42, &amp;#039;Doug&amp;#039;);&lt;br /&gt;
 insert into rating(movie, member, rating) values(209, 6, 5);&lt;br /&gt;
 insert into rating(movie, member, rating) values(2040, 6, 5);&lt;br /&gt;
 insert into rating(movie, member, rating) values(6908, 6, 2);&lt;br /&gt;
 insert into rating(movie, member, rating) values(2610, 6, 1);&lt;br /&gt;
 insert into rating(movie, member, rating) values(8809, 6, 2);&lt;br /&gt;
 insert into rating(movie, member, rating) values(37, 6, 4);&lt;br /&gt;
 insert into rating(movie, member, rating) values(113, 6, 2);&lt;br /&gt;
 insert into rating(movie, member, rating) values(8687, 8, 1);&lt;br /&gt;
 insert into rating(movie, member, rating) values(9628, 8, 5);&lt;br /&gt;
 insert into rating(movie, member, rating) values(10877, 8, 2);&lt;br /&gt;
 insert into rating(movie, member, rating) values(12513, 8, 1);&lt;br /&gt;
 insert into rating(movie, member, rating) values(15923, 8, 2);&lt;br /&gt;
 insert into rating(movie, member, rating) values(15532, 8, 3);&lt;br /&gt;
 insert into rating(movie, member, rating) values(4006, 8, 3);&lt;br /&gt;
 insert into rating(movie, member, rating) values (30, 42, 4);&lt;br /&gt;
 insert into rating(movie, member, rating) values (113, 42, 5);&lt;br /&gt;
 insert into rating(movie, member, rating) values (37, 42, 5);&lt;br /&gt;
 insert into rating(movie, member, rating) values (4765, 42, 5);&lt;br /&gt;
 insert into rating(movie, member, rating) values (6762, 42, 3);&lt;br /&gt;
 insert into rating(movie, member, rating) values (6853, 42, 4);&lt;br /&gt;
 insert into rating(movie, member, rating) values (10176, 42, 4);&lt;br /&gt;
 insert into rating(movie, member, rating) values (13847, 42, 5);&lt;br /&gt;
 insert into rating(movie, member, rating) values (15127, 42, 3);&lt;br /&gt;
 insert into rating(movie, member, rating) values (15532, 42, 1);&lt;br /&gt;
&lt;br /&gt;
You should see the customary success messages once the commands are done.  Time to play!&lt;br /&gt;
&lt;br /&gt;
== An Introduction to SQL Select Queries ==&lt;br /&gt;
&lt;br /&gt;
Database activities are triggered via &amp;#039;&amp;#039;SQL&amp;#039;&amp;#039; commands.  The previous &amp;#039;&amp;#039;SQL&amp;#039;&amp;#039; PDF handout gives you more of a reference/nutshell view of SQL; this page walks you through some commands step-by-step, using the sample movie database that you set up earlier in this page.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;select&amp;#039;&amp;#039; command is the SQL “kitchen sink” for retrieving information from a database.  Its general, basic form is:&lt;br /&gt;
&lt;br /&gt;
 select &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;columns&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; from &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;tables&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; where &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;conditions&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
As you will see, &amp;#039;&amp;#039;select&amp;#039;&amp;#039; can do even more, but let’s start simple.&lt;br /&gt;
&lt;br /&gt;
=== Basics ===&lt;br /&gt;
&lt;br /&gt;
The simplest type of &amp;#039;&amp;#039;select&amp;#039;&amp;#039; queries involve getting records from an individual table based on relatively simple conditions.  For example:&lt;br /&gt;
&lt;br /&gt;
 select year from movie where title = &amp;#039;Metropolis&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
...will retrieve the release years of movies whose titles are &amp;#039;&amp;#039;exactly&amp;#039;&amp;#039; “Metropolis.”  If you try this query, you should see two rows: one for 2001 and another for 1927.&lt;br /&gt;
&lt;br /&gt;
In addition to equality, &amp;#039;&amp;#039;like&amp;#039;&amp;#039; lends further flexibility.  The &amp;#039;&amp;#039;like&amp;#039;&amp;#039; comparison allows for pattern matching, similar but not identical to &amp;#039;&amp;#039;&amp;#039;grep&amp;#039;&amp;#039;&amp;#039;.  In SQL, the percent sign (“&amp;#039;&amp;#039;&amp;#039;%&amp;#039;&amp;#039;&amp;#039;”) is a “wildcard” that can represent any number of letters and symbols.  &amp;#039;&amp;#039;like&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;%&amp;#039;&amp;#039;&amp;#039; can be combined for broader queries, such as this one, which retrieves all movie titles that have the word “Vampire” in them:&lt;br /&gt;
&lt;br /&gt;
 select title from movie where title like &amp;#039;%Vampire%&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
If you want &amp;#039;&amp;#039;select&amp;#039;&amp;#039; to display &amp;#039;&amp;#039;all&amp;#039;&amp;#039; columns of a database record, use the asterisk (&amp;#039;&amp;#039;&amp;#039;*&amp;#039;&amp;#039;&amp;#039;):&lt;br /&gt;
&lt;br /&gt;
 select * from movie where title like &amp;#039;19%&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
This will display &amp;#039;&amp;#039;every&amp;#039;&amp;#039; column/field of movie records whose title starts with “19”&amp;amp;mdash;these mostly appear to be films pertaining to a specific year in the 20th century.&lt;br /&gt;
&lt;br /&gt;
Conditions can be combined via &amp;#039;&amp;#039;and&amp;#039;&amp;#039; and &amp;#039;&amp;#039;or&amp;#039;&amp;#039;; for example, retrieving movies whose title contains &amp;#039;&amp;#039;either&amp;#039;&amp;#039; “DNA” or “Bio” can be done with:&lt;br /&gt;
&lt;br /&gt;
 select * from movie where title like &amp;#039;%DNA%&amp;#039; or title like &amp;#039;%Bio%&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
When using more than two conditions, watch out for how conditions are grouped together; this query, for example, may yield unexpected results:&lt;br /&gt;
&lt;br /&gt;
 select * from movie where title like &amp;#039;%DNA%&amp;#039; or title like &amp;#039;%Bio%&amp;#039; and title like &amp;#039;%:%&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
At face value, the above query may read like “movies whose titles have either DNA or Bio which also have a colon (&amp;#039;&amp;#039;&amp;#039;:&amp;#039;&amp;#039;&amp;#039;);” in reality, the colon criterion is only &amp;#039;&amp;#039;and&amp;#039;&amp;#039;-ed with movies that have “Bio” in the title.  Thus, the database actually interprets this query as “movies whose titles have DNA, &amp;#039;&amp;#039;or&amp;#039;&amp;#039; whose titles have Bio and a colon.”&lt;br /&gt;
&lt;br /&gt;
To eliminate any ambiguities, use parentheses to group conditions together:&lt;br /&gt;
&lt;br /&gt;
 select * from movie where (title like &amp;#039;%DNA%&amp;#039; or title like &amp;#039;%Bio%&amp;#039;) and title like &amp;#039;%:%&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
These parentheses force the database to pick out movies with either title first, and &amp;#039;&amp;#039;then&amp;#039;&amp;#039; check if these movies have a colon in their titles.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;like&amp;#039;&amp;#039; comparator can do simple text matches, but it does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; use regular expressions (i.e., the search patterns recognized by &amp;#039;&amp;#039;&amp;#039;grep&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039;).  This area is a little shaky in SQL-land; there is an official &amp;#039;&amp;#039;similar to&amp;#039;&amp;#039; comparator which is the official way to make regular expression comparisons, but the format for those expressions is not the same as the format used by &amp;#039;&amp;#039;&amp;#039;grep&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Fortunately, PostgreSQL has a specific, PostgreSQL-only comparator that &amp;#039;&amp;#039;does&amp;#039;&amp;#039; match the same patterns used by &amp;#039;&amp;#039;&amp;#039;grep&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039;: the tilde (&amp;#039;&amp;#039;&amp;#039;~&amp;#039;&amp;#039;&amp;#039;).  Comparing with &amp;#039;&amp;#039;&amp;#039;~&amp;#039;&amp;#039;&amp;#039; is equivalent to a &amp;#039;&amp;#039;&amp;#039;grep&amp;#039;&amp;#039;&amp;#039;- or &amp;#039;&amp;#039;&amp;#039;sed&amp;#039;&amp;#039;&amp;#039;-like comparison:&lt;br /&gt;
&lt;br /&gt;
 select * from movie where title ~ &amp;#039;Vamp[iy]re&amp;#039;;&lt;br /&gt;
 select * from movie where title ~ &amp;#039;End$&amp;#039;;&lt;br /&gt;
 select * from movie where title ~ &amp;#039;Colou?r&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
The caveat here is that &amp;#039;&amp;#039;&amp;#039;~&amp;#039;&amp;#039;&amp;#039; is a PostgreSQL-specific feature: if you move to other database systems (such as Microsoft Access), that feature may either be done differently or missing completely, since it is not part of the official SQL standard.&lt;br /&gt;
&lt;br /&gt;
Numeric values, such as the &amp;#039;&amp;#039;year&amp;#039;&amp;#039; column, can be compared using &amp;#039;&amp;#039;=&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;lt;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;lt;=&amp;#039;&amp;#039; (greater than or equal to), &amp;#039;&amp;#039;&amp;gt;=&amp;#039;&amp;#039; (less than or equal to), and &amp;#039;&amp;#039;&amp;lt;&amp;gt;&amp;#039;&amp;#039; (not equal):&lt;br /&gt;
&lt;br /&gt;
 select * from movie where year = 1960;&lt;br /&gt;
 select * from movie where year &amp;lt; 1930;&lt;br /&gt;
 select * from movie where year &amp;gt;= 1960 and year &amp;lt; 1970;&lt;br /&gt;
&lt;br /&gt;
=== Sorting ===&lt;br /&gt;
&lt;br /&gt;
As you play with various queries on the &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table, you’ve probably noticed that results are returned in no particular order; if you’d like to sort the results in some way, tack on an &amp;#039;&amp;#039;order by&amp;#039;&amp;#039; clause at the end of the &amp;#039;&amp;#039;select&amp;#039;&amp;#039; query:&lt;br /&gt;
&lt;br /&gt;
 select * from movie where year &amp;gt; 2000 order by year&lt;br /&gt;
&lt;br /&gt;
This will display the records/rows for movies released from 2001 onward, sorted by year.  You can add more fields for a very specific sort order:&lt;br /&gt;
&lt;br /&gt;
 select * from movie where year &amp;gt; 2000 order by year, title&lt;br /&gt;
&lt;br /&gt;
The above query returns the same records, but this time sorted by year first, then by title &amp;#039;&amp;#039;within&amp;#039;&amp;#039; each year.&lt;br /&gt;
&lt;br /&gt;
Sort order is ascending by default (e.g., A to Z, 0 to 9); for the reverse order, add &amp;#039;&amp;#039;desc&amp;#039;&amp;#039; to the field(s) that you’d like to see sorted in reverse:&lt;br /&gt;
&lt;br /&gt;
 select * from movie where year &amp;gt; 2000 order by year desc, title;&lt;br /&gt;
&lt;br /&gt;
This will display records with years displayed most recent first; within each year, however, titles will still be sorted in ascending order.&lt;br /&gt;
&lt;br /&gt;
=== Aggregate Queries ===&lt;br /&gt;
&lt;br /&gt;
For large databases, SQL provides &amp;#039;&amp;#039;aggregate&amp;#039;&amp;#039; (a.k.a. “grouping”) queries that summarize multiple records in different ways.&lt;br /&gt;
&lt;br /&gt;
The simplest form of summary is counting: &amp;#039;&amp;#039;how many&amp;#039;&amp;#039; records were retrieved?  A simple overall count is done by using &amp;#039;&amp;#039;count(*)&amp;#039;&amp;#039; as the thing to select (or &amp;#039;&amp;#039;project&amp;#039;&amp;#039;, in formal relational algebraic terms):&lt;br /&gt;
&lt;br /&gt;
 select count(*) from movie where year &amp;gt; 2000&lt;br /&gt;
&lt;br /&gt;
This will display the number of movies released from 2001 onward.&lt;br /&gt;
&lt;br /&gt;
Of course, you can mix and match everything you have learned so far.  To count the movies whose titles begin with a “B” that were released in 1975, you can query:&lt;br /&gt;
&lt;br /&gt;
 select count(*) from movie where title ~ &amp;#039;^B&amp;#039; and year = 1975&lt;br /&gt;
&lt;br /&gt;
Aggregators other than &amp;#039;&amp;#039;count&amp;#039;&amp;#039; are available, such as &amp;#039;&amp;#039;min&amp;#039;&amp;#039;, &amp;#039;&amp;#039;max&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;avg&amp;#039;&amp;#039; (average or mean).  Though somewhat odd-sounding, you can ask, for example, for the “average year” of movies with “London” in the title:&lt;br /&gt;
&lt;br /&gt;
 select average(year) from movie where title like &amp;#039;%London%&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Finally, you can aggregate &amp;#039;&amp;#039;multiple groups&amp;#039;&amp;#039; of data, so that you get different sets of statistics.  The &amp;#039;&amp;#039;group by&amp;#039;&amp;#039; keyword does this:&lt;br /&gt;
&lt;br /&gt;
 select year, count(*) from movie where year &amp;lt; 1935 group by year&lt;br /&gt;
&lt;br /&gt;
The main rule with &amp;#039;&amp;#039;group by&amp;#039;&amp;#039; is that the column being grouped should also be part of the &amp;#039;&amp;#039;select&amp;#039;&amp;#039; clause.  This makes sense because otherwise, you wouldn’t be able to tell which group was which!  And of course, you can mix and match.  For example, the query above makes more sense if we arrange the data chronologically:&lt;br /&gt;
&lt;br /&gt;
 select year, count(*) from movie where year &amp;lt; 1935 group by year order by year&lt;br /&gt;
&lt;br /&gt;
See any trends in that data?&lt;br /&gt;
&lt;br /&gt;
=== Joins ===&lt;br /&gt;
&lt;br /&gt;
Thus far, we’ve only been working with one table in the database: &amp;#039;&amp;#039;movie&amp;#039;&amp;#039;.  Our other tables, &amp;#039;&amp;#039;member&amp;#039;&amp;#039; and &amp;#039;&amp;#039;rating&amp;#039;&amp;#039;, add some further interest.  These tables store ratings, from 1 to 5, made by individual members on movies they have seen.&lt;br /&gt;
&lt;br /&gt;
Examination of the &amp;#039;&amp;#039;rating&amp;#039;&amp;#039; table reveals that it has &amp;#039;&amp;#039;movie&amp;#039;&amp;#039;, &amp;#039;&amp;#039;member&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;rating&amp;#039;&amp;#039;.  Thus, each record consists of a single rating, made by a particular member for a particular movie.  Staying with one table for now, this query will list all of the ratings submitted by member no. 6:&lt;br /&gt;
&lt;br /&gt;
 select * from rating where member = 6&lt;br /&gt;
&lt;br /&gt;
This returns the expected answer (based on the &amp;#039;&amp;#039;insert&amp;#039;&amp;#039;s that you copy-pasted previously), but you may have noticed that the result isn’t quite as meaningful to us, since we get movie &amp;#039;&amp;#039;IDs&amp;#039;&amp;#039; back instead of &amp;#039;&amp;#039;titles&amp;#039;&amp;#039;.  These movie titles, however, are in the &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table, not &amp;#039;&amp;#039;rating&amp;#039;&amp;#039;.  We thus need to &amp;#039;&amp;#039;join&amp;#039;&amp;#039; the two tables.  As you might have seen when looking at the schema of the &amp;#039;&amp;#039;rating&amp;#039;&amp;#039; table, the &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; field is a &amp;#039;&amp;#039;foreign key&amp;#039;&amp;#039; to the &amp;#039;&amp;#039;id&amp;#039;&amp;#039; field in the &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table.  Thus, every &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; value in the &amp;#039;&amp;#039;rating&amp;#039;&amp;#039; table matches some &amp;#039;&amp;#039;id&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; table, thus leading us to that movie’s title.&lt;br /&gt;
&lt;br /&gt;
An SQL &amp;#039;&amp;#039;join&amp;#039;&amp;#039; uses the same basic &amp;#039;&amp;#039;select&amp;#039;&amp;#039; command, but requires the tables being joined (in this case &amp;#039;&amp;#039;movie&amp;#039;&amp;#039; and &amp;#039;&amp;#039;rating&amp;#039;&amp;#039;), as well as the fields/columns to use for “joining” records.  “Joining” records means that their fields are combined to create a new “virtual” record.  All other parts of the &amp;#039;&amp;#039;select&amp;#039;&amp;#039; command retain the same meanings as before:&lt;br /&gt;
&lt;br /&gt;
 select &amp;#039;&amp;#039;&amp;#039;columns&amp;#039;&amp;#039;&amp;#039; from &amp;#039;&amp;#039;&amp;#039;table1&amp;#039;&amp;#039;&amp;#039; inner join &amp;#039;&amp;#039;&amp;#039;table2&amp;#039;&amp;#039;&amp;#039; on (&amp;#039;&amp;#039;&amp;#039;join condition&amp;#039;&amp;#039;&amp;#039;) where &amp;#039;&amp;#039;&amp;#039;conditions&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Thus, the previous query, modified to retrieve the titles and ratings of the movies rated by member no. 6, looks like this:&lt;br /&gt;
&lt;br /&gt;
 select title, rating from movie inner join rating on (movie.id = rating.movie) where member = 6&lt;br /&gt;
&lt;br /&gt;
As in the basic &amp;#039;&amp;#039;select&amp;#039;&amp;#039; command, you can tailor the &amp;#039;&amp;#039;where&amp;#039;&amp;#039; conditions as you need to pull ratings based on other criteria.  For example, ratings for a particular movie, as opposed as for a particular member, can be retrieved by changing the &amp;#039;&amp;#039;where&amp;#039;&amp;#039; clause.  The query below displays all ratings for the movie(s) whose title has an apostrophe (see the last section below for more on this):&lt;br /&gt;
&lt;br /&gt;
 select rating from movie inner join rating on (movie.id = rating.movie) where title like &amp;#039;%&amp;lt;nowiki&amp;gt;&amp;#039;&amp;#039;&amp;lt;/nowiki&amp;gt;%&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;#039;&amp;#039;member&amp;#039;&amp;#039; column of the &amp;#039;&amp;#039;rating&amp;#039;&amp;#039; table is a foreign key as well—it refers to the &amp;#039;&amp;#039;id&amp;#039;&amp;#039; column of the &amp;#039;&amp;#039;member&amp;#039;&amp;#039; table.  The &amp;#039;&amp;#039;member&amp;#039;&amp;#039; table in our sample only includes member names, but in practice it can hold much more information.  We can join more than once; extending the query above, we can now produce all ratings for the movie(s) whose title has an apostrophe, &amp;#039;&amp;#039;and&amp;#039;&amp;#039; list the member names who gave those ratings:&lt;br /&gt;
&lt;br /&gt;
 select name, rating from movie inner join rating on (movie.id = rating.movie) inner join member on (member.id = rating.member) where title like &amp;#039;%&amp;lt;nowiki&amp;gt;&amp;#039;&amp;#039;&amp;lt;/nowiki&amp;gt;%&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note how this approach helps avoid redundancy: instead of copying a member’s name over and over again, we can store the member’s name in one place, and use their ID as a reference to that name.  This elimination of redundancy is called &amp;#039;&amp;#039;normalization&amp;#039;&amp;#039;—tables are &amp;#039;&amp;#039;normalized&amp;#039;&amp;#039; if they eliminate data redundancy in their columns (except, of course, for foreign keys).&lt;br /&gt;
&lt;br /&gt;
=== The Notorious Apostrophe ===&lt;br /&gt;
&lt;br /&gt;
You might have noticed that, because the apostrophe or single quote is used to indicate specific values in SQL (e.g., &amp;#039;The Godfather&amp;#039;, &amp;#039;Smith&amp;#039;, &amp;#039;6/30/1980&amp;#039;, etc.), we run into a potential problem when the value itself should contain an apostrophe.  This is not as uncommon as one might think; for example, a good number of movie titles have apostrophes (&amp;#039;&amp;#039;By Dawn&amp;#039;s Early Light&amp;#039;&amp;#039;, &amp;#039;&amp;#039;Zatoichi&amp;#039;s Conspiracy&amp;#039;&amp;#039;, &amp;#039;&amp;#039;Logan&amp;#039;s Run&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;Dead Men Don&amp;#039;t Wear Plaid&amp;#039;&amp;#039;, to name a few), as do many names (“O&amp;#039;Malley,” “M&amp;#039;Benga,” “D&amp;#039;Angelo”).  An &amp;#039;&amp;#039;insert&amp;#039;&amp;#039; command such as the one below will result in an error, since the apostrophe will be misinterpreted as ending a piece of text rather than as part of the text itself:&lt;br /&gt;
&lt;br /&gt;
 insert into person(id, firstname, lastname, dob) values(2000, &amp;#039;Beverly&amp;#039;, &amp;#039;D&amp;#039;Angelo&amp;#039;, &amp;#039;8/21/1960&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
Fortunately, SQL has a solution: apostrophes &amp;#039;&amp;#039;inside&amp;#039;&amp;#039; text should be indicated via &amp;#039;&amp;#039;two consecutive&amp;#039;&amp;#039; apostrophes, or &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&amp;#039;&amp;#039;&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;.  When encountered, SQL converts this pair of apostrophes into a single one, and does not interpret these apostrophes as ending a piece of text.  Thus, the above command will work if rewritten in this way:&lt;br /&gt;
&lt;br /&gt;
 insert into person(id, firstname, lastname, dob) values(2000, &amp;#039;Beverly&amp;#039;, &amp;#039;D&amp;lt;nowiki&amp;gt;&amp;#039;&amp;#039;&amp;lt;/nowiki&amp;gt;Angelo&amp;#039;, &amp;#039;8/21/1960&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
While the solution does exist, it isn’t automatic: you need to be aware that apostrophes have to be written as “double apostrophes” before passing any text values on to SQL.  Keep this in mind when trying to load data from a text file into a database table.&lt;/div&gt;</summary>
		<author><name>Dondi</name></author>	</entry>

	</feed>