Three value logic and the ACID test - concepts surrounding SQL
Interested in delving into database design? Here's two very important concepts to start you off.
Preamble:
To understand this article you need to know some SQL basics. If you're familiar with SQL then you can skip the preamble section...
A relational database can be defined as "A big spreadsheet that several people can update simultaneously". SQL is a language that queries databases for inserting, deleteting and updateing data. A database management system (or program) such as MySQL or ORACLE should live up to what is known as the ACID test:
Atomicity – When a transaction is carried out, either it all happens or none of it gets done. Its one or the other, there are no inbetweens.
Consistency – A database proceeds from one valid state to another valid state. For example, according to database design, orphans are invalid. What is an orphan? If you create a column in a table that references another table (becomes a child object of that parent table) you can not remove the parent until you have removed all the children. Valid state to valid state.
Isolation – transactions happen in isolation of each other.
Durability – If the system suddenly crashes, the committed transactions are still there and are recoverable.
3 value logic
Important in database management is the concept of 3 value logic. Boolean logic (true or false) is not used in database conditional tests. Istead 3 value logic is used (true, false or NULL). Therefore if you conduct a conditional test to see whether an old variable is different from a new variable – if a != b in most programming languages; in SQL you would say – if a!=b or b is NULL having already made sure that NULL values of a aren't stored in the database. Weird, to be sure but it has a purpose.
Conclusion:
Though SQL is an easy language to learn, there are more difficult concepts surrounding it that take time to grasp. For an example of a complex database driven site see Africapic.com .
To understand this article you need to know some SQL basics. If you're familiar with SQL then you can skip the preamble section...
- You need to know firstly what tables, columns (fields) and rows (records) are in terms of databases – tables are spreadsheets of info within a database, columns define data of a particular type and rows are individual records.
- Secondly you need to know about Child-Parent object-orientated relationships – Parent can have many children but a child cannot have any parents, they themselves can become parents etc. etc.... And for that matter have a basic programming background (eg Javascript).
- Lastly you need to know what a primary key is and how to set up a table in a database management system (eg MySQL or ORACLE)
A relational database can be defined as "A big spreadsheet that several people can update simultaneously". SQL is a language that queries databases for inserting, deleteting and updateing data. A database management system (or program) such as MySQL or ORACLE should live up to what is known as the ACID test:
Atomicity – When a transaction is carried out, either it all happens or none of it gets done. Its one or the other, there are no inbetweens.
Consistency – A database proceeds from one valid state to another valid state. For example, according to database design, orphans are invalid. What is an orphan? If you create a column in a table that references another table (becomes a child object of that parent table) you can not remove the parent until you have removed all the children. Valid state to valid state.
Isolation – transactions happen in isolation of each other.
Durability – If the system suddenly crashes, the committed transactions are still there and are recoverable.
3 value logic
Important in database management is the concept of 3 value logic. Boolean logic (true or false) is not used in database conditional tests. Istead 3 value logic is used (true, false or NULL). Therefore if you conduct a conditional test to see whether an old variable is different from a new variable – if a != b in most programming languages; in SQL you would say – if a!=b or b is NULL having already made sure that NULL values of a aren't stored in the database. Weird, to be sure but it has a purpose.
Conclusion:
Though SQL is an easy language to learn, there are more difficult concepts surrounding it that take time to grasp. For an example of a complex database driven site see Africapic.com .

Use the feedback form below to submit your comments.

Use the form below to email this article to your friends.

- Learn to install Apache 2, MySQL 5, PHP 5, phpMyAdmin 2 and Zend Optimizer 3 on Windows XP (Install PHPmyAdmin)
- Learn to install Apache 2, MySQL 5, PHP 5, phpMyAdmin 2 and Zend Optimizer 3 on Windows XP (Main Section)
- What Is MySQL And Does Your Business Need It?
- New Features in SQL Server 2005
- Learn to install Apache 2, MySQL 5, PHP 5, phpMyAdmin 2 and Zend Optimizer 3 on Windows XP (Install Zend Optimizer)
- Learn to install Apache 2, MySQL 5, PHP 5, phpMyAdmin 2 and Zend Optimizer 3 on Windows XP (Install PHP)
- Learn to install Apache 2, MySQL 5, PHP 5, phpMyAdmin 2 and Zend Optimizer 3 on Windows XP (Install MySQL)
- Learn to install Apache 2, MySQL 5, PHP 5, phpMyAdmin 2 and Zend Optimizer 3 on Windows XP (Install Apache)
- SQL Replication
- Client Server Software Architecture
- Introduction To Relational Data Model
- Improving Application Performance With Solix Database Archiving Solutions
- Automate routine database synchronization with Database Restyle – Application!
- Membership Database Software
- Database RAD Visual Studio Review: Visual DataFlex
- IT Marketing: Mailing to Your Current Customer Database
- The Value Of Oracle Database
- Lighten Creating Entity Relationship Diagrams by Leaps and Bounds
- Crime Fighting Computer Systems and Databases
- Students Gain Access to Cutting-Edge Technology
- Database Administrator Responsibilities
- Advantages of Database Management Systems
- Advantages of Relational Databases



