Can any body explain in detail for
1. What is meant by Views, triggers, Normalization?
2. what is purpose of views, triggers, Normalization in sql server?
your question is toomuch theoritical to explain here. It is beyond the scope of this discussion to explain all that here.Please go through some good books ,mauals or u can find vast resources by little web searching
Views aviews are nothing but saved sql statements, and are sometimes referred as “virtual tables”. Keep in mind that views cannot store data (except for indexed views); rather they only refer to data present in tables. Let’s checkout the basic syntax for creating a view: create view as
The unit testing is the part of data base testing. Means a database programmer test the updation,deletion and insertion based on appropiate condition.at particular level
Views:
Views is nothing but a virtual table.will explain with an ex..consider 2 tables A(name,id,title,dob,salary)as the main table and B(id,title,salary)is the view table.In short view is nothing but getting the required/some attributes from the main table and doing some manipulations according to our requirements. Triggers:
This is an implict function call.we can use triggers in case like the following..
if insert/delete into/from
then ...so whenever an insert/delete occurs then the will get TRIGGERED out automatically. Normaliztion:
To remove the reduntant occurence of data.
can be achieved using 1NF,2NF,3NF,4NF,Boycee code
normalisation is removing the redundant data.There are different forms of normalisation like first NF,second NF,
third Nf,fourth NF and BCNF.Arelation is in firstNF if it has no repeated data,similarly a relation is in second NF if and only if it is in 1NF and is functionally dependant on the whole key.
A view is a virtual table that consists of columns from one or more tables.
Though it is similar to a table, it is stored in the database.
It is a query stored as an object. Hence, a view is an object that derives
its data from one or more tables. These tables are referred to as base or
underlying tables.
Once you have defined a view, you can reference it like any other table in a database.
A view serves as a security mechanism. This ensures that users are able to retrieve and modify only the data seen by them.
Users cannot see or access the remaining data in the underlying tables. A view also serves as a mechanism to simplify query execution. Complex queries can be stored in the form as a view,
and data from the view can be extracted using simple queries.
Some common examples of views are:
A subset of rows or columns of a base table.
A union of two or more tables.
A join of two or more tables.
A statistical summary of base tables.
A subset of another view, or some combination of views and base table.
Triggers:
Triggers are a special PL/SQL construct similar to procedures.
However, a procedure is executed explicitly from another block via a procedure call,
while a trigger is executed implicitly whenever the triggering event happens.
The triggering event is either a INSERT, DELETE, or UPDATE command.
The timing can be either BEFORE or AFTER. The trigger can be either row-level or
statement-level, where the former fires once for each row affected by the triggering
statement and the latter fires once for the whole statement.
Normalization is the process of efficiently organizing data in a database.
There are two goals of the normalization process: eliminating redundant data (for example, storing the same data in more than one table)
and ensuring data dependencies make sense (only storing related data in a table). Both of these are worthy goals as they reduce the amount
of space a database consumes and ensure that data is logically stored.