This is a valid Atom 1.0 feed.
This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
... r.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2 ...
^
... r.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2 ...
^
... Resources</title><subtitle type='html'></subtitle><link rel='http://sch ...
^
... eds/1083017836179388179/posts/default'/><link rel='alternate' type='text ...
^
... /ns#" term="ITC220"/><title type='text'></title><content type='html'>< ...
^
... -sauce-crust-sides-size.html' title=''/><author><name>spconger</name><ur ...
^
line 747, column 0: (5 occurrences) [help]
</content><link rel='replies' type='application/atom+xml' href='http://conge ...
line 747, column 0: (5 occurrences) [help]
</content><link rel='replies' type='application/atom+xml' href='http://conge ...
line 747, column 0: (5 occurrences) [help]
</content><link rel='replies' type='application/atom+xml' href='http://conge ...
<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1083017836179388179</id><updated>2024-03-19T04:10:30.001-07:00</updated><category term="ITC222"/><category term="ITC110"/><category term="ITC220"/><category term="ITC172"/><category term="ITC255"/><category term="ITC224"/><category term="ITC115"/><category term="ITC226"/><category term="ITC162"/><category term="Java"/><category term="ITC 172"/><category term="ITC285"/><category term="Trends"/><category term="Android"/><category term="IT 225"/><category term="ITC299"/><title type='text'>ITC Resources</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default?start-index=26&max-results=25'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>913</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-877370385240361314</id><published>2020-08-09T10:41:00.003-07:00</published><updated>2020-08-09T10:41:36.893-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IT 225"/><title type='text'>Code from Testing Video</title><content type='html'><p>Here is the customer class code:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">Customer</span>():
<span style="color: #888888">#constructor</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__init__</span>(<span style="color: #007020">self</span>, <span style="color: #007020">id</span>, name, email, rewards):
<span style="color: #007020">self</span><span style="color: #333333">.</span>id<span style="color: #333333">=</span><span style="color: #007020">id</span>
<span style="color: #007020">self</span><span style="color: #333333">.</span>name<span style="color: #333333">=</span>name
<span style="color: #007020">self</span><span style="color: #333333">.</span>email<span style="color: #333333">=</span>email
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards<span style="color: #333333">=</span>rewards
<span style="color: #888888">#gets for fields</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getId</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>id
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getName</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>name
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getEmail</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>email
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getRewards</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>rewards
<span style="color: #888888">#methods to add or use rewards</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">addReward</span>(<span style="color: #007020">self</span>, points):
<span style="color: #888888">#make sure points is an integer</span>
points<span style="color: #333333">=</span><span style="color: #007020">int</span>(points)
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards <span style="color: #333333">+=</span> points
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">useRewards</span>(<span style="color: #007020">self</span>, points):
points<span style="color: #333333">=</span><span style="color: #007020">int</span>(points)
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards <span style="color: #333333">=</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>rewards <span style="color: #333333">-</span> points
<span style="color: #888888"># class string method</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__str__</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>name <span style="color: #333333">+</span> <span style="background-color: #fff0f0">&#39; &#39;</span> <span style="color: #333333">+</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>email
</pre></div>
<p>Here is the code for the test.py:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">unittest</span>
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">customer</span> <span style="color: #008800; font-weight: bold">import</span> Customer
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">TestCustomer</span>(unittest<span style="color: #333333">.</span>TestCase):
<span style="color: #888888">#set up an instance of the class</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setUp</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">=</span>Customer(<span style="color: #0000DD; font-weight: bold">123</span>,<span style="background-color: #fff0f0">&#39;Bret Brown&#39;</span>, <span style="background-color: #fff0f0">&#39;bb@gmail.com&#39;</span>, <span style="color: #0000DD; font-weight: bold">100</span>)
<span style="color: #888888">#test the get methods</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_Id</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>getId(), <span style="color: #0000DD; font-weight: bold">123</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_name</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>getName(),<span style="background-color: #fff0f0">&#39;Bret Brown&#39;</span> )
<span style="color: #888888"># test the rewards</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_AddReward</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>addReward(<span style="color: #0000DD; font-weight: bold">50</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>getRewards(), <span style="color: #0000DD; font-weight: bold">150</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_UseReward</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>useRewards(<span style="color: #0000DD; font-weight: bold">50</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>getRewards(), <span style="color: #0000DD; font-weight: bold">50</span>)
<span style="color: #888888">#other tests</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_Addreward2</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>addReward(<span style="color: #0000DD; font-weight: bold">50</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertGreater(<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>getRewards(), <span style="color: #0000DD; font-weight: bold">100</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_addRewards3</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>addReward(<span style="color: #6600EE; font-weight: bold">50.5</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>c<span style="color: #333333">.</span>getRewards(), <span style="color: #0000DD; font-weight: bold">150</span>)
<span style="color: #888888"># test class string method</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_ToString</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">str</span>(<span style="color: #007020">self</span><span style="color: #333333">.</span>c), <span style="background-color: #fff0f0">&#39;Bret Brown bb@gmail.com&#39;</span>)
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/877370385240361314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2020/08/code-from-testing-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/877370385240361314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/877370385240361314'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2020/08/code-from-testing-video.html' title='Code from Testing Video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1336463177424312350</id><published>2020-01-08T11:46:00.001-08:00</published><updated>2020-01-08T11:46:12.014-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'></title><content type='html'><pre>
toppings, sauce, crust, sides, size,
customer, price, drinks, employees (not whole human resource),
delivery methods, (office space leasing)
Customer name, address, payment method, phone, email,
order (ovens) (monthly sales) SaleDates,
Inventory, boxes, promotions discounts, nutrition,
employee number, schedule, tips, opening closing times,location,
products, customer Loyality points, Vendors, equipment
maintenance and schedules.
wastage--menu--uniforms
</pre></content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1336463177424312350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2020/01/toppings-sauce-crust-sides-size.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1336463177424312350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1336463177424312350'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2020/01/toppings-sauce-crust-sides-size.html' title=''/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-967638393225220583</id><published>2019-11-25T13:23:00.000-08:00</published><updated>2019-11-25T13:24:03.490-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>Security Login, Posgresql</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">/*</span>
<span style="color: #888888">Permision consist of SQL commands--</span>
<span style="color: #888888">SELECT, INSERT, UPDATE, EXCECUTE, DELETE, DROP. CREATE, ALTER</span>
<span style="color: #888888">Anything that is not granted is denied</span>
<span style="color: #888888">A user should be given all the permissions necessary</span>
<span style="color: #888888">to do what they need to do in the database</span>
<span style="color: #888888">But no more.</span>
<span style="color: #888888">*/</span>
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">role</span> tenantrole;
<span style="color: #008800; font-weight: bold">Grant</span> <span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #008800; font-weight: bold">on</span> <span style="color: #AA6600">&quot;Apartment&quot;</span> <span style="color: #008800; font-weight: bold">to</span> tenantrole;
<span style="color: #008800; font-weight: bold">Grant</span> <span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #008800; font-weight: bold">on</span> <span style="color: #AA6600">&quot;Lease&quot;</span> <span style="color: #008800; font-weight: bold">to</span> tenantrole;
<span style="color: #008800; font-weight: bold">Grant</span> <span style="color: #008800; font-weight: bold">UPDATE</span> <span style="color: #008800; font-weight: bold">on</span> <span style="color: #AA6600">&quot;Tenant&quot;</span> <span style="color: #008800; font-weight: bold">to</span> Tenantrole;
<span style="color: #008800; font-weight: bold">Grant</span> <span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #008800; font-weight: bold">on</span> <span style="color: #AA6600">&quot;Tenant&quot;</span> <span style="color: #008800; font-weight: bold">to</span> tenantrole;
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">role</span> johnsmith <span style="color: #008800; font-weight: bold">with</span> password <span style="background-color: #fff0f0">&#39;password&#39;</span>;
<span style="color: #008800; font-weight: bold">Grant</span> tenantrole <span style="color: #008800; font-weight: bold">to</span> johnsmith;
<span style="color: #008800; font-weight: bold">Alter</span> <span style="color: #008800; font-weight: bold">role</span> johnsmith <span style="color: #008800; font-weight: bold">with</span> login;
</pre></div>
<p>The test after logging in as johnsmith</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> <span style="color: #AA6600">&quot;Apartment&quot;</span>;
<span style="color: #008800; font-weight: bold">Update</span> <span style="color: #AA6600">&quot;Apartment&quot;</span>
<span style="color: #008800; font-weight: bold">SET</span> <span style="color: #AA6600">&quot;Bedrooms&quot;</span><span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">3</span>
<span style="color: #008800; font-weight: bold">WHERE</span> <span style="color: #AA6600">&quot;ApartmentNumber&quot;</span><span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">102</span>;
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/967638393225220583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/11/security-login-posgresql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/967638393225220583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/967638393225220583'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/11/security-login-posgresql.html' title='Security Login, Posgresql'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7345036583756536270</id><published>2019-11-23T12:21:00.001-08:00</published><updated>2019-11-23T12:21:15.868-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>SQL for Postgresql</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">/*</span>
<span style="color: #888888">List all the tenants.</span>
<span style="color: #888888">List all the current maintenance requests.</span>
<span style="color: #888888">Which apartments are currently occupied? join apartment and lease</span>
<span style="color: #888888">Which apartments are empty? Left outer join with Apartment and Lease</span>
<span style="color: #888888">Update maintenance request 2 to give it a completion date of today.</span>
<span style="color: #888888">Insert a new tenant: Tammy Benedict, tbenedict@gmail.com, phone: 2065551200. She has no sub tenants</span>
<span style="color: #888888">Add a new 6 month lease starting today on apartment 205, standard deposit, no pets</span>
<span style="color: #888888">Record her first rent payment</span>
<span style="color: #888888">Turn in the SQL and screenshots of the the answers</span>
<span style="color: #888888">You may have to put the column and table names in double quotes if you made your database</span>
<span style="color: #888888">from lucidcharts</span>
<span style="color: #888888">*/</span>
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> <span style="color: #AA6600">&quot;person&quot;</span>;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> donation;
<span style="color: #008800; font-weight: bold">Select</span> personlastname, personfirstname, personaddressStreet, personaddressCity
<span style="color: #008800; font-weight: bold">From</span> person
<span style="color: #008800; font-weight: bold">inner</span> <span style="color: #008800; font-weight: bold">join</span> personaddress
<span style="color: #008800; font-weight: bold">on</span> person.personkey<span style="color: #333333">=</span>personaddress.personkey;
<span style="color: #888888">--outer join</span>
<span style="color: #008800; font-weight: bold">Select</span> granttypename, grantapplication.granttypekey
<span style="color: #008800; font-weight: bold">From</span> granttype
<span style="color: #008800; font-weight: bold">Left</span> <span style="color: #008800; font-weight: bold">outer</span> <span style="color: #008800; font-weight: bold">join</span> grantapplication
<span style="color: #008800; font-weight: bold">On</span> granttype.granttypekey<span style="color: #333333">=</span>grantapplication.grantTypekey
<span style="color: #008800; font-weight: bold">Where</span> grantapplication.granttypekey <span style="color: #008800; font-weight: bold">is</span> <span style="color: #008800; font-weight: bold">null</span>;
<span style="color: #888888">--updates are to change existing records</span>
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> person <span style="color: #008800; font-weight: bold">where</span> personkey<span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">2</span>;
<span style="color: #008800; font-weight: bold">Update</span> person
<span style="color: #008800; font-weight: bold">Set</span> Personlastname<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;Caroll&#39;</span>,
personemail<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;lindaCaroll@gmail.com&#39;</span>
<span style="color: #008800; font-weight: bold">WHERE</span> personkey<span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">2</span>;
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> person(personlastname, personfirstname, personemail, personprimaryphone, persondateadded)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="background-color: #fff0f0">&#39;Nelson&#39;</span>,<span style="background-color: #fff0f0">&#39;Tom&#39;</span>, <span style="background-color: #fff0f0">&#39;tom.nelson@msn.com&#39;</span>, <span style="background-color: #fff0f0">&#39;2065553233&#39;</span>, <span style="color: #008800; font-weight: bold">current_date</span>);
<span style="color: #008800; font-weight: bold">select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> person <span style="color: #008800; font-weight: bold">where</span> personlastname<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;Nelson&#39;</span>;
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> Donation(personkey, donationamount, donationDate)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="color: #0000DD; font-weight: bold">134</span>, <span style="color: #0000DD; font-weight: bold">500</span>.<span style="color: #0000DD; font-weight: bold">00</span>, <span style="color: #008800; font-weight: bold">current_date</span>);
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> donation <span style="color: #008800; font-weight: bold">where</span> personkey <span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">134</span>;
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7345036583756536270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/11/sql-for-postgresql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7345036583756536270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7345036583756536270'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/11/sql-for-postgresql.html' title='SQL for Postgresql'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4519191640354680274</id><published>2019-11-16T14:47:00.000-08:00</published><updated>2019-11-16T14:47:01.318-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC110"/><title type='text'>Code for Assignment 8 Video</title><content type='html'><p>Customer Class</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">Class called Customer</span>
<span style="color: #DD4422">Every customer has a name,</span>
<span style="color: #DD4422">number, email, phone and they</span>
<span style="color: #DD4422">can collect rewards points</span>
<span style="color: #DD4422">An object is collection of related</span>
<span style="color: #DD4422">functions. They all relate</span>
<span style="color: #DD4422">to one topic like customer.</span>
<span style="color: #DD4422">The idea is to make it easier</span>
<span style="color: #DD4422">to manage complex code</span>
<span style="color: #DD4422">by breaking it into the kinds</span>
<span style="color: #DD4422">of objects that actually make up</span>
<span style="color: #DD4422">the contents of the program</span>
<span style="color: #DD4422">abstraction</span>
<span style="color: #DD4422">encapsulation</span>
<span style="color: #DD4422">inheritance</span>
<span style="color: #DD4422">polymorphism</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">Customer</span>():
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__init__</span>(<span style="color: #007020">self</span>, number, name, phone, email, rewards):
<span style="color: #007020">self</span><span style="color: #333333">.</span>number<span style="color: #333333">=</span>number
<span style="color: #007020">self</span><span style="color: #333333">.</span>name<span style="color: #333333">=</span>name
<span style="color: #007020">self</span><span style="color: #333333">.</span>phone<span style="color: #333333">=</span>phone
<span style="color: #007020">self</span><span style="color: #333333">.</span>email<span style="color: #333333">=</span>email
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards<span style="color: #333333">=</span>rewards
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setPhone</span>(<span style="color: #007020">self</span>, phone):
<span style="color: #007020">self</span><span style="color: #333333">.</span>phone<span style="color: #333333">=</span>phone
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getPhone</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>phone
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getName</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>name
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getEmail</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>email
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getRewards</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>rewards
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">addRewards</span>(<span style="color: #007020">self</span>, points):
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards <span style="color: #333333">+=</span> points
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">useRewards</span>(<span style="color: #007020">self</span>, points):
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards <span style="color: #333333">=</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>rewards<span style="color: #333333">-</span>points
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__str__</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">str</span>(<span style="color: #007020">self</span><span style="color: #333333">.</span>number) <span style="color: #333333">+</span> <span style="background-color: #fff0f0">&quot;, &quot;</span> <span style="color: #333333">+</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>name
</pre></div>
<p>Item Class</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">class item</span>
<span style="color: #DD4422">It will represent an item to purchase</span>
<span style="color: #DD4422">It will have a number, a name and a price</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">Item</span>():
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__init__</span>(<span style="color: #007020">self</span>, number, name, price):
<span style="color: #007020">self</span><span style="color: #333333">.</span>number<span style="color: #333333">=</span>number
<span style="color: #007020">self</span><span style="color: #333333">.</span>name<span style="color: #333333">=</span>name
<span style="color: #007020">self</span><span style="color: #333333">.</span>price<span style="color: #333333">=</span>price
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getNumber</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>number
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getName</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>name
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getPrice</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>price
</pre></div>
<p>Purchase Class</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">Purchase class</span>
<span style="color: #DD4422">to show purchase of an item</span>
<span style="color: #DD4422">it will have a list of items</span>
<span style="color: #DD4422">and methods for</span>
<span style="color: #DD4422">Totaling the purchase</span>
<span style="color: #DD4422">and totaling the points</span>
<span style="color: #DD4422">str method that outputs</span>
<span style="color: #DD4422">basically a receipt</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">Purchase</span>():
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__init__</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>items<span style="color: #333333">=</span>[]
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">addItem</span>(<span style="color: #007020">self</span>, item):
<span style="color: #007020">self</span><span style="color: #333333">.</span>items<span style="color: #333333">.</span>append(item)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">totalItems</span>(<span style="color: #007020">self</span>):
total<span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">0</span>
<span style="color: #008800; font-weight: bold">for</span> item <span style="color: #000000; font-weight: bold">in</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>items:
total <span style="color: #333333">+=</span> item<span style="color: #333333">.</span>price
<span style="color: #008800; font-weight: bold">return</span> total
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">totalPoints</span>(<span style="color: #007020">self</span>):
total<span style="color: #333333">=</span><span style="color: #007020">self</span><span style="color: #333333">.</span>totalItems()
points<span style="color: #333333">=</span><span style="color: #007020">int</span>(total)
<span style="color: #008800; font-weight: bold">return</span> points
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__str__</span>(<span style="color: #007020">self</span>):
receipt<span style="color: #333333">=</span><span style="background-color: #fff0f0">&quot;&quot;</span>
<span style="color: #008800; font-weight: bold">for</span> item <span style="color: #000000; font-weight: bold">in</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>items:
receipt <span style="color: #333333">=</span>receipt <span style="color: #333333">+</span> item<span style="color: #333333">.</span>name <span style="color: #333333">+</span><span style="background-color: #fff0f0">&quot;</span><span style="color: #666666; font-weight: bold; background-color: #fff0f0">\t\t</span><span style="background-color: #fff0f0">&quot;</span> <span style="color: #333333">+</span> <span style="color: #007020">str</span>(item<span style="color: #333333">.</span>price) <span style="color: #333333">+</span> <span style="background-color: #fff0f0">&quot;</span><span style="color: #666666; font-weight: bold; background-color: #fff0f0">\n</span><span style="background-color: #fff0f0">&quot;</span>
total <span style="color: #333333">=</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>totalItems()
receipt<span style="color: #333333">=</span>receipt <span style="color: #333333">+</span> <span style="background-color: #fff0f0">&quot;</span><span style="color: #666666; font-weight: bold; background-color: #fff0f0">\t\t</span><span style="background-color: #fff0f0">&quot;</span> <span style="color: #333333">+</span> <span style="color: #007020">str</span>(total)
<span style="color: #008800; font-weight: bold">return</span> receipt
</pre></div>
<p>Main</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">customer</span> <span style="color: #008800; font-weight: bold">import</span> Customer
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">item</span> <span style="color: #008800; font-weight: bold">import</span> Item
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">purchase</span> <span style="color: #008800; font-weight: bold">import</span> Purchase
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
cust<span style="color: #333333">=</span>Customer(<span style="color: #0000DD; font-weight: bold">123</span>, <span style="background-color: #fff0f0">&#39;Steve&#39;</span>, <span style="background-color: #fff0f0">&#39;steve@spconger.com&#39;</span>, <span style="background-color: #fff0f0">&#39;2065551234&#39;</span>, <span style="color: #0000DD; font-weight: bold">0</span>)
purch <span style="color: #333333">=</span> Purchase()
cont<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;y&#39;</span>
<span style="color: #008800; font-weight: bold">while</span> cont<span style="color: #333333">==</span><span style="background-color: #fff0f0">&#39;y&#39;</span>:
itemNumber<span style="color: #333333">=</span><span style="color: #007020">int</span>(<span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&#39;Enter item Number. &#39;</span>))
itemName<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Enter item name &quot;</span>)
itemPrice<span style="color: #333333">=</span><span style="color: #007020">float</span>(<span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Enter item price &quot;</span>))
item<span style="color: #333333">=</span>Item(itemNumber, itemName, itemPrice)
purch<span style="color: #333333">.</span>addItem(item)
cont<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Add another item? y to continue. &quot;</span> )
cont<span style="color: #333333">=</span>cont<span style="color: #333333">.</span>lower()
<span style="color: #007020">print</span>(purch)
cust<span style="color: #333333">.</span>addRewards(purch<span style="color: #333333">.</span>totalPoints())
<span style="color: #007020">print</span> (<span style="background-color: #fff0f0">&quot;your total rewards are&quot;</span>, cust<span style="color: #333333">.</span>getRewards())
main()
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4519191640354680274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/11/code-for-assignment-8-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4519191640354680274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4519191640354680274'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/11/code-for-assignment-8-video.html' title='Code for Assignment 8 Video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2560684087430995109</id><published>2019-11-10T12:28:00.003-08:00</published><updated>2019-11-10T12:28:56.849-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC110"/><title type='text'>Customer and customer test code from peer 8 video</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">Class called Customer</span>
<span style="color: #DD4422">Every customer has a name,</span>
<span style="color: #DD4422">number, email, phone and they</span>
<span style="color: #DD4422">can collect rewards points</span>
<span style="color: #DD4422">An object is collection of related</span>
<span style="color: #DD4422">functions. They all relate</span>
<span style="color: #DD4422">to one topic like customer.</span>
<span style="color: #DD4422">The idea is to make it easier</span>
<span style="color: #DD4422">to manage complex code</span>
<span style="color: #DD4422">by breaking it into the kinds</span>
<span style="color: #DD4422">of objects that actually make up</span>
<span style="color: #DD4422">the contents of the program</span>
<span style="color: #DD4422">abstraction</span>
<span style="color: #DD4422">encapsulation</span>
<span style="color: #DD4422">inheritance</span>
<span style="color: #DD4422">polymorphism</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">Customer</span>():
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__init__</span>(<span style="color: #007020">self</span>, number, name, phone, email, rewards):
<span style="color: #007020">self</span><span style="color: #333333">.</span>number<span style="color: #333333">=</span>number
<span style="color: #007020">self</span><span style="color: #333333">.</span>name<span style="color: #333333">=</span>name
<span style="color: #007020">self</span><span style="color: #333333">.</span>phone<span style="color: #333333">=</span>phone
<span style="color: #007020">self</span><span style="color: #333333">.</span>email<span style="color: #333333">=</span>email
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards<span style="color: #333333">=</span>rewards
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setPhone</span>(<span style="color: #007020">self</span>, phone):
<span style="color: #007020">self</span><span style="color: #333333">.</span>phone<span style="color: #333333">=</span>phone
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getPhone</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>phone
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getName</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>name
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getEmail</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>email
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getRewards</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>rewards
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">addRewards</span>(<span style="color: #007020">self</span>, points):
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards <span style="color: #333333">+=</span> points
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">useRewards</span>(<span style="color: #007020">self</span>, points):
<span style="color: #007020">self</span><span style="color: #333333">.</span>rewards <span style="color: #333333">=</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>rewards<span style="color: #333333">-</span>points
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__str__</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">str</span>(<span style="color: #007020">self</span><span style="color: #333333">.</span>number) <span style="color: #333333">+</span> <span style="background-color: #fff0f0">&quot;, &quot;</span> <span style="color: #333333">+</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>name
</pre></div>
<p>Customer test</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">customer</span> <span style="color: #008800; font-weight: bold">import</span> Customer
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
c1 <span style="color: #333333">=</span> Customer(<span style="color: #0000DD; font-weight: bold">123</span>, <span style="background-color: #fff0f0">&#39;Joe Smith&#39;</span>, <span style="background-color: #fff0f0">&#39;2065551234&#39;</span>, <span style="background-color: #fff0f0">&#39;js@gmail.com&#39;</span>, <span style="color: #0000DD; font-weight: bold">10</span>)
<span style="color: #007020">print</span>(c1)
c1<span style="color: #333333">.</span>addRewards(<span style="color: #0000DD; font-weight: bold">20</span>)
<span style="color: #007020">print</span>(c1<span style="color: #333333">.</span>getRewards())
c1<span style="color: #333333">.</span>useRewards(<span style="color: #0000DD; font-weight: bold">13</span>)
<span style="color: #007020">print</span>(c1<span style="color: #333333">.</span>getRewards())
<span style="color: #007020">print</span>(c1<span style="color: #333333">.</span>getEmail())
c2<span style="color: #333333">=</span>Customer(<span style="color: #0000DD; font-weight: bold">234</span>, <span style="background-color: #fff0f0">&#39;Lynn Jones&#39;</span>, <span style="background-color: #fff0f0">&#39;2065553456&#39;</span>, <span style="background-color: #fff0f0">&#39;Lynn@gamail.com&#39;</span>,<span style="color: #0000DD; font-weight: bold">100</span>)
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;******************&quot;</span>)
<span style="color: #007020">print</span>(c1)
<span style="color: #007020">print</span>()
<span style="color: #007020">print</span>(c2)
main()
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2560684087430995109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/11/customer-and-customer-test-code-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2560684087430995109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2560684087430995109'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/11/customer-and-customer-test-code-from.html' title='Customer and customer test code from peer 8 video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-4092533452942129338</id><published>2019-10-28T14:40:00.002-07:00</published><updated>2019-10-28T14:40:54.846-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>Intro to MySQL SQL</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%">Use Sakila;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> actor;
<span style="color: #008800; font-weight: bold">Select</span> first_name, last_name <span style="color: #008800; font-weight: bold">from</span> actor;
<span style="color: #008800; font-weight: bold">Select</span> last_name, first_name <span style="color: #008800; font-weight: bold">from</span> actor
<span style="color: #008800; font-weight: bold">order</span> <span style="color: #008800; font-weight: bold">by</span> last_name;
<span style="color: #008800; font-weight: bold">Select</span> last_name, first_name <span style="color: #008800; font-weight: bold">from</span> actor
<span style="color: #008800; font-weight: bold">order</span> <span style="color: #008800; font-weight: bold">by</span> last_name <span style="color: #008800; font-weight: bold">Desc</span>;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Address;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Address <span style="color: #008800; font-weight: bold">where</span> district <span style="color: #333333">=</span> <span style="background-color: #fff0f0">&#39;California&#39;</span>;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Customer;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Customer <span style="color: #008800; font-weight: bold">where</span> Create_date <span style="color: #333333">&gt;</span><span style="background-color: #fff0f0">&#39;2006-02-14&#39;</span>;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> payment;
<span style="color: #008800; font-weight: bold">Select</span> rental_id, amount <span style="color: #008800; font-weight: bold">from</span> payment
<span style="color: #008800; font-weight: bold">where</span> amount <span style="color: #333333">&gt;</span> <span style="color: #0000DD; font-weight: bold">5</span>;
<span style="color: #888888">/*join tables */</span>
<span style="color: #008800; font-weight: bold">Select</span> first_name, Last_name, Address, district
<span style="color: #008800; font-weight: bold">from</span> customer
<span style="color: #008800; font-weight: bold">inner</span> <span style="color: #008800; font-weight: bold">join</span> address
<span style="color: #008800; font-weight: bold">on</span> customer.address_id<span style="color: #333333">=</span>address.address_id
<span style="color: #008800; font-weight: bold">where</span> district<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;California&#39;</span>;
<span style="color: #008800; font-weight: bold">Select</span> first_name, Last_name, Address, city, district
<span style="color: #008800; font-weight: bold">from</span> customer
<span style="color: #008800; font-weight: bold">inner</span> <span style="color: #008800; font-weight: bold">join</span> address
<span style="color: #008800; font-weight: bold">on</span> customer.address_id<span style="color: #333333">=</span>address.address_id
<span style="color: #008800; font-weight: bold">inner</span> <span style="color: #008800; font-weight: bold">join</span> City
<span style="color: #008800; font-weight: bold">on</span> city.city_id <span style="color: #333333">=</span> address.city_id
<span style="color: #008800; font-weight: bold">where</span> district<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;California&#39;</span>;
<span style="color: #888888">/*insert new records */</span>
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> store;
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> customer(store_id, first_name, last_name,
address_id, active, create_date, last_update)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="color: #0000DD; font-weight: bold">1</span>,<span style="background-color: #fff0f0">&#39;Jennifer&#39;</span>, <span style="background-color: #fff0f0">&#39;Juniper&#39;</span>, <span style="color: #0000DD; font-weight: bold">1</span>,<span style="color: #0000DD; font-weight: bold">1</span>, <span style="color: #008800; font-weight: bold">current_timestamp</span>, <span style="color: #008800; font-weight: bold">current_timestamp</span>);
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> staff;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> customer;
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> rental(rental_date, Inventory_id, Customer_id, staff_id, last_update)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="color: #008800; font-weight: bold">current_timestamp</span>, <span style="color: #0000DD; font-weight: bold">100</span>, <span style="color: #0000DD; font-weight: bold">600</span>, <span style="color: #0000DD; font-weight: bold">2</span>, <span style="color: #008800; font-weight: bold">current_timestamp</span>);
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Rental <span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">by</span> rental_id <span style="color: #008800; font-weight: bold">desc</span>;
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/4092533452942129338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/10/intro-to-mysql-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4092533452942129338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/4092533452942129338'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/10/intro-to-mysql-sql.html' title='Intro to MySQL SQL'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1764283062320320611</id><published>2019-10-28T13:58:00.001-07:00</published><updated>2019-10-28T13:58:18.683-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC110"/><title type='text'>if and while blocks</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">a=5</span>
<span style="color: #DD4422">b=10</span>
<span style="color: #DD4422">if a &lt; b:</span>
<span style="color: #DD4422"> print(a, &quot;is smaller thant&quot;, b)</span>
<span style="color: #DD4422">elif a &gt; b:</span>
<span style="color: #DD4422"> print (a, &quot; is bigger than &quot;, b)</span>
<span style="color: #DD4422">else:</span>
<span style="color: #DD4422"> print (a, &quot;is equal to &quot;,b)</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getGrade</span>():
grade<span style="color: #333333">=-</span><span style="color: #0000DD; font-weight: bold">1</span>
<span style="color: #008800; font-weight: bold">while</span> grade <span style="color: #333333">&lt;</span> <span style="color: #0000DD; font-weight: bold">0</span> <span style="color: #000000; font-weight: bold">or</span> grade <span style="color: #333333">&gt;</span> <span style="color: #0000DD; font-weight: bold">100</span>:
grade<span style="color: #333333">=</span><span style="color: #007020">int</span>(<span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Enter a grade between 0 and 100 &quot;</span>))
<span style="color: #888888">#if grade &lt; 0 or grade &gt; 100:</span>
<span style="color: #888888">#grade=-1 </span>
<span style="color: #008800; font-weight: bold">return</span> grade
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">evaluateGrade</span>():
g <span style="color: #333333">=</span> getGrade()
<span style="color: #888888">#if g == -1:</span>
<span style="color: #888888">#print (&quot;Invalid Grade&quot;)</span>
<span style="color: #888888">#return</span>
<span style="color: #008800; font-weight: bold">if</span> g <span style="color: #333333">&gt;</span> <span style="color: #0000DD; font-weight: bold">90</span>:
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;you did great&quot;</span>)
<span style="color: #008800; font-weight: bold">elif</span> g <span style="color: #333333">&gt;</span> <span style="color: #0000DD; font-weight: bold">80</span>:
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot; you did good&quot;</span>)
<span style="color: #008800; font-weight: bold">elif</span> g <span style="color: #333333">&gt;</span> <span style="color: #0000DD; font-weight: bold">70</span>:
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;you passed&quot;</span>)
<span style="color: #008800; font-weight: bold">else</span>:
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;Sorry, you failed.&quot;</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
choice<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;y&#39;</span>
<span style="color: #008800; font-weight: bold">while</span> choice <span style="color: #333333">==</span> <span style="background-color: #fff0f0">&#39;y&#39;</span>:
evaluateGrade()
choice<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;y to continue&quot;</span>)
choice<span style="color: #333333">.</span>lower()
main()
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1764283062320320611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/10/if-and-while-blocks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1764283062320320611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1764283062320320611'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/10/if-and-while-blocks.html' title='if and while blocks'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2515226086869795676</id><published>2019-10-08T13:51:00.001-07:00</published><updated>2019-10-08T13:51:26.706-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC110"/><title type='text'>Code from chapter 6 video</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">Functions divide code into blocks.</span>
<span style="color: #DD4422">Each function should do one thing.</span>
<span style="color: #DD4422">Functions make it easier to debug and manage</span>
<span style="color: #DD4422">program flow.</span>
<span style="color: #DD4422">A function can just execute its code and be done.</span>
<span style="color: #DD4422">A function can take in parameters to work with.</span>
<span style="color: #DD4422">A function can return a value.</span>
<span style="color: #DD4422">We are going to do a very simple program to calculate area</span>
<span style="color: #DD4422">this requires the following steps</span>
<span style="color: #DD4422">1. print out of what the program does</span>
<span style="color: #DD4422">2. get the length and width of the area in feet</span>
<span style="color: #DD4422">3. calculate the area</span>
<span style="color: #DD4422">4. Output the results</span>
<span style="color: #DD4422">Each step will be a separate function.</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">intro</span>():
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;This program calculates area&quot;</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getLength</span>():
length<span style="color: #333333">=</span><span style="color: #007020">eval</span>(<span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;enter the length: &quot;</span>))
<span style="color: #008800; font-weight: bold">return</span> length
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getWidth</span>():
width<span style="color: #333333">=</span><span style="color: #007020">eval</span>(<span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Enter the width: &quot;</span>))
<span style="color: #008800; font-weight: bold">return</span> width
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">calculateArea</span>():
l<span style="color: #333333">=</span>getLength()
w<span style="color: #333333">=</span>getWidth()
a<span style="color: #333333">=</span>l <span style="color: #333333">*</span> w
outputArea(a)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">outputArea</span>(area):
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;the area is&quot;</span>, area)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
intro()
calculateArea()
main()
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2515226086869795676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/10/code-from-chapter-6-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2515226086869795676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2515226086869795676'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/10/code-from-chapter-6-video.html' title='Code from chapter 6 video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8824853103583692640</id><published>2019-10-08T12:10:00.002-07:00</published><updated>2019-10-08T12:10:32.033-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC110"/><title type='text'>Code from chapter 5 Video</title><content type='html'><p>Here is the console interactive session </p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32</span>
<span style="color: #888888">Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license()&quot; for more information.</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #888888">#Chapter 5 take IV</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #888888">#strings</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #888888">#lists of characters</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>greeting<span style="color: #333333">=</span><span style="background-color: #fff0f0">&quot;Hello&quot;</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #007020">type</span>(greeting)
<span style="color: #888888">&lt;class &#39;str&#39;&gt;</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>number<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;17&#39;</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #007020">type</span>(number)
<span style="color: #888888">&lt;class &#39;str&#39;&gt;</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>[greeting[<span style="color: #0000DD; font-weight: bold">0</span>])
<span style="color: #888888">SyntaxError: invalid syntax</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(greeting[<span style="color: #0000DD; font-weight: bold">0</span>])
<span style="color: #888888">H</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(greeting[<span style="color: #0000DD; font-weight: bold">4</span>])
<span style="color: #888888">o</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(greeting[<span style="color: #0000DD; font-weight: bold">2</span>:<span style="color: #0000DD; font-weight: bold">3</span>])
<span style="color: #888888">l</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(greeting[<span style="color: #0000DD; font-weight: bold">2</span>:<span style="color: #0000DD; font-weight: bold">4</span>})
<span style="color: #888888">SyntaxError: invalid syntax</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(greeting[<span style="color: #0000DD; font-weight: bold">2</span>:<span style="color: #0000DD; font-weight: bold">4</span>])
<span style="color: #888888">ll</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(greeting[:<span style="color: #0000DD; font-weight: bold">4</span>])
<span style="color: #888888">Hell</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #007020">len</span>(greeting)
<span style="color: #888888">5</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">for</span> ch <span style="color: #000000; font-weight: bold">in</span> greeting:
<span style="color: #888888"> print(ch)</span>
<span style="color: #888888">H</span>
<span style="color: #888888">e</span>
<span style="color: #888888">l</span>
<span style="color: #888888">l</span>
<span style="color: #888888">o</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>
<span style="color: #888888">====== RESTART: C:/Users/SteveConger/Documents/PythonFiles/username.py ======</span>
<span style="color: #888888">This program generates user names</span>
<span style="color: #888888">enter your first name: Steve</span>
<span style="color: #888888">enter your last name: Conger</span>
<span style="color: #888888">Your user name is SConger</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>
<span style="color: #888888">====== RESTART: C:/Users/SteveConger/Documents/PythonFiles/username.py ======</span>
<span style="color: #888888">This program generates user names</span>
<span style="color: #888888">enter your first name: Steve</span>
<span style="color: #888888">enter your last name: Robertson</span>
<span style="color: #888888">Your user name is sroberts</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #888888">#page 148 string functons</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #007020">ord</span>(a)
<span style="color: #0044DD">Traceback (most recent call last):</span>
File <span style="color: #007020">&quot;&lt;pyshell#19&gt;&quot;</span>, line <span style="color: #6600EE; font-weight: bold">1</span>, in &lt;module&gt;
<span style="color: #007020">ord</span>(a)
<span style="color: #FF0000">NameError</span>: name &#39;a&#39; is not defined
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #007020">ord</span>(<span style="background-color: #fff0f0">&quot;a&quot;</span>)
<span style="color: #888888">97</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #007020">ord</span>(<span style="background-color: #fff0f0">&quot;A&quot;</span>)
<span style="color: #888888">65</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #007020">chr</span>(<span style="color: #0000DD; font-weight: bold">97</span>)
<span style="color: #888888">&#39;a&#39;</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>weekdays<span style="color: #333333">=</span>[<span style="background-color: #fff0f0">&quot;Mon&quot;</span>, <span style="background-color: #fff0f0">&quot;Tue&quot;</span>, <span style="background-color: #fff0f0">&quot;Wed&quot;</span>, <span style="background-color: #fff0f0">&quot;Thu&quot;</span>, <span style="background-color: #fff0f0">&quot;Fri&quot;</span>, <span style="background-color: #fff0f0">&quot;Sat&quot;</span>, <span style="background-color: #fff0f0">&quot;Sun&quot;</span>]
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(weekdays[<span style="color: #0000DD; font-weight: bold">3</span>])
<span style="color: #888888">Thu</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(weekends[<span style="color: #0000DD; font-weight: bold">3</span><span style="color: #333333">-</span><span style="color: #0000DD; font-weight: bold">1</span>])
<span style="color: #0044DD">Traceback (most recent call last):</span>
File <span style="color: #007020">&quot;&lt;pyshell#25&gt;&quot;</span>, line <span style="color: #6600EE; font-weight: bold">1</span>, in &lt;module&gt;
<span style="color: #008800; font-weight: bold">print</span>(weekends[<span style="color: #0000DD; font-weight: bold">3</span><span style="color: #333333">-</span><span style="color: #0000DD; font-weight: bold">1</span>])
<span style="color: #FF0000">NameError</span>: name &#39;weekends&#39; is not defined
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span> (weekdays[<span style="color: #0000DD; font-weight: bold">3</span><span style="color: #333333">-</span><span style="color: #0000DD; font-weight: bold">1</span>])
<span style="color: #888888">Wed</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>num<span style="color: #333333">=</span><span style="color: #6600EE; font-weight: bold">1234.33939020229202</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;the formatted value = {0000.2f}&quot;</span><span style="color: #333333">.</span>format(num))
<span style="color: #0044DD">Traceback (most recent call last):</span>
File <span style="color: #007020">&quot;&lt;pyshell#28&gt;&quot;</span>, line <span style="color: #6600EE; font-weight: bold">1</span>, in &lt;module&gt;
<span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;the formatted value = {0000.2f}&quot;</span><span style="color: #333333">.</span>format(num))
<span style="color: #FF0000">AttributeError</span>: &#39;float&#39; object has no attribute &#39;2f&#39;
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;the formatted value={0:0.2f}&quot;</span><span style="color: #333333">.</span>format(num))
<span style="color: #888888">the formatted value=1234.34</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;The formatted value=${0.0.2f}&quot;</span><span style="color: #333333">.</span>format(num))
<span style="color: #0044DD">Traceback (most recent call last):</span>
File <span style="color: #007020">&quot;&lt;pyshell#30&gt;&quot;</span>, line <span style="color: #6600EE; font-weight: bold">1</span>, in &lt;module&gt;
<span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;The formatted value=${0.0.2f}&quot;</span><span style="color: #333333">.</span>format(num))
<span style="color: #FF0000">AttributeError</span>: &#39;float&#39; object has no attribute &#39;0&#39;
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;the formatted value=${0:0.2f}&quot;</span>,format(num))
<span style="color: #888888">the formatted value=${0:0.2f} 1234.339390202292</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span><span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;the formatted value=${0:0.2f}&quot;</span><span style="color: #333333">.</span>format(num))
<span style="color: #888888">the formatted value=$1234.34</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>
<span style="color: #888888">====== RESTART: C:/Users/SteveConger/Documents/PythonFiles/userfile.py ======</span>
<span style="color: #888888">this program creates a file of usernames in batch mode</span>
<span style="color: #888888">from a file of names</span>
<span style="color: #888888">Enter the file name with the names: name.txt</span>
<span style="color: #888888">Enter the name of the output file: unames.txt</span>
<span style="color: #0044DD">Traceback (most recent call last):</span>
File <span style="color: #007020">&quot;C:/Users/SteveConger/Documents/PythonFiles/userfile.py&quot;</span>, line <span style="color: #6600EE; font-weight: bold">26</span>, in &lt;module&gt;
main()
File <span style="color: #007020">&quot;C:/Users/SteveConger/Documents/PythonFiles/userfile.py&quot;</span>, line <span style="color: #6600EE; font-weight: bold">12</span>, in main
infile<span style="color: #333333">=</span><span style="color: #007020">open</span>(infileName, <span style="background-color: #fff0f0">&quot;r&quot;</span>)
<span style="color: #FF0000">FileNotFoundError</span>: [Errno 2] No such file or directory: &#39;name.txt&#39;
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>
<span style="color: #888888">====== RESTART: C:/Users/SteveConger/Documents/PythonFiles/userfile.py ======</span>
<span style="color: #888888">this program creates a file of usernames in batch mode</span>
<span style="color: #888888">from a file of names</span>
<span style="color: #888888">Enter the file name with the names: names.txt</span>
<span style="color: #888888">Enter the name of the output file: unames.txt</span>
<span style="color: #0044DD">Traceback (most recent call last):</span>
File <span style="color: #007020">&quot;C:/Users/SteveConger/Documents/PythonFiles/userfile.py&quot;</span>, line <span style="color: #6600EE; font-weight: bold">26</span>, in &lt;module&gt;
main()
File <span style="color: #007020">&quot;C:/Users/SteveConger/Documents/PythonFiles/userfile.py&quot;</span>, line <span style="color: #6600EE; font-weight: bold">19</span>, in main
<span style="color: #008800; font-weight: bold">print</span>(username, <span style="color: #007020">file</span><span style="color: #333333">=</span>outfile)
<span style="color: #FF0000">NameError</span>: name &#39;outfile&#39; is not defined
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>
<span style="color: #888888">====== RESTART: C:/Users/SteveConger/Documents/PythonFiles/userfile.py ======</span>
<span style="color: #888888">this program creates a file of usernames in batch mode</span>
<span style="color: #888888">from a file of names</span>
<span style="color: #888888">Enter the file name with the names: names.txt</span>
<span style="color: #888888">Enter the name of the output file: unames.txt</span>
<span style="color: #888888">the user names have been written to unames.txt</span>
<span style="color: #c65d09; font-weight: bold">&gt;&gt;&gt; </span>
</pre></div>
<p>Here is the first version of the Username program</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">#username.py</span>
<span style="color: #888888">#Steve Conger</span>
<span style="color: #888888">#10/8/2019</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;This program generates user names&quot;</span>)
<span style="color: #888888">#get user first and last names</span>
first<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;enter your first name: &quot;</span>)
last<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;enter your last name: &quot;</span>)
<span style="color: #888888">#concatinate user name first letter of first name</span>
<span style="color: #888888">#first 7 letters of the last name</span>
username<span style="color: #333333">=</span>first[<span style="color: #0000DD; font-weight: bold">0</span>] <span style="color: #333333">+</span> last[:<span style="color: #0000DD; font-weight: bold">7</span>]
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;Your user name is&quot;</span>,username<span style="color: #333333">.</span>lower())
main()
</pre></div>
<p>Here is the file version</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">#create a file of usernames</span>
<span style="color: #888888">#read the file</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;this program creates a file of usernames in batch mode&quot;</span>)
<span style="color: #007020">print</span>(<span style="background-color: #fff0f0">&quot;from a file of names&quot;</span>)
<span style="color: #888888"># get file names</span>
infileName<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Enter the file name with the names: &quot;</span>)
outfileName<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Enter the name of the output file: &quot;</span>)
infile<span style="color: #333333">=</span><span style="color: #007020">open</span>(infileName, <span style="background-color: #fff0f0">&quot;r&quot;</span>)
outfile<span style="color: #333333">=</span><span style="color: #007020">open</span>(outfileName, <span style="background-color: #fff0f0">&quot;w&quot;</span>)
<span style="color: #888888"># loop through the file, process and write</span>
<span style="color: #008800; font-weight: bold">for</span> line <span style="color: #000000; font-weight: bold">in</span> infile:
first, last <span style="color: #333333">=</span> line<span style="color: #333333">.</span>split()
username<span style="color: #333333">=</span>(first[<span style="color: #0000DD; font-weight: bold">0</span>] <span style="color: #333333">+</span> last[:<span style="color: #0000DD; font-weight: bold">7</span>])<span style="color: #333333">.</span>lower()
<span style="color: #007020">print</span>(username, file<span style="color: #333333">=</span>outfile)
infile<span style="color: #333333">.</span>close()
outfile<span style="color: #333333">.</span>close()
<span style="color: #007020">print</span> (<span style="background-color: #fff0f0">&quot;the user names have been written to&quot;</span>, outfileName)
main()
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8824853103583692640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/10/code-from-chapter-5-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8824853103583692640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8824853103583692640'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/10/code-from-chapter-5-video.html' title='Code from chapter 5 Video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-794289962133737763</id><published>2019-10-07T20:15:00.001-07:00</published><updated>2019-10-07T20:15:29.697-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>SQL From video on Data And Entities</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">table</span> topping
(
toppingID <span style="color: #007020">serial</span> <span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span>,
toppingName <span style="color: #007020">text</span>,
toppingPrice <span style="color: #007020">decimal</span>(<span style="color: #0000DD; font-weight: bold">5</span>,<span style="color: #0000DD; font-weight: bold">2</span>)
);
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">table</span> crust
(
crustID <span style="color: #007020">serial</span> <span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span>,
crustName <span style="color: #007020">text</span>,
crustPrice <span style="color: #007020">Decimal</span>(<span style="color: #0000DD; font-weight: bold">5</span>,<span style="color: #0000DD; font-weight: bold">2</span>)
);
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">table</span> pizzasize
(
sizeID <span style="color: #007020">serial</span> <span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span>,
sizeName <span style="color: #007020">text</span>,
sizeBasePrice <span style="color: #007020">decimal</span>(<span style="color: #0000DD; font-weight: bold">5</span>,<span style="color: #0000DD; font-weight: bold">2</span>)
);
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">table</span> pizza
(
pizzaID <span style="color: #007020">serial</span> <span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span>,
crustID <span style="color: #007020">integer</span> <span style="color: #008800; font-weight: bold">references</span> crust(crustID),
sizeID <span style="color: #007020">integer</span> <span style="color: #008800; font-weight: bold">references</span> pizzasize(sizeID)
);
<span style="color: #008800; font-weight: bold">create</span> <span style="color: #008800; font-weight: bold">table</span> pizzatopping
(
pizzaID <span style="color: #007020">integer</span> <span style="color: #008800; font-weight: bold">references</span> pizza(pizzaID),
toppingID <span style="color: #007020">integer</span> <span style="color: #008800; font-weight: bold">references</span> topping(toppingID),
<span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span> (pizzaID, toppingID)
);
<span style="color: #008800; font-weight: bold">create</span> <span style="color: #008800; font-weight: bold">table</span> <span style="color: #AA6600">&quot;order&quot;</span>
(
orderID <span style="color: #007020">serial</span> <span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span>,
orderdate <span style="color: #008800; font-weight: bold">timestamp</span> <span style="color: #008800; font-weight: bold">default</span> <span style="color: #008800; font-weight: bold">current_timestamp</span>
);
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">table</span> orderPizza
(
orderID <span style="color: #007020">integer</span> <span style="color: #008800; font-weight: bold">references</span> <span style="color: #AA6600">&quot;order&quot;</span>(orderID),
pizzaID <span style="color: #007020">integer</span> <span style="color: #008800; font-weight: bold">references</span> pizza(pizzaID),
<span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span> (orderID, pizzaID)
);
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> topping(toppingname, toppingprice)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="background-color: #fff0f0">&#39;pepperoni&#39;</span>, .<span style="color: #0000DD; font-weight: bold">50</span>),
(<span style="background-color: #fff0f0">&#39;olives&#39;</span>, .<span style="color: #0000DD; font-weight: bold">50</span>),
(<span style="background-color: #fff0f0">&#39;pinapple&#39;</span>, .<span style="color: #0000DD; font-weight: bold">50</span>),
(<span style="background-color: #fff0f0">&#39;tomatoes&#39;</span>, .<span style="color: #0000DD; font-weight: bold">30</span>),
(<span style="background-color: #fff0f0">&#39;sausage&#39;</span>, .<span style="color: #0000DD; font-weight: bold">50</span>);
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> pizzasize(sizename, sizebaseprice)
<span style="color: #008800; font-weight: bold">values</span>(<span style="background-color: #fff0f0">&#39;large&#39;</span>, <span style="color: #0000DD; font-weight: bold">15</span>.<span style="color: #0000DD; font-weight: bold">00</span>),
(<span style="background-color: #fff0f0">&#39;medium&#39;</span>, <span style="color: #0000DD; font-weight: bold">13</span>.<span style="color: #0000DD; font-weight: bold">00</span>),
(<span style="background-color: #fff0f0">&#39;small&#39;</span>, <span style="color: #0000DD; font-weight: bold">10</span>.<span style="color: #0000DD; font-weight: bold">00</span>),
(<span style="background-color: #fff0f0">&#39;personal&#39;</span>, <span style="color: #0000DD; font-weight: bold">9</span>.<span style="color: #0000DD; font-weight: bold">00</span>);
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> crust(crustname, crustprice)
<span style="color: #008800; font-weight: bold">values</span>(<span style="background-color: #fff0f0">&#39;regular&#39;</span>, <span style="color: #0000DD; font-weight: bold">0</span>.<span style="color: #0000DD; font-weight: bold">00</span>),
(<span style="background-color: #fff0f0">&#39;deep dish&#39;</span>, <span style="color: #0000DD; font-weight: bold">1</span>.<span style="color: #0000DD; font-weight: bold">00</span>),
(<span style="background-color: #fff0f0">&#39;cheese stuffed&#39;</span>, <span style="color: #0000DD; font-weight: bold">2</span>.<span style="color: #0000DD; font-weight: bold">00</span>);
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> Pizza(crustID, sizeID)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="color: #0000DD; font-weight: bold">1</span>,<span style="color: #0000DD; font-weight: bold">2</span>),
(<span style="color: #0000DD; font-weight: bold">2</span>,<span style="color: #0000DD; font-weight: bold">2</span>);
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> pizzatopping(pizzaid, toppingid)
<span style="color: #008800; font-weight: bold">values</span>(<span style="color: #0000DD; font-weight: bold">1</span>, <span style="color: #0000DD; font-weight: bold">1</span>),
(<span style="color: #0000DD; font-weight: bold">1</span>,<span style="color: #0000DD; font-weight: bold">5</span>),
(<span style="color: #0000DD; font-weight: bold">2</span>, <span style="color: #0000DD; font-weight: bold">2</span>),
(<span style="color: #0000DD; font-weight: bold">2</span>,<span style="color: #0000DD; font-weight: bold">3</span>),
(<span style="color: #0000DD; font-weight: bold">2</span>,<span style="color: #0000DD; font-weight: bold">4</span>);
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> <span style="color: #AA6600">&quot;order&quot;</span>(orderdate)
<span style="color: #008800; font-weight: bold">values</span>(<span style="background-color: #fff0f0">&#39;2019-10-07&#39;</span>);
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> OrderPizza(orderID, PizzaID)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="color: #0000DD; font-weight: bold">1</span>, <span style="color: #0000DD; font-weight: bold">1</span>),
(<span style="color: #0000DD; font-weight: bold">1</span>,<span style="color: #0000DD; font-weight: bold">2</span>);
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Topping;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Crust;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> PizzaSize;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Pizza;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> PizzaTopping;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> <span style="color: #AA6600">&quot;order&quot;</span>;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> Orderpizza;
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/794289962133737763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/10/sql-from-video-on-data-and-entities.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/794289962133737763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/794289962133737763'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/10/sql-from-video-on-data-and-entities.html' title='SQL From video on Data And Entities'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6806726936326987359</id><published>2019-10-02T15:10:00.001-07:00</published><updated>2019-10-02T15:10:04.520-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>ERD for Car Shop Afternoon Class</title><content type='html'><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi57CCY8LyQi4rJA51wBe4wQSzGZdGfSHFc2Zft-G0fyx-o8WQrYyaxpdcMzyZ3gqLzOUrbpkhjeD8CbxQNRptxfdPzRjU5kbqs-Bg9zKw2InotnTfrOgJBKPnRbP1_1h-SADwbSB3IGgdz/s1600/jiffy2.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi57CCY8LyQi4rJA51wBe4wQSzGZdGfSHFc2Zft-G0fyx-o8WQrYyaxpdcMzyZ3gqLzOUrbpkhjeD8CbxQNRptxfdPzRjU5kbqs-Bg9zKw2InotnTfrOgJBKPnRbP1_1h-SADwbSB3IGgdz/s400/jiffy2.png" width="400" height="240" data-original-width="1264" data-original-height="758" /></a></content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6806726936326987359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/10/erd-for-car-shop-afternoon-class.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6806726936326987359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6806726936326987359'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/10/erd-for-car-shop-afternoon-class.html' title='ERD for Car Shop Afternoon Class'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi57CCY8LyQi4rJA51wBe4wQSzGZdGfSHFc2Zft-G0fyx-o8WQrYyaxpdcMzyZ3gqLzOUrbpkhjeD8CbxQNRptxfdPzRjU5kbqs-Bg9zKw2InotnTfrOgJBKPnRbP1_1h-SADwbSB3IGgdz/s72-c/jiffy2.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-7032088807875464157</id><published>2019-10-02T11:51:00.002-07:00</published><updated>2019-10-02T11:51:41.739-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>In_Class ERD for Oil Change Shop</title><content type='html'><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_yuDBOZUm7yjScI_Buc8yX_sKQ2T9nnRJRNOq1pkZxasDjQ3R7_XNN9OIykRrz1odvQNWFkW8IJcS5pa5lGaq0bBLrQxKm81JUdPFYdt7wgihuMqTM9Q6oP9XK5zJiDqocnsIQuTaUJyw/s1600/jifflubeERD.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_yuDBOZUm7yjScI_Buc8yX_sKQ2T9nnRJRNOq1pkZxasDjQ3R7_XNN9OIykRrz1odvQNWFkW8IJcS5pa5lGaq0bBLrQxKm81JUdPFYdt7wgihuMqTM9Q6oP9XK5zJiDqocnsIQuTaUJyw/s400/jifflubeERD.png" width="400" height="307" data-original-width="940" data-original-height="721" /></a></content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/7032088807875464157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/10/inclass-erd-for-oil-change-shop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7032088807875464157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/7032088807875464157'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/10/inclass-erd-for-oil-change-shop.html' title='In_Class ERD for Oil Change Shop'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_yuDBOZUm7yjScI_Buc8yX_sKQ2T9nnRJRNOq1pkZxasDjQ3R7_XNN9OIykRrz1odvQNWFkW8IJcS5pa5lGaq0bBLrQxKm81JUdPFYdt7wgihuMqTM9Q6oP9XK5zJiDqocnsIQuTaUJyw/s72-c/jifflubeERD.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-3531900783145113542</id><published>2019-09-26T12:04:00.002-07:00</published><updated>2019-09-26T12:04:52.027-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC110"/><title type='text'>Python from First Class</title><content type='html'><p>First Program</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">This is a python program</span>
<span style="color: #DD4422">showing some basic elements</span>
<span style="color: #DD4422">Steve 9-26-2019</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
<span style="color: #888888">#variables and assignments</span>
number1 <span style="color: #333333">=</span> <span style="color: #0000DD; font-weight: bold">7</span>
number2 <span style="color: #333333">=</span> <span style="color: #0000DD; font-weight: bold">12</span>
<span style="color: #888888">#print results</span>
<span style="color: #008800; font-weight: bold">print</span>(number1<span style="color: #333333">+</span>number2)
main()
</pre></div>
<p>Math Operators</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #DD4422">This program will ouput some</span>
<span style="color: #DD4422">math based on user inputs</span>
<span style="color: #DD4422">Steve Conger 9-26-2019</span>
<span style="color: #DD4422">&#39;&#39;&#39;</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">mathOperators</span>():
<span style="color: #888888">#getting input</span>
nameOfUser<span style="color: #333333">=</span><span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&#39;Enter your name: &#39;</span>)
number1, number2 <span style="color: #333333">=</span> <span style="color: #007020">eval</span>(<span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Please enter two numbers divided with a comma: &quot;</span>))
addition <span style="color: #333333">=</span>number1 <span style="color: #333333">+</span> number2
subtraction<span style="color: #333333">=</span>number1 <span style="color: #333333">-</span> number2
mult <span style="color: #333333">=</span> number1 <span style="color: #333333">*</span> number2
division <span style="color: #333333">=</span> number1 <span style="color: #333333">/</span> number2
intdivision <span style="color: #333333">=</span> number1 <span style="color: #333333">//</span> number2
remainder <span style="color: #333333">=</span> number1 <span style="color: #333333">%</span> number2 <span style="color: #888888">#modulus</span>
<span style="color: #008800; font-weight: bold">print</span> (<span style="background-color: #fff0f0">&quot;sum&quot;</span>,addition)
<span style="color: #008800; font-weight: bold">print</span> (<span style="background-color: #fff0f0">&quot;difference&quot;</span>,subtraction)
<span style="color: #008800; font-weight: bold">print</span> (<span style="background-color: #fff0f0">&quot;product&quot;</span>, mult)
<span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;Quotient&quot;</span>, division)
<span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;integer&quot;</span>,intdivision)
<span style="color: #008800; font-weight: bold">print</span>(<span style="background-color: #fff0f0">&quot;remainder&quot;</span>, remainder)
<span style="color: #008800; font-weight: bold">print</span>(nameOfUser)
mathOperators()
</pre></div>
<p>Loop</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">main</span>():
word <span style="color: #333333">=</span> <span style="color: #007020">input</span>(<span style="background-color: #fff0f0">&quot;Enter a word&quot;</span>)
<span style="color: #008800; font-weight: bold">for</span> i <span style="color: #000000; font-weight: bold">in</span> <span style="color: #007020">range</span>(<span style="color: #0000DD; font-weight: bold">10</span>):
<span style="color: #008800; font-weight: bold">print</span>(i, word)
main()
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/3531900783145113542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/09/python-from-first-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3531900783145113542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/3531900783145113542'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/09/python-from-first-class.html' title='Python from First Class'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-1876617785046882222</id><published>2019-09-25T14:56:00.002-07:00</published><updated>2019-09-25T14:56:25.713-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>Brainstorming arranging Aftrernoon</title><content type='html'><pre>
Different types pizza sizes crusts toppings sauces cheeses
side (bread sticks)
beverages
Desert
Customer address
price
supplies (ingredients) inventory boxes
locations
employees
rent mortgage taxes ()
orders refunds Payment types
specials
Security
Future promotions--merchandise
Delivery method take out, in house, delivery
inventory orders
--organize it
Pizza
price
crust
sauce
toppings
cheese
ingredients?
Supplies supplyType Quantity priceperUnit
flour flour 26lbs 1.99
eggs eggs
cups
plates
boxes
spoons
Customer
name
address
usual
phonenumber
email
blacklist
Order
payment type
</pre>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/1876617785046882222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/09/brainstorming-arranging-aftrernoon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1876617785046882222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/1876617785046882222'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/09/brainstorming-arranging-aftrernoon.html' title='Brainstorming arranging Aftrernoon'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6839664396470302668</id><published>2019-09-25T12:04:00.000-07:00</published><updated>2019-09-25T12:04:14.072-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC220"/><title type='text'>Brainstorming First organization</title><content type='html'><pre>
Customer name email address
ingredients
no food supplies
overhead charges, advertisements
employees, orders, delivery, on-line,
Pizzas, sides, drinks, toppings,
specials
alchohol, crusts,
2nd Part organizing:
Pizza Customer
crust name
toppings email
price address
size phone
Orders
pizza(s)-sizes
toppings
sides
drinks
carry-out -delivery--eat in
customer
employee
date time
cooking time
delivery time
Employee
name
position
schedule
Inventory
</pre>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6839664396470302668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/09/brainstorming-first-organization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6839664396470302668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6839664396470302668'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/09/brainstorming-first-organization.html' title='Brainstorming First organization'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6494364305464703084</id><published>2019-08-04T12:02:00.000-07:00</published><updated>2019-08-04T12:02:08.103-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC255"/><title type='text'>Classes and tests Code Testing video</title><content type='html'><p>lock.py</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">Lock</span>():
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__init__</span>(<span style="color: #007020">self</span>, door, location,securitylevel):
<span style="color: #007020">self</span><span style="color: #333333">.</span>door<span style="color: #333333">=</span>door
<span style="color: #007020">self</span><span style="color: #333333">.</span>location<span style="color: #333333">=</span>location
<span style="color: #007020">self</span><span style="color: #333333">.</span>securitylevel<span style="color: #333333">=</span>securitylevel
<span style="color: #007020">self</span><span style="color: #333333">.</span>status<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;locked&#39;</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setStatus</span>(<span style="color: #007020">self</span>, status):
<span style="color: #007020">self</span><span style="color: #333333">.</span>status<span style="color: #333333">=</span>status
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getStatus</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>status
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getDoor</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>door
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getLoction</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>location
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getSecurityLevel</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>securitylevel
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__str__</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">str</span>(<span style="color: #007020">self</span><span style="color: #333333">.</span>door) <span style="color: #333333">+</span> <span style="background-color: #fff0f0">&quot; &quot;</span> <span style="color: #333333">+</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>status
</pre></div>
<p>scan.py</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">lock</span> <span style="color: #008800; font-weight: bold">import</span> Lock
<span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">datetime</span>
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">Scan</span>():
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">__init__</span>(<span style="color: #007020">self</span>, door, location, securitylevel, card):
<span style="color: #007020">self</span><span style="color: #333333">.</span>lock<span style="color: #333333">=</span>Lock(door,location,securitylevel)
<span style="color: #007020">self</span><span style="color: #333333">.</span>card<span style="color: #333333">=</span>card
<span style="color: #007020">self</span><span style="color: #333333">.</span>scantime<span style="color: #333333">=</span>datetime<span style="color: #333333">.</span>datetime<span style="color: #333333">.</span>now()
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getLock</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>lock
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getCard</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>card
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">getScanTime</span>(<span style="color: #007020">self</span>):
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">self</span><span style="color: #333333">.</span>scantime
</pre></div>
<p>The Tests: test.py</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">unittest</span>
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">lock</span> <span style="color: #008800; font-weight: bold">import</span> Lock
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">scan</span> <span style="color: #008800; font-weight: bold">import</span> Scan
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">LockTest</span>(unittest<span style="color: #333333">.</span>TestCase):
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setUp</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>lock<span style="color: #333333">=</span>Lock(<span style="background-color: #fff0f0">&#39;3176&#39;</span>,<span style="background-color: #fff0f0">&#39;BE&#39;</span>, <span style="background-color: #fff0f0">&#39;normal&#39;</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_lockstring</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">str</span>(<span style="color: #007020">self</span><span style="color: #333333">.</span>lock), <span style="background-color: #fff0f0">&#39;3176 locked&#39;</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_getStatus</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>lock<span style="color: #333333">.</span>getStatus(), <span style="background-color: #fff0f0">&#39;locked&#39;</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_setStatus</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>lock<span style="color: #333333">.</span>setStatus(<span style="background-color: #fff0f0">&#39;unlocked&#39;</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>lock<span style="color: #333333">.</span>getStatus(), <span style="background-color: #fff0f0">&#39;unlocked&#39;</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_GetDoor</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>lock<span style="color: #333333">.</span>getDoor(), <span style="background-color: #fff0f0">&#39;3176&#39;</span>)
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">ScanTest</span>(unittest<span style="color: #333333">.</span>TestCase):
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setUp</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>scan<span style="color: #333333">=</span>Scan(<span style="background-color: #fff0f0">&#39;3176&#39;</span>, <span style="background-color: #fff0f0">&#39;BE&#39;</span>, <span style="background-color: #fff0f0">&#39;normal&#39;</span>, <span style="color: #0000DD; font-weight: bold">315643</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_GetCard</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>scan<span style="color: #333333">.</span>getCard(), <span style="color: #0000DD; font-weight: bold">315643</span>)
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6494364305464703084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/08/classes-and-tests-code-testing-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6494364305464703084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6494364305464703084'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/08/classes-and-tests-code-testing-video.html' title='Classes and tests Code Testing video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2280120356938923287</id><published>2019-07-10T14:13:00.000-07:00</published><updated>2019-07-10T14:13:28.792-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC226"/><title type='text'>System Queries</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> information_schema.tables;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #008800; font-weight: bold">Table_name</span> <span style="color: #008800; font-weight: bold">from</span> information_schema.tables
<span style="color: #008800; font-weight: bold">Where</span> table_schema<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;public&#39;</span>;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> information_schema.columns;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #008800; font-weight: bold">column_name</span>, data_type <span style="color: #008800; font-weight: bold">from</span> information_schema.columns
<span style="color: #008800; font-weight: bold">where</span> <span style="color: #008800; font-weight: bold">table_name</span><span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;grantapplication&#39;</span>;
<span style="color: #008800; font-weight: bold">Select</span> sequence_name <span style="color: #008800; font-weight: bold">from</span> information_schema.sequences;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #008800; font-weight: bold">column_name</span>, data_type, <span style="color: #008800; font-weight: bold">constraint_name</span>, constraint_Type
<span style="color: #008800; font-weight: bold">From</span> information_schema.columns
<span style="color: #008800; font-weight: bold">Join</span> information_schema.table_constraints
<span style="color: #008800; font-weight: bold">on</span> information_schema.columns.<span style="color: #008800; font-weight: bold">table_name</span><span style="color: #333333">=</span>information_schema.table_constraints.<span style="color: #008800; font-weight: bold">table_name</span>
<span style="color: #008800; font-weight: bold">where</span> information_schema.columns.<span style="color: #008800; font-weight: bold">table_name</span><span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;grantapplication&#39;</span>
<span style="color: #008800; font-weight: bold">Order</span> <span style="color: #008800; font-weight: bold">by</span> <span style="color: #008800; font-weight: bold">column_name</span>;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> pg_catalog.pg_tablespace;
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> pg_catalog.pg_extension;
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2280120356938923287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/07/system-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2280120356938923287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2280120356938923287'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/07/system-queries.html' title='System Queries'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8538637876236613827</id><published>2019-07-07T11:52:00.001-07:00</published><updated>2019-07-07T11:52:51.205-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC226"/><title type='text'>Advanced Query code</title><content type='html'><!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">/******************************</span>
<span style="color: #888888">* Set Operations</span>
<span style="color: #888888">******************************/</span>
<span style="color: #008800; font-weight: bold">CREATE</span> TEMP <span style="color: #008800; font-weight: bold">TABLE</span> email
(firstname <span style="color: #007020">text</span>,
lastname <span style="color: #007020">text</span>,
email <span style="color: #007020">text</span>);
<span style="color: #008800; font-weight: bold">INSERT</span> <span style="color: #008800; font-weight: bold">INTO</span> email(firstname, lastname, email)
<span style="color: #008800; font-weight: bold">values</span>(<span style="background-color: #fff0f0">&#39;Jordan&#39;</span>, <span style="background-color: #fff0f0">&#39;Lawrence&#39;</span>, <span style="background-color: #fff0f0">&#39;jordanl@gmail.com&#39;</span>),
(<span style="background-color: #fff0f0">&#39;Tammy&#39;</span>, <span style="background-color: #fff0f0">&#39;Standish&#39;</span>, <span style="background-color: #fff0f0">&#39;tstandish@msn.com&#39;</span>),
(<span style="background-color: #fff0f0">&#39;Lester&#39;</span>, <span style="background-color: #fff0f0">&#39;Roberts&#39;</span>, <span style="background-color: #fff0f0">&#39;lr@yahoo.com&#39;</span>),
(<span style="background-color: #fff0f0">&#39;Lynn&#39;</span>, <span style="background-color: #fff0f0">&#39;Kellerman&#39;</span>, <span style="background-color: #fff0f0">&#39;kellerman@gmail.com&#39;</span>);
<span style="color: #008800; font-weight: bold">SELECT</span> lastname, firstname, email, <span style="background-color: #fff0f0">&#39;temptable&#39;</span> <span style="color: #008800; font-weight: bold">as</span> tblSource <span style="color: #008800; font-weight: bold">from</span> email
<span style="color: #008800; font-weight: bold">UNION</span>
<span style="color: #008800; font-weight: bold">SELECT</span> PersonLastname, personfirstname, personemail, <span style="background-color: #fff0f0">&#39;Persontable&#39;</span>
<span style="color: #008800; font-weight: bold">FROM</span> person
<span style="color: #008800; font-weight: bold">JOIN</span> personaddress
<span style="color: #008800; font-weight: bold">USING</span> (personkey)
<span style="color: #008800; font-weight: bold">WHERE</span> personaddressCity<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;Bellevue&#39;</span>;
<span style="color: #008800; font-weight: bold">SELECT</span> Personlastname lastname,
personfirstname firstname,
personemail email,
<span style="background-color: #fff0f0">&#39;donor&#39;</span> <span style="color: #AA6600">&quot;role&quot;</span>
<span style="color: #008800; font-weight: bold">FROM</span> person
<span style="color: #008800; font-weight: bold">JOIN</span> donation <span style="color: #008800; font-weight: bold">USING</span>(personkey)
<span style="color: #008800; font-weight: bold">Where</span> donationamount <span style="color: #333333">&gt;=</span><span style="color: #0000DD; font-weight: bold">2000</span>
<span style="color: #008800; font-weight: bold">UNION</span>
<span style="color: #008800; font-weight: bold">SELECT</span> Personlastname lastname,
personfirstname firstname,
personemail email,
<span style="background-color: #fff0f0">&#39;client&#39;</span>
<span style="color: #008800; font-weight: bold">FROM</span> person
<span style="color: #008800; font-weight: bold">JOIN</span> grantapplication <span style="color: #008800; font-weight: bold">USING</span>(personkey)
<span style="color: #008800; font-weight: bold">WHERE</span> granttypekey<span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">2</span>;
<span style="color: #008800; font-weight: bold">SELECT</span> personkey, personlastname, personfirstname
<span style="color: #008800; font-weight: bold">FROM</span> person
<span style="color: #008800; font-weight: bold">JOIN</span> donation <span style="color: #008800; font-weight: bold">USING</span>(personkey)
<span style="color: #008800; font-weight: bold">INTERSECT</span>
<span style="color: #008800; font-weight: bold">SELECT</span> personkey, personlastname, personfirstname
<span style="color: #008800; font-weight: bold">FROM</span> person
<span style="color: #008800; font-weight: bold">JOIN</span> grantapplication <span style="color: #008800; font-weight: bold">USING</span>(personkey);
<span style="color: #008800; font-weight: bold">SELECT</span> personaddresscity
<span style="color: #008800; font-weight: bold">FROM</span> personaddress
<span style="color: #008800; font-weight: bold">JOIN</span> person <span style="color: #008800; font-weight: bold">USING</span> (personkey)
<span style="color: #008800; font-weight: bold">JOIN</span> donation <span style="color: #008800; font-weight: bold">USING</span> (personkey)
<span style="color: #008800; font-weight: bold">INTERSECT</span>
<span style="color: #008800; font-weight: bold">SELECT</span> personaddresscity
<span style="color: #008800; font-weight: bold">FROM</span> personaddress
<span style="color: #008800; font-weight: bold">JOIN</span> person <span style="color: #008800; font-weight: bold">USING</span> (personkey)
<span style="color: #008800; font-weight: bold">JOIN</span> grantapplication <span style="color: #008800; font-weight: bold">USING</span> (personkey);
<span style="color: #008800; font-weight: bold">SELECT</span> personaddresscity
<span style="color: #008800; font-weight: bold">FROM</span> personaddress
<span style="color: #008800; font-weight: bold">JOIN</span> person <span style="color: #008800; font-weight: bold">USING</span> (personkey)
<span style="color: #008800; font-weight: bold">JOIN</span> donation <span style="color: #008800; font-weight: bold">USING</span> (personkey)
<span style="color: #008800; font-weight: bold">EXCEPT</span>
<span style="color: #008800; font-weight: bold">SELECT</span> personaddresscity
<span style="color: #008800; font-weight: bold">FROM</span> personaddress
<span style="color: #008800; font-weight: bold">JOIN</span> person <span style="color: #008800; font-weight: bold">USING</span> (personkey)
<span style="color: #008800; font-weight: bold">JOIN</span> grantapplication <span style="color: #008800; font-weight: bold">USING</span> (personkey);
<span style="color: #008800; font-weight: bold">SELECT</span> granttypename <span style="color: #008800; font-weight: bold">FROM</span> granttype
<span style="color: #008800; font-weight: bold">EXCEPT</span>
<span style="color: #008800; font-weight: bold">SELECT</span> granttypename <span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">USING</span> (granttypekey);
<span style="color: #888888">/*****************************</span>
<span style="color: #888888">* Windows Functions</span>
<span style="color: #888888">*****************************/</span>
<span style="color: #008800; font-weight: bold">SELECT</span> granttypename, grantapplicationkey, grantapplicationamount,
RANK() OVER (PARTITION <span style="color: #008800; font-weight: bold">BY</span> granttypeName <span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">BY</span> Grantapplicationamount <span style="color: #008800; font-weight: bold">DESC</span>)
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">ON</span> granttype.granttypekey<span style="color: #333333">=</span>grantapplication.granttypekey
<span style="color: #008800; font-weight: bold">WHERE</span> granttypename<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;Food&#39;</span>;
<span style="color: #008800; font-weight: bold">SELECT</span> granttypename, grantapplicationkey, grantapplicationamount,
DENSE_RANK() OVER (PARTITION <span style="color: #008800; font-weight: bold">BY</span> granttypeName <span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">BY</span> Grantapplicationamount
<span style="color: #008800; font-weight: bold">DESC</span>)
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">ON</span> granttype.granttypekey<span style="color: #333333">=</span>grantapplication.granttypekey
<span style="color: #008800; font-weight: bold">WHERE</span> granttypename<span style="color: #333333">=</span><span style="background-color: #fff0f0">&#39;Food&#39;</span>;
<span style="color: #008800; font-weight: bold">SELECT</span> grantapplicationkey, granttypename, grantapplicationamount,
ROW_NUMBER() OVER(<span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">BY</span> grantapplicationkey)
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">using</span>(granttypekey);
<span style="color: #008800; font-weight: bold">SELECT</span> grantapplicationkey, granttypename, grantapplicationamount,
ROW_NUMBER() OVER(<span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">BY</span> grantapplicationamount)
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">using</span>(granttypekey);
<span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #333333">*</span>
<span style="color: #008800; font-weight: bold">FROM</span>
(<span style="color: #008800; font-weight: bold">SELECT</span> grantapplicationkey, granttypename, grantapplicationamount,
ROW_NUMBER() OVER(<span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">BY</span> grantapplicationamount)
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">using</span>(granttypekey))grants
<span style="color: #008800; font-weight: bold">WHERE</span> ROW_NUMBER <span style="color: #008800; font-weight: bold">BETWEEN</span> <span style="color: #0000DD; font-weight: bold">20</span> <span style="color: #008800; font-weight: bold">and</span> <span style="color: #0000DD; font-weight: bold">30</span>;
<span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #333333">*</span>
<span style="color: #008800; font-weight: bold">FROM</span>
(<span style="color: #008800; font-weight: bold">SELECT</span> grantapplicationkey, granttypename, grantapplicationamount,
ROW_NUMBER() OVER(<span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">BY</span> grantapplicationamount)
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">using</span>(granttypekey))grants
<span style="color: #008800; font-weight: bold">WHERE</span> ROW_NUMBER <span style="color: #008800; font-weight: bold">BETWEEN</span> <span style="color: #0000DD; font-weight: bold">20</span> <span style="color: #008800; font-weight: bold">and</span> <span style="color: #0000DD; font-weight: bold">30</span>;
<span style="color: #008800; font-weight: bold">SELECT</span> granttypename, grantapplicationamount,
LAST_VALUE(grantapplicationamount) OVER
(PARTITION <span style="color: #008800; font-weight: bold">BY</span> granttypekey <span style="color: #008800; font-weight: bold">ORDER</span> <span style="color: #008800; font-weight: bold">BY</span> Grantapplicationamount
RANGE <span style="color: #008800; font-weight: bold">BETWEEN</span> UNBOUNDED PRECEDING <span style="color: #008800; font-weight: bold">AND</span> UNBOUNDED FOLLOWING)
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">using</span>(granttypekey);
<span style="color: #888888">/**************************************</span>
<span style="color: #888888">* Pivot table with CROSSTAB</span>
<span style="color: #888888">*************************************/</span>
<span style="color: #008800; font-weight: bold">CREATE</span> TEMP <span style="color: #008800; font-weight: bold">TABLE</span> applications2018
(
GranttypeName <span style="color: #007020">TEXT</span>,
applicationdate <span style="color: #007020">DATE</span>,
applciationamount <span style="color: #007020">NUMERIC</span>
);
<span style="color: #008800; font-weight: bold">INSERT</span> <span style="color: #008800; font-weight: bold">INTO</span> applications2018
<span style="color: #008800; font-weight: bold">SELECT</span> Granttypename, grantapplicationDate, grantapplicationamount
<span style="color: #008800; font-weight: bold">FROM</span> grantapplication
<span style="color: #008800; font-weight: bold">JOIN</span> granttype <span style="color: #008800; font-weight: bold">ON</span> granttype.granttypekey <span style="color: #333333">=</span> grantapplication.granttypekey
<span style="color: #008800; font-weight: bold">WHERE</span> <span style="color: #008800; font-weight: bold">EXTRACT</span> (<span style="color: #008800; font-weight: bold">YEAR</span> <span style="color: #008800; font-weight: bold">FROM</span> grantapplicationdate)<span style="color: #333333">=</span><span style="color: #0000DD; font-weight: bold">2018</span>;
<span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #333333">*</span>
<span style="color: #008800; font-weight: bold">FROM</span> CROSSTAB(<span style="background-color: #fff0f0">&#39;SELECT EXTRACT(MONTH FROM applicationdate)::INTEGER,</span>
<span style="background-color: #fff0f0">granttypename, SUM(applciationamount)</span>
<span style="background-color: #fff0f0">FROM applications2018</span>
<span style="background-color: #fff0f0">GROUP BY 1,2 ORDER BY 1, 2&#39;</span>)
FINAL_RESULT(<span style="color: #008800; font-weight: bold">Month</span> <span style="color: #007020">INTEGER</span>, Food <span style="color: #007020">NUMERIC</span>, Rent <span style="color: #007020">NUMERIC</span>, School <span style="color: #007020">NUMERIC</span>,
Dental <span style="color: #007020">NUMERIC</span>, Medical <span style="color: #007020">NUMERIC</span>, Childcare <span style="color: #007020">NUMERIC</span> ,Misc <span style="color: #007020">NUMERIC</span> );
<span style="color: #008800; font-weight: bold">CREATE</span> TEMP <span style="color: #008800; font-weight: bold">TABLE</span> citydonations
(
<span style="color: #AA6600">&quot;Month&quot;</span> <span style="color: #007020">Integer</span>,
city <span style="color: #007020">text</span>,
amount <span style="color: #007020">numeric</span>
);
<span style="color: #008800; font-weight: bold">CREATE</span> TEMP <span style="color: #008800; font-weight: bold">TABLE</span> citydonations
(
<span style="color: #AA6600">&quot;Month&quot;</span> <span style="color: #007020">Integer</span>,
city <span style="color: #007020">text</span>,
amount <span style="color: #007020">numeric</span>
);
<span style="color: #008800; font-weight: bold">INSERT</span> <span style="color: #008800; font-weight: bold">INTO</span> citydonations
<span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #008800; font-weight: bold">EXTRACT</span>(<span style="color: #008800; font-weight: bold">MONTH</span> <span style="color: #008800; font-weight: bold">FROM</span> Donationdate), PersonaddressCity, donationamount
<span style="color: #008800; font-weight: bold">FROM</span> (
<span style="color: #008800; font-weight: bold">SELECT</span> DINSTINCT <span style="color: #008800; font-weight: bold">ON</span>(donationkey)
donationkey,
donationdate,
personaddresscity,
donationamount
<span style="color: #008800; font-weight: bold">FROM</span> donation
<span style="color: #008800; font-weight: bold">JOIN</span> personaddress
<span style="color: #008800; font-weight: bold">USING</span> (personkey)
) donations;
<span style="color: #008800; font-weight: bold">SELECT</span> <span style="color: #333333">*</span>
<span style="color: #008800; font-weight: bold">FROM</span> CROSSTAB(<span style="background-color: #fff0f0">&#39;SELECT &quot;Month&quot; :: INTEGER,</span>
<span style="background-color: #fff0f0">City, SUM(amount) FROM citydonations</span>
<span style="background-color: #fff0f0">GROUP BY 1,2</span>
<span style="background-color: #fff0f0">ORDER BY 1, 2&#39;</span>)
FINAL_RESULT(<span style="color: #008800; font-weight: bold">Month</span> <span style="color: #007020">INTEGER</span>,
Seattle <span style="color: #007020">NUMERIC</span>,
Redmond <span style="color: #007020">NUMERIC</span>,
<span style="color: #AA6600">&quot;New York&quot;</span> <span style="color: #007020">NUMERIC</span>,
Bellevue <span style="color: #007020">NUMERIC</span>,
Tukwilla <span style="color: #007020">NUMERIC</span>,
Kent <span style="color: #007020">NUMERIC</span>);
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8538637876236613827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/07/advanced-query-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8538637876236613827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8538637876236613827'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/07/advanced-query-code.html' title='Advanced Query code'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-2030853072899228750</id><published>2019-06-28T13:24:00.003-07:00</published><updated>2019-06-28T13:24:44.269-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC255"/><title type='text'>Diagram from the Use Case Video</title><content type='html'><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRCjcwcWqNp6j39bb1RlYikxnBZy63LEvGm6rsMNN8sgcGFatpq7F8ocL124zKKxEUoxhDAkolJU2CMTpjUZsl18fxf9vKidvNKBf4bDMRZNeR23jHLK8k5hHS4cyDUbbDBhPxACPM4WzU/s1600/Screenshot+from+2019-06-28+13-22-06.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRCjcwcWqNp6j39bb1RlYikxnBZy63LEvGm6rsMNN8sgcGFatpq7F8ocL124zKKxEUoxhDAkolJU2CMTpjUZsl18fxf9vKidvNKBf4bDMRZNeR23jHLK8k5hHS4cyDUbbDBhPxACPM4WzU/s400/Screenshot+from+2019-06-28+13-22-06.png" width="400" height="383" data-original-width="720" data-original-height="689" /></a></content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/2030853072899228750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/06/diagram-from-use-case-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2030853072899228750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/2030853072899228750'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/06/diagram-from-use-case-video.html' title='Diagram from the Use Case Video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRCjcwcWqNp6j39bb1RlYikxnBZy63LEvGm6rsMNN8sgcGFatpq7F8ocL124zKKxEUoxhDAkolJU2CMTpjUZsl18fxf9vKidvNKBf4bDMRZNeR23jHLK8k5hHS4cyDUbbDBhPxACPM4WzU/s72-c/Screenshot+from+2019-06-28+13-22-06.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5575890806985526277</id><published>2019-06-28T13:23:00.000-07:00</published><updated>2019-06-28T13:23:36.836-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC255"/><title type='text'>Lock ERD from Video</title><content type='html'><p>Here is the screenshot for the ERD</p>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSAp4SURvFhl45pqMJyaQD8XHZpLpb154gJ2T-AbVlCxeYpT_jbPWElLIda7_e7XNvMJKet0j8x4gixU0F-Gr2L1TAb6ntA8uSJs9m6N6MkFGYP_IxSFWswPVOkD4hn_qDpgKV92AU1_wv/s1600/Screenshot+from+2019-06-28+13-20-08.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSAp4SURvFhl45pqMJyaQD8XHZpLpb154gJ2T-AbVlCxeYpT_jbPWElLIda7_e7XNvMJKet0j8x4gixU0F-Gr2L1TAb6ntA8uSJs9m6N6MkFGYP_IxSFWswPVOkD4hn_qDpgKV92AU1_wv/s400/Screenshot+from+2019-06-28+13-20-08.png" width="400" height="250" data-original-width="875" data-original-height="547" /></a></content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5575890806985526277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/06/lock-erd-from-video.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5575890806985526277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5575890806985526277'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/06/lock-erd-from-video.html' title='Lock ERD from Video'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSAp4SURvFhl45pqMJyaQD8XHZpLpb154gJ2T-AbVlCxeYpT_jbPWElLIda7_e7XNvMJKet0j8x4gixU0F-Gr2L1TAb6ntA8uSJs9m6N6MkFGYP_IxSFWswPVOkD4hn_qDpgKV92AU1_wv/s72-c/Screenshot+from+2019-06-28+13-20-08.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5388513016821158123</id><published>2019-06-24T11:13:00.001-07:00</published><updated>2019-06-24T11:13:31.300-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC224"/><title type='text'>Basic xml queries</title><content type='html'><p>here are the xml queries from the video.</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">/****************************</span>
<span style="color: #888888">basic xml queries</span>
<span style="color: #888888">***********************/</span>
<span style="color: #888888">--create a table with an xml data type</span>
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">table</span> xmlTest
(
xmltestId <span style="color: #007020">serial</span> <span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span>,
test xml
);
<span style="color: #888888">--insert some xml</span>
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> xmlTest(test)
<span style="color: #008800; font-weight: bold">values</span>(<span style="background-color: #fff0f0">&#39;&lt;person&gt;&lt;name&gt;Joe Smith&lt;/name&gt;&lt;email&gt;js@gmail.com&lt;/email&gt;&lt;age&gt;34&lt;/age&gt;&lt;/person&gt;&#39;</span>),
(<span style="background-color: #fff0f0">&#39;&lt;person&gt;&lt;name&gt;Kelly Jones&lt;/name&gt;&lt;email&gt;kj@gmail.com&lt;/email&gt;&lt;age&gt;24&lt;/age&gt;&lt;/person&gt;&#39;</span>),
(<span style="background-color: #fff0f0">&#39;&lt;person&gt;&lt;name&gt;Lila Bard&lt;/name&gt;&lt;email&gt;lb@gmail.com&lt;/email&gt;&lt;age&gt;25&lt;/age&gt;&lt;/person&gt;&#39;</span>);
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #333333">*</span> <span style="color: #008800; font-weight: bold">from</span> xmltest;
<span style="color: #008800; font-weight: bold">Select</span> xmlelement(name name, test) <span style="color: #008800; font-weight: bold">from</span> xmltest;
<span style="color: #888888">--return emails</span>
<span style="color: #008800; font-weight: bold">Select</span> xpath(<span style="background-color: #fff0f0">&#39;//email/text()&#39;</span>, test) <span style="color: #008800; font-weight: bold">from</span> xmltest;
<span style="color: #888888">--return ages</span>
<span style="color: #008800; font-weight: bold">Select</span> xpath(<span style="background-color: #fff0f0">&#39;//age/text()&#39;</span>, test)<span style="color: #008800; font-weight: bold">from</span> xmltest;
<span style="color: #888888">--put xml tags around query results</span>
<span style="color: #008800; font-weight: bold">Select</span> xmlforest(personlastname, personemail)
<span style="color: #008800; font-weight: bold">from</span> person;
<span style="color: #888888">--output a table as xmlf= fragment</span>
<span style="color: #008800; font-weight: bold">Select</span> Table_to_xml(<span style="background-color: #fff0f0">&#39;granttype&#39;</span>,<span style="color: #008800; font-weight: bold">True</span>, <span style="color: #008800; font-weight: bold">True</span>, <span style="background-color: #fff0f0">&#39;&#39;</span>);
<span style="color: #888888">--output query results as xml fragment</span>
<span style="color: #008800; font-weight: bold">Select</span> query_to_xml(<span style="background-color: #fff0f0">&#39;Select personfirstname, personlastname, positionname</span>
<span style="background-color: #fff0f0"> from person</span>
<span style="background-color: #fff0f0"> join employee using (personkey)</span>
<span style="background-color: #fff0f0"> join employeeposition using (employeekey)</span>
<span style="background-color: #fff0f0"> join jobposition using (positionkey)&#39;</span>
,<span style="color: #008800; font-weight: bold">True</span>, <span style="color: #008800; font-weight: bold">True</span>, <span style="background-color: #fff0f0">&#39;&#39;</span>) ;
<span style="color: #008800; font-weight: bold">Select</span> table_to_xmlschema(<span style="background-color: #fff0f0">&#39;granttype&#39;</span>,<span style="color: #008800; font-weight: bold">True</span>, <span style="color: #008800; font-weight: bold">True</span>, <span style="background-color: #fff0f0">&#39;&#39;</span>);
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5388513016821158123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/06/basic-xml-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5388513016821158123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5388513016821158123'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/06/basic-xml-queries.html' title='Basic xml queries'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-5565306101263506156</id><published>2019-06-24T10:44:00.000-07:00</published><updated>2019-06-24T10:44:36.657-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC224"/><title type='text'>Basic JSON queries</title><content type='html'><p>Here is the code I used in the video on Basic JSON queries.</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">/*********************</span>
<span style="color: #888888">basic JSON queries </span>
<span style="color: #888888">*********************/</span>
<span style="color: #888888">--create a table with Json as a datatype</span>
<span style="color: #008800; font-weight: bold">Create</span> <span style="color: #008800; font-weight: bold">table</span> JsonTest
(
testID <span style="color: #007020">serial</span> <span style="color: #008800; font-weight: bold">primary</span> <span style="color: #008800; font-weight: bold">key</span>,
test Json
);
<span style="color: #888888">--insert some records</span>
<span style="color: #008800; font-weight: bold">Insert</span> <span style="color: #008800; font-weight: bold">into</span> JsonTest(test)
<span style="color: #008800; font-weight: bold">Values</span>(<span style="background-color: #fff0f0">&#39;{&quot;testname&quot; : &quot;testOne&quot;, &quot;testnumber&quot; : 123, &quot;testdate&quot; :&quot;2019-05-02&quot;}&#39;</span>),
(<span style="background-color: #fff0f0">&#39;{&quot;testname&quot; : &quot;testtwo&quot;, &quot;testnumber&quot; : 234, &quot;testdate&quot; :&quot;2019-05-08&quot;}&#39;</span>),
(<span style="background-color: #fff0f0">&#39;{&quot;testname&quot; : &quot;testthree&quot;, &quot;testnumber&quot; : 345, &quot;testdate&quot; :&quot;2019-05-12&quot;}&#39;</span>);
<span style="color: #888888">--query the value of a field</span>
<span style="color: #008800; font-weight: bold">Select</span> test <span style="color: #333333">-&gt;&gt;</span><span style="background-color: #fff0f0">&#39;testname&#39;</span> <span style="color: #008800; font-weight: bold">as</span> <span style="color: #AA6600">&quot;name&quot;</span> <span style="color: #008800; font-weight: bold">from</span> jsontest;
<span style="color: #888888">--creates an array of sorts putting each element on its own row</span>
<span style="color: #008800; font-weight: bold">Select</span> Json_each(test) <span style="color: #008800; font-weight: bold">from</span> Jsontest;
<span style="color: #888888">--returns the keys in the Json record</span>
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #008800; font-weight: bold">Distinct</span> Json_object_keys(test) <span style="color: #008800; font-weight: bold">from</span> jsontest;
<span style="color: #888888">--gets tne count of tests</span>
<span style="color: #008800; font-weight: bold">Select</span> <span style="color: #008800; font-weight: bold">count</span>(<span style="color: #008800; font-weight: bold">cast</span> (test <span style="color: #333333">-&gt;&gt;</span> <span style="background-color: #fff0f0">&#39;testnumber&#39;</span> <span style="color: #008800; font-weight: bold">as</span> <span style="color: #007020">integer</span>)) <span style="color: #008800; font-weight: bold">from</span> Jsontest;
<span style="color: #888888">--returns the results of a query as Json</span>
<span style="color: #888888">--double click the results to get a little dialog box</span>
<span style="color: #888888">--copy and paste to a text editor to see the full results</span>
<span style="color: #008800; font-weight: bold">with</span> j <span style="color: #008800; font-weight: bold">as</span>
(
<span style="color: #008800; font-weight: bold">Select</span> personfirstname, personlastname, positionname
<span style="color: #008800; font-weight: bold">from</span> person
<span style="color: #008800; font-weight: bold">join</span> employee <span style="color: #008800; font-weight: bold">using</span> (personkey)
<span style="color: #008800; font-weight: bold">join</span> employeeposition <span style="color: #008800; font-weight: bold">using</span> (employeekey)
<span style="color: #008800; font-weight: bold">join</span> jobposition <span style="color: #008800; font-weight: bold">using</span> (positionkey)
)
<span style="color: #008800; font-weight: bold">Select</span> json_agg(j) <span style="color: #008800; font-weight: bold">from</span> j;
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/5565306101263506156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/06/basic-json-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5565306101263506156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/5565306101263506156'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/06/basic-json-queries.html' title='Basic JSON queries'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-8059176121050971469</id><published>2019-06-04T14:04:00.000-07:00</published><updated>2019-06-04T14:05:40.561-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC255"/><title type='text'>Testing</title><content type='html'><p> here is the code for the tests. the tests and the classes being tested are available on <a href="https://github.com/spconger/SaleExamples/tree/master/SaleExamples">github.com/spconger</a></p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">unittest</span>
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">item</span> <span style="color: #008800; font-weight: bold">import</span> Item
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">orderitem</span> <span style="color: #008800; font-weight: bold">import</span> OrderItem
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">order</span> <span style="color: #008800; font-weight: bold">import</span> Order
<span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">payment</span> <span style="color: #008800; font-weight: bold">import</span> Payment
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">ItemTest</span>(unittest<span style="color: #333333">.</span>TestCase):
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setUp</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>item<span style="color: #333333">=</span>Item(<span style="color: #0000DD; font-weight: bold">1</span>,<span style="background-color: #fff0f0">&#39;item1&#39;</span>, <span style="color: #6600EE; font-weight: bold">30.00</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_string</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">str</span>(<span style="color: #007020">self</span><span style="color: #333333">.</span>item), <span style="color: #007020">self</span><span style="color: #333333">.</span>item<span style="color: #333333">.</span>itemname)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_GetItemNumber</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>item<span style="color: #333333">.</span>getItemNumber(),<span style="color: #0000DD; font-weight: bold">1</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_GetItemPrice</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>item<span style="color: #333333">.</span>getItemPrice(),<span style="color: #6600EE; font-weight: bold">30.00</span>)
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">OrderItemTest</span>(unittest<span style="color: #333333">.</span>TestCase):
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setUp</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>item<span style="color: #333333">=</span>Item(<span style="color: #0000DD; font-weight: bold">1</span>,<span style="background-color: #fff0f0">&#39;item1&#39;</span>, <span style="color: #6600EE; font-weight: bold">30.00</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>oitem<span style="color: #333333">=</span>OrderItem(<span style="color: #007020">self</span><span style="color: #333333">.</span>item,<span style="color: #0000DD; font-weight: bold">2</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_Quantity</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">self</span><span style="color: #333333">.</span>oitem<span style="color: #333333">.</span>getQuantity(),<span style="color: #0000DD; font-weight: bold">2</span>)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_item</span>(<span style="color: #007020">self</span>):
item<span style="color: #333333">=</span><span style="color: #007020">self</span><span style="color: #333333">.</span>oitem<span style="color: #333333">.</span>getItem()
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">str</span>(item), <span style="background-color: #fff0f0">&#39;item1&#39;</span>)
<span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">OrderTest</span>(unittest<span style="color: #333333">.</span>TestCase):
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">setUp</span>(<span style="color: #007020">self</span>):
<span style="color: #007020">self</span><span style="color: #333333">.</span>item1<span style="color: #333333">=</span>Item(<span style="color: #0000DD; font-weight: bold">1</span>,<span style="background-color: #fff0f0">&#39;beer&#39;</span>,<span style="color: #6600EE; font-weight: bold">6.25</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>item2<span style="color: #333333">=</span>Item(<span style="color: #0000DD; font-weight: bold">2</span>,<span style="background-color: #fff0f0">&#39;chips&#39;</span>, <span style="color: #6600EE; font-weight: bold">4.50</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>orderitem1<span style="color: #333333">=</span>OrderItem(<span style="color: #007020">self</span><span style="color: #333333">.</span>item1,<span style="color: #0000DD; font-weight: bold">2</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>orderitem2<span style="color: #333333">=</span>OrderItem(<span style="color: #007020">self</span><span style="color: #333333">.</span>item2,<span style="color: #0000DD; font-weight: bold">1</span>)
<span style="color: #007020">self</span><span style="color: #333333">.</span>order<span style="color: #333333">=</span>Order()
<span style="color: #007020">self</span><span style="color: #333333">.</span>order<span style="color: #333333">.</span>addOrderItems(<span style="color: #007020">self</span><span style="color: #333333">.</span>orderitem1)
<span style="color: #007020">self</span><span style="color: #333333">.</span>order<span style="color: #333333">.</span>addOrderItems(<span style="color: #007020">self</span><span style="color: #333333">.</span>orderitem2)
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">test_CalculateTotal</span>(<span style="color: #007020">self</span>):
payment<span style="color: #333333">=</span><span style="color: #007020">self</span><span style="color: #333333">.</span>order<span style="color: #333333">.</span>calcTotal()
<span style="color: #007020">self</span><span style="color: #333333">.</span>assertEqual(<span style="color: #007020">str</span>(payment), <span style="background-color: #fff0f0">&#39;Your payment today will be 17.0&#39;</span>)
</pre></div>
</content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/8059176121050971469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/06/testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8059176121050971469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/8059176121050971469'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/06/testing.html' title='Testing'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1083017836179388179.post-6651269409707029065</id><published>2019-05-28T14:34:00.002-07:00</published><updated>2019-05-28T14:34:50.128-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ITC255"/><title type='text'>SalesExample</title><content type='html'><p>Here is the class diagram for the salesExample</p>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWxk0s7OHoh8UB3Z-EbwZd_DoU0RWzgPOw-HNMeR0JjsIFTc7eroHXiyNT2y_JotTB0-b3CSgkkSPuktG7azGc60Vj8eRDrJbE24X4_HQSq61mXxopwM2E6Y7w3bbSXbZoo32HFwF7dSNs/s1600/salesClass.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWxk0s7OHoh8UB3Z-EbwZd_DoU0RWzgPOw-HNMeR0JjsIFTc7eroHXiyNT2y_JotTB0-b3CSgkkSPuktG7azGc60Vj8eRDrJbE24X4_HQSq61mXxopwM2E6Y7w3bbSXbZoo32HFwF7dSNs/s400/salesClass.png" width="400" height="262" data-original-width="913" data-original-height="599" /></a>
<p>Here is the link to the diagram <a href="https://www.lucidchart.com/invitations/accept/409c3b2a-7232-4813-a321-d66c508d3392">https://www.lucidchart.com/invitations/accept/409c3b2a-7232-4813-a321-d66c508d3392</a></p>
<p>Here is the github link for the <a href="https://github.com/spconger/SaleExamples">sales classes</a></p>
<p>Here is the github link for the <a href="https://github.com/spconger/LockExample">lock classes</a></p></content><link rel='replies' type='application/atom+xml' href='http://congeritc.blogspot.com/feeds/6651269409707029065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://congeritc.blogspot.com/2019/05/salesexample.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6651269409707029065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1083017836179388179/posts/default/6651269409707029065'/><link rel='alternate' type='text/html' href='http://congeritc.blogspot.com/2019/05/salesexample.html' title='SalesExample'/><author><name>spconger</name><uri>http://www.blogger.com/profile/09403009178972940087</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKPNzixlD9WTayArKRCOHadMsNvZxpYb6nKKm8wHDK76mYORtdyR4axmZY7UJ1jtlyXihYJzg6vuafDKP5CNMJ4JiiKJiL54SPnSTVtsmZo9adK_ADwPjQOi8dCDy4r5g/s220/me.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWxk0s7OHoh8UB3Z-EbwZd_DoU0RWzgPOw-HNMeR0JjsIFTc7eroHXiyNT2y_JotTB0-b3CSgkkSPuktG7azGc60Vj8eRDrJbE24X4_HQSq61mXxopwM2E6Y7w3bbSXbZoo32HFwF7dSNs/s72-c/salesClass.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>
If you would like to create a banner that links to this page (i.e. this validation result), do the following:
Download the "valid Atom 1.0" banner.
Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)
Add this HTML to your page (change the image src
attribute if necessary):
If you would like to create a text link instead, here is the URL you can use:
http://www.feedvalidator.org/check.cgi?url=http%3A//congeritc.blogspot.com/feeds/posts/default