CST 363 Introduction to Database
The third normal form of data ensures data consistency across all tables. First, the data must be in a second normal form. The columns in this format must not have a transitive dependency among non-key attributes. For example, if we have three columns in one table called A, B, and C. If column A is a primary key and column B depends on column A , but column C depends on column B and not column A, this form is a violation of the third normal form. The solution is to create another table for the direct dependent attributes. In other words, "a non-key column depends on the key, the whole key, and nothing but the key, so help me Codd."
An SQL view is the restructure of table columns without
changing the design. The view query is created by a statement called ‘Create
View’ followed by a user-defined name of the view. The outcome of the query is
another table that is different from the base table. SQL view is used in
combination with SQL queries for different purposes. The advantages of SQL view
are producing a table that masks sensitive data from views, generating faster
results with optimal queries, and simplifying the writing of complex queries.
Unlike data tables, SQL view is usually not stored like a
base table. Instead, the view query is executed with the statement.
1
No comments:
Post a Comment