SQL - What's a Database?
A database is nothing more than an empty shell, like a vacant warehouse. It offers no real functionality what so ever, other than holding a name. Tables are the next tier of our tree offering a wide scope of functionality. If you follow our warehouse example, a SQL table would be the physical shelving inside our vacant warehouse. Each SQL table is capable of housing 1024 columns(shelves). Depending on the situation, your goods may require reorganization, reshelving, or removal. SQL tables can be manipulated in this same way or in any fashion the situation calls for.
SQL - Four Principles of Database Design
When designing and implementing a database, keep in mind these four guidelines.
Atomicity
Your coded statements flow without the constant need to update or "fix" your data.
Consistency
Your statements are either executed 100% or fail 100%, do not implement code that partially works.
Isolation
Keep data files and logs away from public eyes, and limit the number of users with administration access to your database.
Durability
Maintain reliable servers with plenty of storage space and back-up systems that save transactions immediately.
A well thought out database will continue to serve and meet your needs for ages. It is important to plan ahead and really put some thought into what you intend to record in your databases. Keep in mind that tables and databases should maintain some relationship. In many instances it is far more desirable to have several small related tables and databases than one giant one. "Never place your eggs all in one basket."
The Database Model
Dr. Edgar F. Codd was the founding father of what is known as the relational model of databases. In 1970, he published a groundbreaking article "A Relational Model of Data for Large Shared Data Banks." Included within the article were 12 rules of relational databases. These rules are as follows (paraphrased).
- Information Rule
All data in the database should be represented as values in tables.
- Guaranteed Access
Every piece of data should be accesible by using the table name, primary key, and a column name.
- Treatment of NULL Values
Null values must be treated as incomplete data pieces. Nulls are not to be confused with zeros.
- Active-Online Relational Catalog
A database is represented at a logical level of tables.
- Sublanguage
Having one supported language with a well-defined syntax.
- Updating Views
All views should be updated through the system.
- Set-level Insertion, Update, and Deletion
System must support set-time insert, update, and deletion operations.
- Data Independence (Physical)
Alterations to the way data is stored must not alter the application itself.
- Data Independence (Logical)
Altering tables, columns, and/or rows must not alter the application itself.
- Integrity Independence
The language of the database must define integrity rules.
- Distribution Independence
Distributing the database to numerous locations should be anonymous and existing applications should be unaffected.
- Nonsubversion
If the system uses a low level interface to record data, then there must be a higher level interface used when administrating.
The largest of corporations follow these rules of cataloging information to this very day.
Database Driven Web Sites
Today we experience the power of databases throughout the web. Many sites are completely dynamic, meaning the content that is being display is held inside of a table with columns, and columns of information to display. This is quickly becoming the ideal way to host websites. It allows for dynamic content on the fly, user interaction, and webmasters can store information about returning users making way for the site to recognize returning users. Any chance at building rapport with your audience is a great opportunity indeed.
|