Wednesday 12 February 2014

Conceptual database design component


Conceptual database design component 
  • Entity : an object about which data is collected , it may be a person  place ,event,actual physical object or simply a concept 
-instances : an individual occurrence of an entity 
-external : an entity used to exchange data , but thich is not stored in the database
  • Attribute: an unit fact about a particular entity ; the fact should be atomic(indivisible)
  •  Relationship: an association among entities (see relationship section below)
  •  Business rule: a policy , procedure , or a standard that an organization uses and which dictates certain controls on the data ; often implemented in database as constraint 
Relationship 
  • Maximum cardinality :the maximum number of instances one can be asoociated with
  •  Minimum cardinality : the minimum number of instances one entity can be associated with
  •  Transferable:a relationship is transferable if the parent may change over time
  •  One-to-one
-conditionally in one direction : mean that a corresponding record may or not be found in the optional side of the relationship 
-Conditionally on bot direction : mean that corresponding record may or not be founf on both side of the relationship 
-Mandatory in both direction :mean that corresponding record must be found on both side of relationship 
  •  One-to-many: indicates that a record in one table may be related to many (usually +0)record in another table
  •  Many-to many:this can be thought of as one -to-many relationship that goes in both direction , many-to-many relationship are not natively supported in relational databases , but there are ways to convert them into something that can be handled
  • Intersection data:data that is associated with two related entities in a many-to-many relationship and which only makes sense when associated with both related entities ;intersection data can be placed(mapped) into a separated table to help relational database handle the many-to-many relationship 
  •  Recursive : refers to relational between instances of the same entity type 
  •  Column:the smallest named unit of data in a database
-must be given a data type
-helps the database store data efficiently
-restrict attribute values to the correct data type and provide set of behaviour consistent with the specified data type (such as addition,subtraction,etc.for numbers)
-unfortunately , different vendors support differing zoos of data type .
  •  Constraint :rules that restrict allowable data values 
-primary key:one or more columns that uniquely identify  a particular row in a table
-the constraint is that duplicate vales are not allowed in the primary key column(s) of a table
-primary keys are usually implemented as an index
-an index speeds up searches
-foreign key:a field on the many side of a one-to-many relationship that uniquely identifies one row in another table (usually by using the primary key in latter table)
-referential constraint:
   -can check for parent record when inserting new child record (using the child''s record foreign key to check for a matching parent record )
- don't allow modification of child record's foreign key if the new value is not represented by an instance in parent table
 -can delete all matching child record when a parent record is deleted
-Intergrity constraint: used to make sure field (attribute) values that are invalid are not allowed 
      -may check for a range of values ore specific valid values 
      -may check for NOT NULL
-triggers : A triggers is a program stored in the database that run when a specific event happen .Triggers can be used to validate data(among other things)
  • Surrogate key : a key used to replace what would be the natural key for an entity 
  •  Views : refer to the way different users may see the same database differently
-views are stored queries (virtual tables ) 
-views can hide column (cleaner , more secure)
-view can hide table ( cleaner , more secure)
- view can hide complex operation such as joins
 - view may improve query performance

No comments:

Post a Comment