Top Nav

SQL Join Types

I always have trouble keeping the different types of SQL joins straight in my head so here is a quick reference:

Inner Join – An inner join returns only those records from both tables that have a matching value in the related field. In other words only those records that satisfy the join condition.Inner Join

Outer Joins – Outer joins return records from one table where there are no matching records in the other table. There are three types of outer joins – left outer, right outer, full outer.

Left Outer Join – The left outer join retrieves records from both tables, retrieving all the records from the left table and any records from the right table where the condition values match. If there are no matching values in from the right table, the join still retrieves all the records from the left table. Any columns from the right table that are unmatched are left NULL. Consequently, the resulting recordset often appears to have incomplete records. Outer Left Join

Right Outer Join – The right outer join is similar to the left outer join in that it retrieves all the records from one side of the relationship, but this time it’s the right table. Only records where the condition values match are retrieved from the left. A right outer join returns all the records from the right table, or the many side of a relationship. Right Outer Join

Full Outer Join – The full outer join retrieves all records from both the left and the right table.

Cross Join – A cross join returns what’s known as a Cartesian product. This means that the join combines every row from the left table with every row in the right table.

Self Join – There’s a special type of relationship that’s called a self join. It’s not really a type of join, since you can apply it to any join type. A self join is rather unique in that it involves a relationship with only one table. Instead of relating a table to a second table, the join is based on a relationship based on the same table. You simply reference the table twice and use an alias to avoid confusion.

0

LTSP

0

Booting to Single User or Runlevel

On any Linux system running grub with a boot menu, you can specify the runlevel to the init program as follows:

  1. When the boot menu is displayed, press the up or down arrow key to stop the auto boot process.
  2. Using the arrow keys, select the kernel that you wish to boot.
  3. Press the “e” key to edit this boot config.
  4. Use the arrow keys to select the “kernel …. ” boot command.
  5. Press the “e” key to edit this boot command.
  6. Add a runlevel number or the word “single” to the end of the command line.
  7. Press the “b” key to boot the edited config.
0

Preventing Caching

When it comes to preventing caching, there are a couple of annoying
Javascripts you can use, but I wouldn’t recommend it. Until there is a
technology specifically developed to prevent caching as an option on the
client side, there are a few options.
The best I’ve seen so far is the META and Pragma options in which either
you don’t cache the whole page itself, or make sure the page is always
expired.

1. Using the ‘Expires’ header. The Expires header of an HTML document
tells a Web browser when a cached document should expire from the cache.
Using a date in the past ensures the document will always be expired.

Insert the text below between the <HEAD></HEAD> tags of the HTML
document containing the embedded file.

<META HTTP-EQUIV=”Expires” CONTENT=”Mon, 04 Dec 1999 21:29:02 GMT”>

Each and every time this document is requested the browser will notice
that the cached version has expired and will download the file from it’s
server of origin. (Which by the way, beats the pants off of tweaking
your .htaccess file).

2. Using the Pragma: No-Cache header. This code directs the browser to
not cache the document at all.

Insert the following text after the closing </BODY> tag of the HTML page
containing the embedded file.

<HEAD>
<META HTTP-EQUIV=”PRAGMA” CONTENT=”NO-CACHE”>
</HEAD>

It’s important to note here that the Pragma: No-Cache header does not
work with Internet Explorer 5. Microsoft higly recommends using the
Cache-Control header, instead. Check out their article on this
particular subject at
http://support.microsoft.com/support/kb/articles/Q234/0/67.ASP

3. As a third option, when linking between HTML pages, it’s possible to
force the linked page to be loaded from it’s server of origin and not
from the browser cache. To do this simply place a query-string operator,
?, followed by a number on the end of the link URL.

For example, if one HTML page contains a link to another page called
‘mypage.html’, then to force the browser to download the latest version
of that page from the Web server set up the link in the HTML page like
this:

<a HREF=”mypage.html?1″>Some Link</a>

I recommend that you use both method 1 and 2 together on any page that
contains sensitive material. (images, swf files, etc.)

0

Preventing Caching

When it comes to preventing caching, there are a couple of annoying
Javascripts you can use, but I wouldn’t recommend it. Until there is a
technology specifically developed to prevent caching as an option on the
client side, there are a few options.
The best I’ve seen so far is the META and Pragma options in which either
you don’t cache the whole page itself, or make sure the page is always
expired.

1. Using the ‘Expires’ header. The Expires header of an HTML document
tells a Web browser when a cached document should expire from the cache.
Using a date in the past ensures the document will always be expired.

Insert the text below between the <HEAD></HEAD> tags of the HTML
document containing the embedded file.

<META HTTP-EQUIV=”Expires” CONTENT=”Mon, 04 Dec 1999 21:29:02 GMT”>

Each and every time this document is requested the browser will notice
that the cached version has expired and will download the file from it’s
server of origin. (Which by the way, beats the pants off of tweaking
your .htaccess file).

2. Using the Pragma: No-Cache header. This code directs the browser to
not cache the document at all.

Insert the following text after the closing </BODY> tag of the HTML page
containing the embedded file.

<HEAD>
<META HTTP-EQUIV=”PRAGMA” CONTENT=”NO-CACHE”>
</HEAD>

It’s important to note here that the Pragma: No-Cache header does not
work with Internet Explorer 5. Microsoft higly recommends using the
Cache-Control header, instead. Check out their article on this
particular subject at
http://support.microsoft.com/support/kb/articles/Q234/0/67.ASP

3. As a third option, when linking between HTML pages, it’s possible to
force the linked page to be loaded from it’s server of origin and not
from the browser cache. To do this simply place a query-string operator,
?, followed by a number on the end of the link URL.

For example, if one HTML page contains a link to another page called
‘mypage.html’, then to force the browser to download the latest version
of that page from the Web server set up the link in the HTML page like
this:

<a HREF=”mypage.html?1″>Some Link</a>

I recommend that you use both method 1 and 2 together on any page that
contains sensitive material. (images, swf files, etc.)

0