How Databases Work



Get Web Design Tips and Tricks on mps-web-design.com. How Databases Work topic will increase your understanding on Web Design Tips and Tricks. We at mps-web-design.com only provide news, articles, information in Web Design Tips and Tricks. Web Design Tips and Tricks at mps-web-design.com provides the most up to date news and articles. If you have questions please do not hesitate to contact us.

Almost all of the most useful sites on the web use databases to organise their content, and they often use them to allow users to register and leave comments too. Any time you do something that a website seems to 'remember' the next time, the chances are that a database is involved.

Yet, despite how common databases are, they aren't very well understood. Every day, new webmasters become database administrators without even understanding the first thing about databases. When you use a database on the web today, you're not just using any database: you're using ones that rely on concepts built up over decades of database development and proven effective. Here are some of those concepts.

Relational Databases

The most common database model in use today is that of the relational database - others include hierarchical databases (where data is organised in 'trees', like an organisation's management structure), and flat file databases (where data is stored in 'records' in a text document).

In a relational database, data is stored in tables. The columns are called fields and the rows are called records. So, for example, a table might have two fields: firstname and lastname. If you then added a record to this table, it could be 'Bob' and 'Smith'. Instead of just having that data, you have labelled it with what it is, and that lets you refer to it and search through it much more easily.

Where the 'relational' part is really significant, though, is when it comes to the way tables in a database relate to the other tables. Each record of each table has an ID number (technically known as the 'primary key') - for example, the Bob Smith record might be ID number 123. This then lets you refer to his record in a new table.

Let's say you were storing records of people's orders. You could have two columns: customer number and date. This lets you simply store 123 and the date in the table each time Bob Smith orders from you - the relational nature of the database will tell you later on that customer number 123 is Bob Smith. When it comes to things like, for example, storing posts made by multiple authors, this is powerful.

SQL Databases

SQL stands for 'Structured Query Language'. It's the most popular language for making queries to relational database systems. What's a query? It's basically a way of asking the database to find a record for you that matches criteria you specify.

Let's go back to our example firstname and lastname table - let's say the table was called 'names'. To get Bob Smith's name in there to begin with, we would have used SQL that looked like this:

INSERT INTO names VALUES ('Bob', 'Smith');

The ID number would be assigned automatically be the database. Then, later on, if we wanted to find out who customer 123 was, we could run this SQL:

SELECT * FROM names WHERE id = '123';

This would get us customer 123's record from the database - Bob Smith's record.

SQL might look complicated, and it can be, but that complexity is helped by the fact that there aren't very many SQL commands you're likely to ever need. Really, most websites can get by with just these statements:

CREATE. Used to create new database tables. You have to tell the database which fields (columns) you want, and what kind of data (text, dates, etc.) each field is going to contain.

SELECT. This command is used to search tables. You can use operators like = (equals), < (less than) and > (greater than) to find the record you're after. For example, if you wanted to find all your sales this week, you would work out the date a week ago and use SELECT * FROM sales WHERE date > - that is, 'find all records in the sales table where the date is greater than...'.

INSERT. Lets you add new records to the table

UPDATE. Once you've inserted data, update lets you modify parts of it. Useful if, for example, Bob Smith tells you he'd prefer to be known as Robert Smith. Update lets you change the data without having to delete and re-insert it, which means that records get to keep their existing ID nun

DELETE. Removes existing rows from the table, using the same basic syntax as SELECT.


Background Searcher - Investigate Anyone. - Professional private investigation resources and databases here for anyone to use. Find out the truth today. Easy and powerful.
Database Normalization eBook. - Comprehensive eBook on Normalization techniques for general Relational Databases such as Oracle, Sql Server and others.

It is not enough to create strong calls to action on your website. If the user doesn’t understand the benefits of completing that call to action they will ignore it. Before you call a user to action, first clearly describe what they will receive in return. Take Skype for example. Skype has a very clear [...]


Article Index: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79


More Articles:


1. Design vs Content: Who is KING? By Romelo Itong
Well it is not Elvis, that's for sure.I am a firm advocate of good design but most of the time people tend to interpret design as amazing graphics and astounding visuals they tend to forget that design is the culmination of every aspect of good and effective presentation into one.We all know that design and content have equal importance in regards to websites but if you must choose which one is immediately important, which will you choose, design or content? If you?re going to prepare an entir…

2. Creating the Perfect Website - A beginners Guide By Amanda Evans
Are you looking to create the perfect website? A complete novice when it comes to HTML, CGI, FTP and all the other associated pieces that make up the website puzzle, then this article is definitely for you.By following the 5 guidelines listed below you are guaranteed to create the perfect website.1. Plan your websiteCreating a plan of your website will help you identify the purpose of your website and will also help you to see how many pages you will require. You should then research simila…

3. Successful Flash Tips By Nathan Sire
Ever browse across a website that took ten million years to load or required a road map to find the navigation bar? True, Flash Technology might impress your clients till their eyes fall out. However, Flash Technology requires a skillful balance between gaudy and elegant. We’ve composed some advice on how to make use of Flash Technology without turning your mainstream prospects away.Navigation BarsUnless your website tests prospects on their IQ, don’t require a user to jump through hoops, just…

4. How to Avoid the 12 Common Web Design Mistakes
How to Avoid the 12 Common Web Design MistakesCopyright 2002 by Herman Drost Are people visiting your web site but not buying? This may be asign and the time to do some redesign of your web site. Oftenyou are so close to what you have created, that you can’t seeobvious design mistakes. I often do the same when writing anarticle – everything looks fine when I have finished, yet when Ireview it the next day and I’m amazed at how many mistakes Ihave made. Let’s look at some of the most common Web D…