sql - structure
In previous chapter i have explained What are the SQL PredicatesL now i am gonna eplain you What is the Structure of SQL
Designing the right database has a lot to do with what you need to accomplish. A database with thousands and thousands or even millions of records requires a completely different solution than a database that will only have a few hundred records. Think about the future and plan ahead.
sql - table relationships
The key to a large database is having tables with material that can relate to one another. A great example is the employee ID. Ever wonder or joke about being just another number to the company. A lot of that has to do with the way they set up their database. A large company is going to have a weekly payroll and a personal information table. They might be set up like the following:
personal_infoemp_id | last_name | first_name |
0056 | Mynce | George |
0097 | Jenkins | Fred |
emp_id | hours | rateofpay |
0056 | 37.5 | 27.00 |
0097 | 44.5 | 22.25 |
This set up proves useful in several ways. The tables are smaller, more compact, and precise, allowing for maximum access speeds with each query. We can also moderate who has access to each table, meaning that our accountant can have access to the payroll table, but not the personal information table, eliminating security risks.
Relationship tables are the choice for high-traffic databases. There are countless security advantages, faster query returns, and complete view customization (more on this later).
No comments:
Post a Comment