Dynamic website design, database design importance is self-evident. If poorly designed, the inquiry up on the very difficult process of performance will be affected. Whether you are using a mySQL or Oracle database through standardized forms design, can make your PHP code is more readable and easier, which in turn will also enhance application performance. In simple terms, standardization of the forms is designed to eliminate redundancy and lack of co-ordination affiliation. In this paper, I will adopt five gradual process to tell you the design should understand the regularization techniques. So as to establish a viable and efficient use of the database. This paper will analyze in detail the relationship between use types.
Here we have to assume that the establishment of a user’s information forms, which must be stored user names, companies, company address and some personal favorites or url. At the beginning, you may definition of a structure of the following forms :
Zero state forms
Users Name company company_address url1 url2 Work ABC a Joe Lane abc.com xyz.com Jill XYZ a Job Street abc.com xyz.com
Due to the absence of any formalized, we will table this form of the state is known as the form of tables. Watch the url1 and url2 field — if we need to use third url? This way you will pay more in form one, it is clear that this is not a good solution. If you want to create a rich expansion of the system, you must consider the use of a standardized form, and applied to the table.
First-class form of regularization
1. Eliminate duplication of each form group 2. Related to the data set to establish an independent form 3. The use of a primary key to the identification of relevant data set
The above forms a clear violation of the top of the first, then the third of the primary key is what is the point? Very simple, it only added to each record a unique, automatic increase in the integer value. Through this value, it can be the same as the names of two separate records. Through the use of standardized forms the first level, we have the following form :
Users UserId name company company_address url An ABC a Joe Lane abc.com Work An ABC a Joe Lane xyz.com Work 2 Jill XYZ Street abc.com a Job 2 Jill XYZ Street xyz.com a Job
Now we forms can be said to have at the first-class in the form of regularization, It has solved the url field restrictions, but after the treatment has brought a new issue. Every time the user to insert a table of records, we have to repeat all the companies and user data. This will not only result in large databases than before, it is very prone to error. It is also a second-class regularization. Second-class form of regularization
1. Application for a number of records in the field to establish an independent form 2. Through a foreign key to the relevance of these forms of value
We will url on the value of an independent form, so that we can in the future to include more data without fear of overlap values. We have also adopted the main keys to these related fields :
Users UserId name company company_address An ABC a Joe Lane Work 2 Jill XYZ a Job Street
As indicated above, we had to establish an independent form users of the table primary key userid now with the url table foreign key relUs erId Association. Now the situation seems to have been significantly improved. However, if we want to join a company ABC staff records? Or more, 200? Then we must repeat the company name and address, this is obviously not enough redundancy. We will, therefore, the third-grade standardized method :
3rd grade standardized forms
1. Elimination is not dependent on the crucial field
Company name and address and User Id are not related, and they use their own companies Id :
Users UserId name relCompId Joe 1 1 Jill 2 2
Companies CompId company company_address An ABC a Work Lane 2 XYZ a Job Street
We companies will form the primary key comId and users of the table name relC ompId the foreign key relevance, even if ABC company to 200 employees, the companies have only one record. Our users and urls table continues to expand, and not have to worry about unnecessary data insertion. Most of the developers are three steps that the regularization enough, the database The design can easily handle the whole of the burden on businesses, the view in most cases, is correct.
We can look at the url field — your attention to data redundancy? If user input to the users of these data url HTML pages is a text box, indiscriminate importation of the case, This is not a problem, the same two collections of user input folder probability less, but if through a drop-down menu. only allow users to choose two url entry, or a little more. Under such circumstances, our database can also be used for optimizing the next level — the fourth step, For most developers, this step is overlooked, It is because they want to rely on a very special relationship — a many-to-many relationship This in our applications have not encountered before. Data relations
In the definition and standardization fourth form, I would like to mention three basic data : one-to-one. One-to-many and many-to-many. We look back, after the first regular users of the table. If we url to the field on a separate table for each of the users to insert a table record We will table the urls inserted here. We will be a one-to-one relationships : Table of users each trip will be the urls table to find the corresponding row. For our application, it is neither practical nor standards.
Then look at the second regular example. For each user records, the number of forms to allow urls records associated with it. This is a one-to-one relationship, which is a very common relationship.
For many-to-many relationship, it would be a bit complicated. In the third form of standardization example, our users with a lot of the url. We want to remove the structure to allow multiple users with a number of urls, This way we can be a many-to-many structure. In discussion, we take a look at some form structure changes
Users UserId name relCompId Joe 1 1 Jill 2 2
Companies CompId company company_address An ABC a Work Lane 2 XYZ a Job Street
To further minimize data redundancy, we used the fourth grade standardized forms. We created a rather strange url_relations table inside the field are the main keys or foreign key. Through the table, we can eliminate the urls table duplication. Following is the fourth regular form of specific requirements :
The fourth form of regularization
1. In a many-to-many relationship, not an independent entity with stored in a form
Since it only applies to the many-to-many relationship, the vast majority of developers can ignore this provision. However, under certain circumstances, it is a very practical, this example is the case, we will be the same entity separated, and will be moved to their own relationship in the table, thus improving the urls table.
To make it easier for you to understand, we cite specific examples, The following will use a SQL statement to select all belong to the joe urls :
SELECT name, url FROM users, urls, WHERE url_relations.relatedU url_relations serId = 1 AND users.userId = 1 AND urls.urlId = ur l_relations.relatedUrlId
If we want to traverse each of the personal information and url information, we can do this :
SELECT name, url FROM users, urls, url_relations WHERE users.userId = url_relat ions.relatedUserId AND urls.urlId = url_rela tions.relatedUrlId
5th grade standardized forms
There is a standardized form, it is not common, somewhat esoteric, and in most cases are unnecessary. Its principles are :
1. The original form must be adopted by the alienation of its forms to re-build
The use of the provisions of the benefits is that you can ensure that there is no separation of the forms shown in the introduction of superfluous, All the forms you create structures with their actual needs are as great as ever. Application of this provision is a good habit, but unless you want to deal with a very large data Otherwise, you will not find them.
Hope that this article be useful to you and can help you in all of these application standardization requirements. You may want to know is where do these methods, I can tell you that the regularization of the previous three provisions in 1972, Dr. E.F. Codd in his paper “Further standardization of the database model” of the remaining provisions was later set theory and the theory of the relationship between the mathematician. Comment : is the so-called anti-bound objects. forms to be too small and isolated sometimes not good, because of the need to conduct various forms of association, which will become complicated inquiries, but may also reduce the efficiency and standardization of these provisions refer to the practical application, according to the size of the project, when necessary, conducting some tests, to design a more rational structure of the tables.
Database standardization and design skills
In: CGI-perl| CSS| Comment-Report| Commercial-Economy| Experience-skills| Information-security| Javascript-Ajax| PHP-Mysql| Planning-profits| Product-Alert| SEO| Venture-Guide| XML-XSLT
22 May 2007Dynamic website design, database design importance is self-evident. If poorly designed, the inquiry up on the very difficult process of performance will be affected. Whether you are using a mySQL or Oracle database through standardized forms design, can make your PHP code is more readable and easier, which in turn will also enhance application performance.
In simple terms, standardization of the forms is designed to eliminate redundancy and lack of co-ordination affiliation. In this paper, I will adopt five gradual process to tell you the design should understand the regularization techniques. So as to establish a viable and efficient use of the database. This paper will analyze in detail the relationship between use types.
Here we have to assume that the establishment of a user’s information forms, which must be stored user names, companies, company address and some personal favorites or url. At the beginning, you may definition of a structure of the following forms :
Zero state forms
Users
Name company company_address url1 url2
Work ABC a Joe Lane abc.com xyz.com
Jill XYZ a Job Street abc.com xyz.com
Due to the absence of any formalized, we will table this form of the state is known as the form of tables. Watch the url1 and url2 field — if we need to use third url? This way you will pay more in form one, it is clear that this is not a good solution. If you want to create a rich expansion of the system, you must consider the use of a standardized form, and applied to the table.
First-class form of regularization
1. Eliminate duplication of each form group
2. Related to the data set to establish an independent form
3. The use of a primary key to the identification of relevant data set
The above forms a clear violation of the top of the first, then the third of the primary key is what is the point? Very simple, it only added to each record a unique, automatic increase in the integer value. Through this value, it can be the same as the names of two separate records. Through the use of standardized forms the first level, we have the following form :
Users
UserId name company company_address url
An ABC a Joe Lane abc.com Work
An ABC a Joe Lane xyz.com Work
2 Jill XYZ Street abc.com a Job
2 Jill XYZ Street xyz.com a Job
Now we forms can be said to have at the first-class in the form of regularization, It has solved the url field restrictions, but after the treatment has brought a new issue. Every time the user to insert a table of records, we have to repeat all the companies and user data. This will not only result in large databases than before, it is very prone to error. It is also a second-class regularization.
Second-class form of regularization
1. Application for a number of records in the field to establish an independent form
2. Through a foreign key to the relevance of these forms of value
We will url on the value of an independent form, so that we can in the future to include more data without fear of overlap values. We have also adopted the main keys to these related fields :
Users
UserId name company company_address
An ABC a Joe Lane Work
2 Jill XYZ a Job Street
Urls
UrlId relUserId url
1 abc.com
2 1 xyz.com
3 2 abc.com
4 2 xyz.com
As indicated above, we had to establish an independent form users of the table primary key userid now with the url table foreign key relUs erId Association. Now the situation seems to have been significantly improved. However, if we want to join a company ABC staff records? Or more, 200? Then we must repeat the company name and address, this is obviously not enough redundancy. We will, therefore, the third-grade standardized method :
3rd grade standardized forms
1. Elimination is not dependent on the crucial field
Company name and address and User Id are not related, and they use their own companies Id :
Users
UserId name relCompId
Joe 1 1
Jill 2 2
Companies
CompId company company_address
An ABC a Work Lane
2 XYZ a Job Street
Urls
UrlId relUserId url
1 abc.com
2 1 xyz.com
3 2 abc.com
4 2 xyz.com
We companies will form the primary key comId and users of the table name relC ompId the foreign key relevance, even if ABC company to 200 employees, the companies have only one record. Our users and urls table continues to expand, and not have to worry about unnecessary data insertion. Most of the developers are three steps that the regularization enough, the database The design can easily handle the whole of the burden on businesses, the view in most cases, is correct.
We can look at the url field — your attention to data redundancy? If user input to the users of these data url HTML pages is a text box, indiscriminate importation of the case, This is not a problem, the same two collections of user input folder probability less, but if through a drop-down menu. only allow users to choose two url entry, or a little more. Under such circumstances, our database can also be used for optimizing the next level — the fourth step, For most developers, this step is overlooked, It is because they want to rely on a very special relationship — a many-to-many relationship This in our applications have not encountered before.
Data relations
In the definition and standardization fourth form, I would like to mention three basic data : one-to-one. One-to-many and many-to-many. We look back, after the first regular users of the table. If we url to the field on a separate table for each of the users to insert a table record We will table the urls inserted here. We will be a one-to-one relationships : Table of users each trip will be the urls table to find the corresponding row. For our application, it is neither practical nor standards.
Then look at the second regular example. For each user records, the number of forms to allow urls records associated with it. This is a one-to-one relationship, which is a very common relationship.
For many-to-many relationship, it would be a bit complicated. In the third form of standardization example, our users with a lot of the url. We want to remove the structure to allow multiple users with a number of urls, This way we can be a many-to-many structure. In discussion, we take a look at some form structure changes
Users
UserId name relCompId
Joe 1 1
Jill 2 2
Companies
CompId company company_address
An ABC a Work Lane
2 XYZ a Job Street
Urls
UrlId url
A abc.com
2 xyz.com
Url_relations
RelationId relatedUrlId relatedUserId
1 1 1
2 1 2
3 2 1
4 2 2
To further minimize data redundancy, we used the fourth grade standardized forms. We created a rather strange url_relations table inside the field are the main keys or foreign key. Through the table, we can eliminate the urls table duplication. Following is the fourth regular form of specific requirements :
The fourth form of regularization
1. In a many-to-many relationship, not an independent entity with stored in a form
Since it only applies to the many-to-many relationship, the vast majority of developers can ignore this provision. However, under certain circumstances, it is a very practical, this example is the case, we will be the same entity separated, and will be moved to their own relationship in the table, thus improving the urls table.
To make it easier for you to understand, we cite specific examples, The following will use a SQL statement to select all belong to the joe urls :
SELECT name, url FROM users, urls, WHERE url_relations.relatedU url_relations serId = 1 AND users.userId = 1 AND urls.urlId = ur l_relations.relatedUrlId
If we want to traverse each of the personal information and url information, we can do this :
SELECT name, url FROM users, urls, url_relations WHERE users.userId = url_relat ions.relatedUserId AND urls.urlId = url_rela tions.relatedUrlId
5th grade standardized forms
There is a standardized form, it is not common, somewhat esoteric, and in most cases are unnecessary. Its principles are :
1. The original form must be adopted by the alienation of its forms to re-build
The use of the provisions of the benefits is that you can ensure that there is no separation of the forms shown in the introduction of superfluous, All the forms you create structures with their actual needs are as great as ever. Application of this provision is a good habit, but unless you want to deal with a very large data Otherwise, you will not find them.
Hope that this article be useful to you and can help you in all of these application standardization requirements. You may want to know is where do these methods, I can tell you that the regularization of the previous three provisions in 1972, Dr. E.F. Codd in his paper “Further standardization of the database model” of the remaining provisions was later set theory and the theory of the relationship between the mathematician. Comment : is the so-called anti-bound objects. forms to be too small and isolated sometimes not good, because of the need to conduct various forms of association, which will become complicated inquiries, but may also reduce the efficiency and standardization of these provisions refer to the practical application, according to the size of the project, when necessary, conducting some tests, to design a more rational structure of the tables.