<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jordan Hall &#187; databases</title>
	<atom:link href="http://jordanhall.co.uk/tag/databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://jordanhall.co.uk</link>
	<description>Jordan Hall - programmer and geek</description>
	<lastBuildDate>Thu, 19 Jan 2012 11:36:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simple Explanation of Model View Controller (MVC)</title>
		<link>http://jordanhall.co.uk/programming/simple-explanation-of-model-view-controller-mvc-2206990/</link>
		<comments>http://jordanhall.co.uk/programming/simple-explanation-of-model-view-controller-mvc-2206990/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 12:04:22 +0000</pubDate>
		<dc:creator>Jordan Hall</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[controllers]]></category>
		<category><![CDATA[CRUD]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[feature cascade]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[Model View Controller]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[software architectures]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://jordanhall.co.uk/?p=990</guid>
		<description><![CDATA[Model view controller is a type of software architecture that is designed to separate the programming code that handles presentation, application logic and business logic. This makes systems using a model view controller architecture much simpler to maintain, as locating the code relevant to specific logic is significantly easier. Additionally, it makes expansion of systems much less complex, [...]]]></description>
			<content:encoded><![CDATA[<p>Model view controller is a type of software architecture that is designed to separate the programming code that handles presentation, application logic and business logic.</p>
<p style="text-align: center;"><a href="http://jordanhall.co.uk/wp-content/uploads/2010/06/model-view-controller-mvc-diagram1.png"><img class="aligncenter size-full wp-image-1001" title="Model View Controller (MVC) Diagram" src="http://jordanhall.co.uk/wp-content/uploads/2010/06/model-view-controller-mvc-diagram1.png" alt="Model View Controller MVC Diagram" width="350" height="160" /></a></p>
<p>This makes systems using a model view controller architecture much simpler to maintain, as locating the code relevant to specific logic is significantly easier. Additionally, it makes expansion of systems much less complex, as it avoids the &#8216;feature cascade&#8217; effect in which the addition of a single feature will result in a knock on or butterfly effect throughout the entire system.</p>
<p>The parts of a model view controller system are referred to as models, views and controllers, which makes perfect sense. The definition of these system parts is also quite intuitive.</p>
<ul>
<li><strong>Views</strong> &#8211; Views are entirely for the presentation part of your application. It contains no brains, no logic, no intelligence to the extent permissible by the programming language used. A view is merely the appearance of your application and nothing else.</li>
<li><strong>Controllers</strong> &#8211; A controller handles feedback from the user and logic specific to the application. A controllers job is to receive input from a user, via controls found on the user interface of a view, to process it, communicating with a model if necessary, and then to send output to the user, usually by populating a view with relevant content.</li>
<li><strong>Models</strong> &#8211; Models perform business logic. Business logic, in this case, refers to items that are fundamental to the overall system design. For example, if a library application was constructed, the logic which ensured a library card owner only rented up to 5 books at a time, would be part of a model. Again, as part of the business logic, models also tend to control access to application storage, such as database(s), performing CRUD (creation, updating and deletion) tasks on the stored data.</li>
</ul>
<p>I hope this helps explain the basics of the model view controller software architecture.</p>
<p>If you have any improvements or additions to these definitions or just want to discuss software architectures in general, feel free to use the comments section below.</p>
]]></content:encoded>
			<wfw:commentRss>http://jordanhall.co.uk/programming/simple-explanation-of-model-view-controller-mvc-2206990/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQL Check Constraints not supported in MySQL</title>
		<link>http://jordanhall.co.uk/general-articles/sql-check-constraints-not-supported-in-mysql-2204849/</link>
		<comments>http://jordanhall.co.uk/general-articles/sql-check-constraints-not-supported-in-mysql-2204849/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 16:12:22 +0000</pubDate>
		<dc:creator>Jordan Hall</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[check constraints]]></category>
		<category><![CDATA[constraints]]></category>
		<category><![CDATA[database schema]]></category>
		<category><![CDATA[database validation]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://jordanhall.co.uk/?p=849</guid>
		<description><![CDATA[I previously wrote about using SQL check constraints in MySQL. It seems however that the MySQL relational database management system (RDBMS) does not actually support the fundamental verification used by check constraints in other RDBMSs. This means that although you can add check constraints to tables without issue, they are not validated and data is [...]]]></description>
			<content:encoded><![CDATA[<p>I previously wrote about using <a href="http://jordanhall.co.uk/general-articles/sql-check-constraints-on-mysql-databases-2102526/">SQL check constraints in MySQL</a>. It seems however that the MySQL relational database management system (RDBMS) does not actually support the fundamental verification used by check constraints in other RDBMSs. This means that although you can add check constraints to tables without issue, they are not validated and data is inserted or updated.</p>
<p>The latest <a href="http://dev.mysql.com/doc/refman/5.5/en/table-constraints-table.html">MySQL documentation</a> (5.5) discretly mentions the fact these constraints are unfortunately not supported.</p>
<blockquote>
<ul>
<li>The CONSTRAINT_TYPE value can be UNIQUE, PRIMARY KEY, or FOREIGN KEY.</li>
<li>The UNIQUE and PRIMARY KEY information is about the same as what you get from the Key_name field in the output from SHOW INDEX when the Non_unique field is 0.</li>
<li>The CONSTRAINT_TYPE column can contain one of these values: UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK. This is a CHAR (not ENUM) column. <strong>The CHECK value is not available until we support CHECK.</strong></li>
</ul>
</blockquote>
<p>Take special note of the final line I&#8217;ve emboldened. This is quite a shame that this constraint type is not fully supported yet.</p>
<p>Apologies to readers for the implication that this was functional in my previous post, and thanks to the poster of <a href="http://jordanhall.co.uk/general-articles/sql-check-constraints-on-mysql-databases-2102526/comment-page-1/#comment-1370">this comment</a> for noticing the discrepancy.</p>
<p>Check constraints, of course, function fine in many other DBMSs, and to that end, the original post on <a href="http://jordanhall.co.uk/general-articles/sql-check-constraints-on-mysql-databases-2102526/">SQL check constraints</a> is still relevant, but sadly not if you are worked with MySQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://jordanhall.co.uk/general-articles/sql-check-constraints-not-supported-in-mysql-2204849/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>SQL Check Constraints on MySQL Databases</title>
		<link>http://jordanhall.co.uk/general-articles/sql-check-constraints-on-mysql-databases-2102526/</link>
		<comments>http://jordanhall.co.uk/general-articles/sql-check-constraints-on-mysql-databases-2102526/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 13:25:21 +0000</pubDate>
		<dc:creator>Jordan Hall</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[check constraints]]></category>
		<category><![CDATA[database schema]]></category>
		<category><![CDATA[database validation]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Check Constraints]]></category>

		<guid isPermaLink="false">http://jordanhall.co.uk/?p=526</guid>
		<description><![CDATA[An SQL check constraint is used and designed in the schema of a database table to restrict the range of values that can be entered into a specific field. In many experienced, they are very rarely used. However, these simple checks, entered at the time of database table creation, can provide additional safe guards against [...]]]></description>
			<content:encoded><![CDATA[<p>An SQL check constraint is used and designed in the schema of a database table to restrict the range of values that can be entered into a specific field. In many experienced, they are very rarely used. However, these simple checks, entered at the time of database table creation, can provide additional safe guards against &#8216;bad&#8217; data getting into your database tables, either via errors in code or simply user area. SQL check constraints can act as a last line of defence against &#8216;bad&#8217; data, as it is verification at the database level.</p>
<p>You can create a table with a check constraint in MySQL as follows. The check in this example disallows values of the &#8216;P_Id&#8217; field from falling outside of the condition &#8216;P_Id&gt;0&#8242;. In other words, the &#8216;P_Id&#8217; field&#8217;s values must almost be greater than zero in order for the data to be accepted into the table by the database management system (DBMS).</p>
<pre>CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
CHECK (P_Id&gt;0)
)</pre>
<p>You are probably wondering how to add a constraint to an existing database table. This is quite easy, and uses an &#8216;ALTER TABLE&#8217; SQL query. See the following example for how to add a check constraint to one of your existing database tables.</p>
<pre>ALTER TABLE Persons
ADD CHECK (P_Id&gt;0)</pre>
<p>For more information, there are other highly useful example queries relating to SQL check constraints at the relevant <a href="http://www.w3schools.com/Sql/sql_check.asp">SQL check constraint article</a> on <a href="http://www.w3schools.com/">W3schools</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jordanhall.co.uk/general-articles/sql-check-constraints-on-mysql-databases-2102526/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

