- Someone described normalization rule as "a non-key column depends on the key, the whole key, and nothing but the key, so help me Codd." Key refers a primary or other candidate key of a table. If the key has multiple columns, then "whole key" means all columns together and not just some part of the key. Explain in your words what 3rd normal form is and why it is important.
- What is an SQL view. How is it similar to a table? In what ways is it different?
1. From the research I conducted online, 3rd normal form is where a table is organized in such a way that there are no transitive relationships in this system. This means that the key and associated values of a table are directly related. For example, if you have a table with a course id (primary key), course title, instructor and salary in a table, the instructor and salary columns can be moved into a separate table because the instructor and salary are not dependent on the course id and title.
2. SQL views are a way of modifying an existing table to present the data in a way that may make more sense to the user. One of the best uses for a view is to allow users access to certain parts of the table. This could be for security reasons. A table could contain the social security numbers and salaries of employees. The table may also contain information that employees need but the SSN and salaries should be kept hidden. Using a view the same table could be used but the SSN and salaries left hidden. This allows the original table to maintain it's current form and still allow users to access the table via the protected view.
Comments
Post a Comment