As you may already know, databases use tables to organize information. Each table consists of a number of rows, each of which corresponds to a single database record. So, how do databases keep all of these records straight? It’s through the use of keys.
Primary Keys
The first type of key we’ll discuss is the primary key. Every database table should have one or more columns designated as the primary key. The value this key holds should be unique for each record in the database. For example, assume we have a table called Employees that contains personnel information for every employee in our firm. We’d need to select an appropriate primary key that would uniquely identify each employee. Your first thought might be to use the employee’s name.
This wouldn’t work out very well because it’s conceivable that you’d hire two employees with the same name. A better choice might be to use a unique employee ID number that you assign to each employee when they’re hired. Some organizations choose to use Social Security Numbers (or similar government identifiers) for this task because each employee already has one and they’re guaranteed to be unique. However, the use of Social Security Numbers for this purpose is highly controversial due to privacy concerns. (If you work for a government organization, the use of a Social Security Number may even be illegal under the Privacy Act of 1974.) For this reason, most organizations have shifted to the use of unique identifiers (employee ID, student ID, etc.) that don’t share these privacy concerns.
Once you decide upon a primary key and set it up in the database, the database management system will enforce the uniqueness of the key. If you try to insert a record into a table with a primary key that duplicates an existing record, the insert will fail.
Most databases are also capable of generating their own primary keys. Microsoft Access, for example, may be configured to use the AutoNumber data type to assign a unique ID to each record in the table. While effective, this is a bad design practice because it leaves you with a meaningless value in each record in the table. Why not use that space to store something useful?
Foreign Keys
The other type of key that we’ll discuss in this course is the foreign key. These keys are used to create relationships between tables. Natural relationships exist between tables in most database structures. Returning to our employees database, let’s imagine that we wanted to add a table containing departmental information to the database. This new table might be called Departments and would contain a large amount of information about the department as a whole. We’d also want to include information about the employees in the department, but it would be redundant to have the same information in two tables (Employees and Departments). Instead, we can create a relationship between the two tables.
Let’s assume that the Departments table uses the Department Name column as the primary key. To create a relationship between the two tables, we add a new column to the Employees table called Department. We then fill in the name of the department to which each employee belongs. We also inform the database management system that the Department column in the Employees table is a foreign key that references the Departments table. The database will then enforce referential integrity by ensuring that all of the values in the Departments column of the Employees table have corresponding entries in the Departments table.
Note that there is no uniqueness constraint for a foreign key. We may (and most likely do!) have more than one employee belonging to a single department. Similarly, there’s no requirement that an entry in the Departments table have any corresponding entry in the Employees table. It is possible that we’d have a department with no employees.
Wednesday, July 20, 2011
Sunday, July 17, 2011
Do you want a free eBook?
Do you use Microsoft Excel but find it difficult to work with? Do you want to use Excel but don't know where to start?
Leave your email address in the comment section and I will send you a free eBook that will teach you to easily accomplish what you need to do in Excel. No strings attached. Just a free eBook that will hopefully help you learn something about a very useful tool!
Leave your email address in the comment section and I will send you a free eBook that will teach you to easily accomplish what you need to do in Excel. No strings attached. Just a free eBook that will hopefully help you learn something about a very useful tool!
Saturday, July 16, 2011
Top 10 Obscure Google Search Tricks
When it comes to the Google search box, you already know the tricks: finding exact phrases matches using quotes like "so say we all" or searching a single site using site:Hakninja.blogspot.com gmail. But there are many more oblique, clever, and lesser-known search recipes and operators that work from that unassuming little input box. Dozens of Google search guides detail the tips you already know, but today we're skipping the obvious and highlighting our favorite obscure Google web search tricks.
10. Get the local time anywhere
What time is it in Bangkok right now? Ask Google. Enter simply what time is it to get the local time in big cities around the world, or add the locale at the end of your query, like what time is it hong kong to get the local time there.
9. Track flight status
Enter the airline and flight number into the Google search box and get back the arrival and departure times right inside Google's search results.
8. Convert currency, metrics, bytes, and more
Google's powerful built-in converter calculator can help you out whether you're cooking dinner, traveling abroad, or building a PC. Find out how many teaspoons are in a quarter cup (quarter cup in teaspoons) or how many seconds there are in a year (seconds in a year) or how many euros there are to five dollars (5 USD in Euro). For the geekier set, bits in kilobytes (155473 bytes in kilobytes) and numbers in hex or binary (19 in binary) are also pretty useful.
7. Compare items with "better than" and find similar items with "reminds me of"
Simply search for, in quotes: "better than _keyword_"
Some example results:
Results 1 - 100 of about 550 English pages for " better than WinAmp".
Results 1 - 57 of 57 English pages for " better than mIRC".
Results 1 - 100 of about 17,500 English pages for " better than Digg". (Wow. Poor Digg.)
The results will almost always lead you to discovering alternatives to whatever it is you're searching for. Using the same concept, you can use this trick to discover new music or movies. For example, " reminds me of _someband_" or "sounds like _someband_" will pull up artists people have thought sounded similar to the one you typed in. This is also a great way to find good, no-name musicians you'd probably never know of otherwise.
Examples:
Results 1 - 88 of 88 English pages for " reminds me of Metallica".
Results 1 - 36 of 36 English pages for " similar to Garden State".
Results 1 - 66 of 66 English pages for " sounds like The Shins".
Just get creative and you'll, without a doubt, find cool new stuff you probably never knew existed.
6. Use Google as a free proxy
What, your company blocks that hip new web site just because it drops the F bomb occasionally? Use Google's cache to take a peek even when the originating site's being blocked, with cache:example.com.
5. Remove affiliate links from product searches
When you're sick of seeing duplicate product search results from the likes of eBay, Bizrate, Pricerunner, and Shopping.com, clear 'em out by stacking up the -site:ebay.com -site:bizrate.com -site:shopping.com operator. Alternately, check out Give Me Back My Google (original post), a service that does all that known reseller cleaning up for you when you search for products. Compare this GMBMG search for a Cruzer 1GB flash drive to the regular Google results.
4. Find related terms and documents
Ok, this one's direct from any straight-up advanced search operator cheat sheet, but it's still one of the lesser-used tricks in the book. Adding a tilde (~) to a search term will return related terms. For example, Googling ~nutrition returns results with the words nutrition, food, and health in them.
3. Find music and comic books
Using a combination of advanced search operators that specify music files available in an Apache directory listing, you can turn Google into your personal Napster. Go ahead, try this search for Nirvana tracks: -inurl:(htm|html|php) intitle:"index of" +"last modified" +"parent directory" +description +size +(wma|mp3) "Nirvana". (Sub out Nirvana for the band you're interested in; use this one in conjunction with number 7 to find new music, too.) The same type of search recipe can find comic books as well.
2. ID people, objects, and foreign language words and phrases with Google Image Search
Google Image search results show you instead of tell you about a word. Don't know what jicama looks like? Not sure if the person named "Priti" who you're emailing with is a woman or a man? Spanish rusty and you forgot what "corazon" is? Pop your term into Google Image Search (or type image jicama into the regular search box) to see what your term's about.
1. Make Google recognize faces
If you're doing an image search for Paris Hilton and don't want any of the French city, a special URL parameter in Google's Image search will do the trick. Add &imgtype=face to the end of your image search to just get images of faces, without any inanimate objects. Try it out with a search for rose (which returns many photos of flowers) versus rose with the face parameter.
What's your favorite ninja Google search technique? Tell us about it in the comments.
Tuesday, July 12, 2011
How to instantly increase traffic to your website or blog using RefZip
I have recently found a website that will instantly increase the traffic to your website or blog by at least 20 to 30%. In one hour of posting my blog “HakNinja”, I saw an increase in traffic of 28%. Now my blog is small and I don’t have a very big following but this site has really helped me.
The website is called RefZip and here’s how it works.
1. You enter the URL of your website or blog on the RefZip home page.
2. RefZip will then include your website into a rotation of other websites.
3. That’s it!
RefZip has a huge following. People visit RefZip to see a rotation of recently updated websites. They can read it directly from RefZip or click on the site to actually visit it. Either way, you get increased traffic, INSTANTLY!!! It is completely free and you don’t have to give any information other than the URL of your website or blog. It is easy and it really works.
Starting and maintaining a website or blog is hard work and when you don’t see a lot of traffic it can be disheartening. Small time bloggers need all the help they can get and this is a great tool; and for you readers out there, check out RefZip and you will get a large amount of interesting and relevant blogs and websites that you are guaranteed to enjoy.
Click here to start using or browsing RefZip
Blog Directory
The website is called RefZip and here’s how it works.
1. You enter the URL of your website or blog on the RefZip home page.
2. RefZip will then include your website into a rotation of other websites.
3. That’s it!
RefZip has a huge following. People visit RefZip to see a rotation of recently updated websites. They can read it directly from RefZip or click on the site to actually visit it. Either way, you get increased traffic, INSTANTLY!!! It is completely free and you don’t have to give any information other than the URL of your website or blog. It is easy and it really works.
Starting and maintaining a website or blog is hard work and when you don’t see a lot of traffic it can be disheartening. Small time bloggers need all the help they can get and this is a great tool; and for you readers out there, check out RefZip and you will get a large amount of interesting and relevant blogs and websites that you are guaranteed to enjoy.
Click here to start using or browsing RefZip
Blog Directory
Sunday, July 10, 2011
Get Your Mac Ready for Lion
On July 1st Apple released the golden master version (GMV) of Lion to developers—usually the last non-public version of OS X before the official release. If you want to update as soon as it is available, now is the time to check your hardware and perform a few system cleanups to ensure you'll be ready to download Lion on release day. Macworld runs through what you need to do to prepare.
Most Macs from 2006 and newer should be able to install and run Lion without difficulty; the minimum hardware requirements are 2gb of RAM, 4gb of free hard drive space, and an Intel processor that is at least a Core 2 duo, i3, i5, i7, or Xeon. Furthermore you must have a recent update of Snow Leopard (OS 10.6.6 or better) as Lion will only available from the Mac App Store, which debuted in that version of Snow Leopard.
You don't necessarily want to skate by on the bare minimum of requirements, so it may be time to consider additional RAM, or if you might be better served with purchasing a new Mac with Lion preinstalled. If you're unhappy with the speed of your Mac running Snow Leopard, an upgrade may be in order.
After you've made sure the basic requirements are met it is a good idea to backup, run all Apple software updates, and check for updates for any third-party software you use. You should also disable FileVault if you use it as Lion includes a new approach to file encryption. See the Macworld full guide below for details.
MacWorlds Guide to Prepare for Lion
Click below to check out my other website It teaches how to make some extra $$$. It is legit.
Earn 1K a Month
Monday, April 25, 2011
WLOX news just confirmed that Mississippi Governor Haley Barbour will not enter the presidential race in 2012. For months now, Governor Barbour has made numerous appearances in key states outlining the mistakes of the Obama administration and touting conservative rhetoric.
I have a few sources close to the Governor and they have informed me that the main reason he has decided against being a candidate for president is his wife’s disapproval and fear of such an endeavor. Mrs. Barbour has been very vocal about her fears of a presidential race. She is quoted as saying “it horrifies me”.
I have my own opinions about why the Governor has decided not to run for president. The country has repeatedly declared that they [the voters] are tired of the same old politics and want something different. Governor Barbour is the “same old politics”. He epitomizes what is wrong with the American political system and has given no signs of changing. His extensive experience of being a lobbyist shows that he knows how to manipulate the system for his benefit and there is no reason to believe that it would be any different if he were president.
Governor Barbour is a career politician. I for one, am of the belief that we need something different. We need someone who knows how to succeed in the private sector as well as in the public eye. I am pleased to know that Governor Barbour will not be a candidate for president. Perhaps this will make more room for someone who wants what is best for America. Donald Trump anyone?
I have a few sources close to the Governor and they have informed me that the main reason he has decided against being a candidate for president is his wife’s disapproval and fear of such an endeavor. Mrs. Barbour has been very vocal about her fears of a presidential race. She is quoted as saying “it horrifies me”.
I have my own opinions about why the Governor has decided not to run for president. The country has repeatedly declared that they [the voters] are tired of the same old politics and want something different. Governor Barbour is the “same old politics”. He epitomizes what is wrong with the American political system and has given no signs of changing. His extensive experience of being a lobbyist shows that he knows how to manipulate the system for his benefit and there is no reason to believe that it would be any different if he were president.
Governor Barbour is a career politician. I for one, am of the belief that we need something different. We need someone who knows how to succeed in the private sector as well as in the public eye. I am pleased to know that Governor Barbour will not be a candidate for president. Perhaps this will make more room for someone who wants what is best for America. Donald Trump anyone?
Wednesday, April 20, 2011
Dropbox, Keep Your Hands Off My Data!!!!
Yesterday, Dropbox, which is a very popular file syncing utility that stores user’s data in the cloud, announced that it would decrypt and hand over files if the U.S. Government requested it.
The issue I have with this is not that they would give the requested data to the Feds, they really have no choice if the Feds have a warrant, buts its that Dropbox employees even have the ability to decrypt user’s data in the first place.
Maybe I am paranoid, but I do not like the idea that the employees of data storage companies have the ability to see my files. It seems to me that there now is a place in the market for another “Dropbox” like company, but one that gives the user control over its own encryption key.
Sure, there are tools out there that can be used to encrypt data before it even reaches the Dropbox servers. The first one that comes to mind is the wonderful, feature rich, and absolutely free tool called Truecrypt. However, using that with Dropbox its a hassle at best, not to mention that it would make the smartphone app completely useless.
Dropbox, we all love your service and you provide a great cloud storage solution, but please for the love of God, give us control over our own encryption keys. Give us the ability to ensure that we are the only ones that can access our data.
Below is a link to another article about this topic from PCWorld.com
Update: Dropbox Will Hand Over Your Files to the Feds If Asked
The issue I have with this is not that they would give the requested data to the Feds, they really have no choice if the Feds have a warrant, buts its that Dropbox employees even have the ability to decrypt user’s data in the first place.
Maybe I am paranoid, but I do not like the idea that the employees of data storage companies have the ability to see my files. It seems to me that there now is a place in the market for another “Dropbox” like company, but one that gives the user control over its own encryption key.
Sure, there are tools out there that can be used to encrypt data before it even reaches the Dropbox servers. The first one that comes to mind is the wonderful, feature rich, and absolutely free tool called Truecrypt. However, using that with Dropbox its a hassle at best, not to mention that it would make the smartphone app completely useless.
Dropbox, we all love your service and you provide a great cloud storage solution, but please for the love of God, give us control over our own encryption keys. Give us the ability to ensure that we are the only ones that can access our data.
Below is a link to another article about this topic from PCWorld.com
Update: Dropbox Will Hand Over Your Files to the Feds If Asked
Subscribe to:
Comments (Atom)



