Professional Documents
Culture Documents
Lalit mohit
19 20
BCA BBA
In the above table values corresponding to the field name is known a data item for example- lalit, 19, BCA 2. Entity and attribute: Entity: Any object which can be describe or define is known as entity. Entity are ways related to the world all such items which have some relevant information to be strode is known as data base entity entity could be physical and non physical, tangible or integrity For eg- student, EMPloyee etc. Attribute; each entity has a set of particular properties that completely describe it in context of mini world model. The entity properties are called its attributes which describe any object for eg an EMPloyee entity may have the attributes like name EMP_id, address date of birth etc. 3. Logical data and Physical data: The term logical data or structure refers to the way the programmer see it and physical sutured refers to the way the data are actually recorded on the storage media. 4. Schema and sub schema: Schema it is a logical data base desecration and is down as a chart of types of data that are used it gives name of entities and attribute and specific the relation ship between them. The is a frame work in which data values can be fitted for eg information display system such as that give arrival and departure timing of flight at airport. The schema will remain same but values are change time to time the entire format need to be change FLIGHT ARRIVAL Departure NO TIME time AC001Z 9.00 10.30 AC017T 10.00 11.00 Sub schema the term sub schema refers to the same view but the data item type and reward type which are used in a particular application or by particular user. Therefore many different sub schema can be derived from main schema. A simple analysis distinguished between schema and sun schema may be that if the schema represented root map of Delhi showing major historical site educational institute railways station airport etc a subschema could be similar map showing route each from railway station or form air port. 5. Data dictionary it hold detail information about the different structure and data type. The different structure and data types the details of logical structure that are mapped into the differs form details of relationship between data item details o a all users privileges and access right and performance of recourses wit detail. PROPERTIES OF DBMS
3. End users: people whos job require access to database for query updating and generating report are end users. They carry out their jobs either through application or by user program. 4. System analyst: System analyses determines the requirement of end users and develop specifications for transaction. 5. Application programmer: AP implements specification and programs developed by the analyst so that the specification becomes operational. 6. DBMS system designer and implementation: if somebody has to design and implement the DBMS module and interface as software package to be subsequently used. 7. Tool Developers: tool are package of process used are not used very often but are very important for users at various level
ADVANTAGES OF DBMS 1. Redundancy control: centralized control of data be DBA avoids unnecessary duplication of data and effectively reduces the total amount of data storage required Controlling redundancy in data storage and independent and maintained efforts insure that information is not repeated many times at many places but stored in single copy which save cost and space and avoiding multiple updating in case a data item is need to be exchanged. 2. Access control: DBA uses security and authorization around restriction a DBA has full control on who can use the data in what ways. 3. Persistent for program object and data structure: The object stored in data base survive the termination of program execution and can later be retrieve the data remains in the data base even after it has been used many time by users. 4. Multi-user Interface: DBMS provide multi user interface may be implemented in any of the programming language have compatibility with data base. 5. Complex Relationship Representation: any amount of complexity in the relationship of given data item can be concisely represented by the database capability to retrieve and update data easily and effacingly 6. Integrity constraint enforcement: DBMS have capability for defying ad enforcing constraint that must be satisfied by the data entering by the system and used by to process 7. Backup and Recovery: A DBMS is a subject to failure due to many reasons DBMS provide facility for recovering from such software ad hardware failure 8. Data Sharing: since data is stored a single copy many user can use the same without the need of having separate data for each user. DBMS provide such facility. 9. Standard Enforcement: A no of international standard may be enforced in the certain and operation of data base. 10. Flexibility to change data structure: due to data abstraction data structure of data base can be modified without distrusting the data base users. 11. Reduced application development time: the effort required to develop user utility reduces considerably and so does the time 12. Availability of update information: the data base always has latest state providing each user with the up to date information all the time. DISADVANTAGES OF DBMS 1. Cost: the data base system is a combination of h/w and s/w and training intensive and calls for a large cost is not justified for a particular situation it is advisable to look for a cheaper alternative. 2. DBMS are very general in nature if the solution are required for a very specific purpose it is better to have non- DBMS system.
THEREE VIEWS OF DATA DBMS is a collection of interrelated files and sets of program that allow several user to access and modify files. Major purpose of a data base system is to provide user with an abstraction view of data system hide certain details of how the data is stored and maintain since DBMS system are often used system this is done by defining level be view. There are logical view or external view or connectional view and internal or physical view. 1. External view: this is the highest level of abstraction as seen by a user this level of abstraction describe only the part of entire data base. 2. Conceptual view: At his is the next higher level of abstraction which is the sum total of user view. This level describe what data are actually stored in database in term of small number of relatively simple structure 3. Internal view: This lowest level of abstraction at which one describe how the data are physically stored. The interrelationship of three level of abstraction is given internal view. The view at each level is describing by a schema as mention earlier is an outline or a plan that describe the records ands relationship exiting in the view. The schema also describe in the way in which entity one level of abstraction can be mapped to the next level of abstraction the overall data base design is called format their exist several schema in the data base these schema are:Portioned into the following level of abstraction 1. At lower level we have physical schema 2. At intermediate level we have conceptual schema 3. At higher level we have several sub schema The general any data base contain one physical schema one conceptual sub schema several sub schemas. 1. External level or sub-schema: the external level is at the highest level of data base abstraction are concern to a user or application where any those person of data base are concern to a user or application programs are concern to a user or application program are included any number of user may exit for a given global or conceptual view. 2. Conceptual level schema: at this level of data base abstraction all the data base entity and the relation ship among them. Them are included in conceptual view. It describe all the record and relationship including in the concept view ad there fore in the database there is only one concept schema per data base. This schema also
Various component of ER-model. a) Entity: it is a thing or any object physical exquisite. Eg car house and any person in the real world it may be object with a conceptual existence. Eg: job university course etc. b) Attribute: each entity has asset of a particular property that complexly describe any entity in context of mini world. Each property is called attributes there are various types of attributes. simple: each entity has as single atomic values for the attribute is known as simple attribute. Eg- name of any student Composite attribute: the attribute may be composed of several components Eg address of any person include house no, road no, sector no, city state and pin code.
ADDRESS
STREET
CITY
STATE
PIN CODE
HOUSE NO
ROAD NO
SECTOR NO
Multi value attribute: an entity may have multiple values for the attribute. Any attribute which can have more than one value for that attribute is known as multi valued attribute. Eg- degree attribute of a student can contain BCA, MCA, MBA
c) Entity type and set: an entity type defines a collection of entities that have the same attributes EMPloyee entity type and company entity type. An entity is an instance of entity type all entity having the same set of properties are grouped into an entity type. The collection of all entitles of a particular entity type in a data base in any point in time is called entity set. d) Relationship
Relationship between entity set 1. One to one: in this relationship one instance of first entity is related to exactly one instance of second entity. 2. One to many: one instance of first entity is related to one or more instances of second entity. 3. Many to one: one or more instance of first entity is related to exactly one instance of second entity. 4. Many to many: many instances of first entity to many instances of second entity. The overall logical structure of database can be expressed graphically by an ER-Diagram which is build up by following component Component Represents 1. 2. 3. 4. Rectangle Ellipses Diamond Lines Entity set Entity attribute Entity relationship link between entity
CHARACTERISITICS OF ER-MODEL Abstraction: it is the simplification mechanism. It is used to hide super flow details of set of object. It allows one to consternate on the property that are interested in the application. Example car is an abstraction of personal vehicle but doesnt revel details about model year of manufacturing colors and so on. There are two main abstraction mechanism used in:Generalization: it is an abstraction process of set of object as a single general characteristics of any specific entity while ignoring the basic details related to it is the union of no of lower level entities types for the purpose of producing a high level entity set. Eg: STUDENT is generalization of graduate and undergraduate STUDENT can be part time or full time. Specialization: it is an abstraction new characteristic of an existing class of object to create one or more new classes of object. This involves taking a higher level entry and using additional characteristics generating by lower level entity. The lower level entity also inherits the chrematistics of higher level entities specialization may be seen as reverse process of generalization. The entity set EMPloyee is a generalization of full time EMP. And part time EMP full time EMP is again a generalization of faculty and staff where as part time EMP. Is generalization of teaching and non-teaching EMP. The top down approach in the the diagram represent specialization and bottom up approach represent generalization.
Aggregations: it is the process of compiling information on an object and there by abstracting higher level object. Example- an entity PERSON is derived by aggregating the charactisicts like name, address, phone no, another form of aggregation is the abstraction between the object and relationship. Example: enroll is the relationship between two entitles students and course. This whole relationship may be viewed as entity
PERSON
NAME
ADDRESS
PHONE NO
. HERARICHAL MODEL In the hierarchal database model data is organized in a hierarchal in a ordered tree structure and the database is a collection of disjoint tree list organization chart. A hierarchal is a ordered tree and it is a easy to understand. At the root of the tree their have none. One or more then one child mode. The mode of the tree represent the record type each tree efficiency representing a root record type. It we define the root record type to be level zero then the level of its dependent record type can be defined as level-1 . the dependence of record type at level are set to be level-2 and so on. An occurrence of hierarchal tree type consist of one occurrence of root record type along with zero or more accuracy of its dependent sub tree, each type dependent sub tree in true, hierarchal and consist of record type as its root node, the node having no child means that there is no dependent node on it is known as leaf node. Hierarchal mode represent a one to many relationship between two entities whose both the entity have child and parents. ADVANTAGES 1. Simplicity:in this form data is easy to represent and understand 2. Security:the data base system can enforce various degree of security feat users 3. Database integrity: because of inheritance feature the degree of integrity is high 4. Efficiency:for one to many relationship type of database it is easy to maintain and manager all the sub entities and children.
DISADVANTAGES 1. Complexity of implementation: the actual implementation of hierarchal database depends upon the physical storage of data. This makes implementation complicated. 2. Difficulty in management: the movement of data segments from one location causes all excising program to be modified making database management a complex affair.
NETWORK MODEL Network model was developing during 1980 by database task group. A network database consists of collection of records connected to one another through links. A relationship in this model is known as set. A link is association between process b/w two records. A link can be viewed as restricted binary form of relationship. The structure of network database resemble closely with hierarchal. The major difference between the two is that the hierarchal database each record can have only one parent. But there can be more parent in the network database model. Therefore the relationship represent the hierarchal database is one to many but in network database it could be many to many. NAME Neha Amit rohit STREET 86-trinagar a-1 Rohini 45-s Azadpur CITY Delhi Delhi Delhi A/C NO 5-56 5-52 5-51 BALANCE 60000 50000 40000
ADVANTAGES 1. Simplicity: since most of the database relationship instances are naturally many to many this database structure is simple to design 2. Better relationship handling: many to many relationship can accommodate most of the complex relationship existing in actual data relationship scenario 3. Flexibility in data access: data item can be navigated in more than one way providing much desired flexibility of data access. 4. Standards: Universal standard have been developed and enforce in these types of database.
DISADVANTAGES System complexity: Structural dependency: since access depends upon the navigational path that exist in database at any time. The programs are not independent of database structure and need to be modifying whenever database structure is modify.
RELATIONAL MODEL Relational model was introduced in 1970 by Dr. E. I. Codd. This data model was evolved using theoretical considerations based on relation calculus by being simple in principle and the sure can express their queries by using powerful query language. In this model the relation is the only construct to represent the association among the attributes of any entity as well as the relationship among the different entity the one of the main reason for this introducing the model was too increase the productivity of the application program by eliminating the need of change of application program when change is made to database users need not to know the exact physical structure to use the database and protected any change made to these structure they are however still require to know how the data has been partition into various relation. In this model the user need not to know the navigational path to data. Row of the relation are referred as topple and column are referred as attributes each attribute of a relation has a distinct name the values for a attribute or a column are drawn form a set of value know as domain. A relationship between the two relation is represent as ER model by combining primary key of entity involved in the relation and attribute a correspondence between the two relation is implied by data value of the attribute. In he relation defined on common domain. POSITION PO_ID DESIGNATION 301 MANAGER 302 DIRECTOR 303 FACULTY 304 MANGER 305 FACULTY 306 MANAGER
EMPLOYEE EMP NAME 101 NEHA 102 ANJU 103 AMIT 104 PRIYA 105 ROHIT
In this example both EMPloyee and position contain identical name attributes designation defines on common domain; consequently we join these two relations to form a new relation position eligibility using common values of attributes designation. Joining the two or three times taking the value two or there time.
NAME NEHA
DESIGNATION MANAGER
ADVANTAGES OF RDBMS 1. Structure independence: since there is no need of navigational arrangement for data access, this database offers complete structural independence. Any change in the structure of database doesnt effect DBMS data access mechanism the program therefore doesnt need any modification even when the structure is modify. 2. Simplicity of design and use: relational database providing data independence and strut aural independence therefore design and implementation is easier then other type of database. 3. Advance query capability: query in database system is very simple highly efficient and very powerful tool. It support SQL because both of their foundation in relational algebra and relation calculus. DISADVANTGAE System Overhead: Relational database has one disadvantage I,e it increase overhead on system because it has to handle most of the responsibility of users.
OBJECT ORIENTED DATA MODEL With the popularity of object oriented technology the need for object oriented database arise when database capability are integrated with OOPs language it is known as object DBMS an ODBMS makes database object appears as programming language object in one or more oops language with the feature of DBMS like concurrency control, data recovery and advance query capability. Some of the example of object oriented language is:C++, C#, JAVA ODBMS provides low cost development and bets performance combination when using the object oriented language because they stored object on disk
OBJECT RELATIONAL DATA MODEL This model support object oriented and relational concept in this model it is possible to provide well define interface for the application it facilitates the reusability of data object a structure once created can be sense which is the fundamental property of object oriented data model. Oracle is the best example of this kind of model. ADVANTAGES 1. Simplicity of design: Because of object oriented this approach is orientation approach is simple to design 2. Data base integrity: it is assured to the maximum level because of inheriting saving of object. 3. Symantec content handling: object orientation of data in object oriented database carriers proper meaning of each and every object. 4. Structure to data independence: object relational database provide structure and data independence. DISADVANTAGES 1. Increase system overhead: 2. Lack of standards: object oriented data model does not therefore object relational database uses specific standard.
CHAPTER-3 Relational data manipulation INTRODUCTION This model was introduce be TODCORK ins 1970 that user the concept of mathematical hence the database is considered as a collection of relations. A relation is a table where each row represent a set of data values. A row in the table called tupple and columns are attributes. A relational schema (R) is denoted as R(A1,A2,A3.Ai) Where R is denoted as R(A1,A2,A3.) where R is relation name and A stands for attributes. The degree of relation depends upon the number of attributes used in a relation. For e g. In a relational schema students (roll no, name, course) there are 3 attributes so the degree of relation will be three. CHARACTERSTIC OF RELATION 1. A tupple can be considered as set of attributes and value. For e.g. t1(<Roll No, 101>,<Name, Amit>,<Course, BCA>) 2. Tupple odering is not a part of relation for e.g. t1(<name, Amit>,<Roll No,101>,<Course, BCA>) RELATIONAL MODEL NOTATION
1. 2. 3. 4. 5.
A relational schema R1 is denoted as R(A1,A2,.Ai) A tupple in a relation is denoted as t1=(V1,V2,Vi) The letter Q,R,S denotes relation name. The letter t,u,v denotes tupple. An attributes A can be qualified with the relation name R using the denotes tupple For e.g. student, Roll no, Student, Name
1) DOMAIN CONSTRAINTS The set of all the values that an attribute can accept is known as domain of attributes. The domain constraint specify that the value of each attributes Ai must be atomic domain or dom(Ai) atomic domain are general set such as set of integers real no character string and so on. Domain on any attribute restrict the attribute from taking the value other then the set of domain domain constraints for e.g an attributes name can have data type string or its length could be 10 character long. Another constraint that applied on any attributes is NULL constraint. The absence of particular attribute values in a tupple is expressed by NULL, present the value is not attributes. But if not null constraint is applied on attribute then it cant accept NULL values i,e there must be any value in all tupple of that attributes.
2) ENTITY INTEGRITY CONSTRAINT It implies that if an attribute A of a relation R is a primary attribute then A cant accept NULL value this constraint is applied on primary key and restrict it from having NULL value become if any instance of primary key are permitted to have NULL then the key cant be used as a unique key.
3) REFERENTIAL INTEGRITY CONSTRAINTS Referential integrity constraint status that two relations referred to each other then a relation having a foreign key which is a primary key of another relation must have a value which is from set of value from table in which it is a primary key or it may be null. This rule is concerned with the foreign key that is with the attribute of a relation having domain that are those of primary key of another relation. Suppose these are two relations S and R. R refers to the relation and S to the set of attribute that form a primary key of a
Here relation EMPloyee refers to the relation manager through mgr_id which is the primary key of manager. So manager Id is a foreign key of EMPloyee relation.
Pseudo Examples
SELECT from A where C2 is equal to 1 = R-5
PROJECT
Returns all values for selected attributes, showing a vertical view of a table. A JOIN E ON C1 and C3 (natural) = R-7
JOIN
Combines two or more tables, using natural, equi, theta, left outer or right outer joins. A JOIN E (left outer) = R-8
A UNION B = R-1
UNION
Combines all rows in one table with all rows in another table, without including duplicates.
A INTERSECT B = R-2
INTERSECT
Compares two tables and combines only the rows that appear in both tables Compares to tables and returns all rows that are found in the one, but not the other table. A DIFFERENCE B = R-3
DIFFERENCE
A PRODUCT E = R-10 Create all possible pairs of rows from two tables, resulting in the Cartesian Product
PRODUCT
DIVIDE
Weird operator, where the one table has two columns and the other table one column. Returns value of Column 2, which is associated with every value of Column 1 in both Table 1 and 2. Weird ...
C DIVIDE D = R-4
Mathematical set theory based relations: UNION, INTERSECTION, DIFFERENCE, and CARTESIAN PRODUCT. Special database operations: SELECT (not the same as SQL SELECT), PROJECT, and JOIN.
PROJECT The PROJECT operation is used to select a subset of the attributes of a relation by specifying the names of the required attributes. For example, to get a list of all EMPloyees surnames and EMPloyee numbers:
PROJECTsurname,EMPno(EMPloyee)
SELECT and PROJECT SELECT and PROJECT can be combined together. For example, to get a list of EMPloyee numbers for EMPloyees in department number 1:
UNION of R and S The union of two relations is a relation that includes all the tupples that are either in R or in S or in both R and S. Duplicate tupples are eliminated. INTERSECTION of R and S The intersection of R and S is a relation that includes all tupples that are both in R and S. DIFFERENCE of R and S The difference of R and S is the relation that contains all the tupples that are in R but that are not in S.
They have the same number of attributes The domain of each attribute in column order is the same in both R and S.
UNION Example
Figure : UNION
INTERSECTION Example
Figure : Intersection
DIFFERENCE Example
Figure : DIFFERENCE
CARTESIAN PRODUCT The Cartesian product is also an operator which works on two sets. It is sometimes called the CROSS PRODUCT or CROSS JOIN.
JOIN Operator JOIN is used to combine related tupples from two relations:
In its simplest form the JOIN operator is just the cross product of the two relations. As the join becomes more complex, tupples are removed within the cross product to make the result of the join more meaningful. JOIN allows you to evaluate a join condition between the attributes of the relations on which the join is undertaken.
JOIN Example
Figure : JOIN
In most systems a natural join will require that the attributes have the same name to identify the attribute(s) to be used in the join. This may require a renaming mechanism. If you do use natural joins make sure that the relations do not have two attributes with the same name by accident.
OUTER JOIN Notice that much of the data is lost when applying a join to two relations. In some cases this lost data might hold useful information. An outer join retains the information that would have been lost from the tables, replacing missing data with nulls. There are three forms of the outer join, depending on which data is to be kept.
LEFT OUTER JOIN - keep data from the left-hand table RIGHT OUTER JOIN - keep data from the right-hand table FULL OUTER JOIN - keep data from both tables
DIFFRENCE OF DBMS AND RDBMS DBMS: 1)In DBMS no relationship concept 2)It supports Single User only 3)It treats Data as Files internally 4)It supports 3 rules of E.F.CODD out off 12 rules 5)It requires low Software and Hardware Requirements. 6)FoxPro, IMS are Examples
RDBMS: 1)It is used to establish the relationship concept between two database objects, i.e, tables 2)It supports multiple users 3)It treats data as Tables internally 4)It supports minimum 6 rules of E.F.CODD 5)It requires High software and hardware requirements. 6)SQL-Server, Oracle are examples
CHAPTER-4 Relational database design HOW TO DESIGN A DATABASE PURPOSE The problem with data is that it changes. Not just its individual items' values change, but their structure and use, especially when kept over extended periods of time. Even for public records that may have been kept for hundreds of years, there are occasionally changes in what data elements are captured and recorded and how. Therefore, a method to avoid problems due to duplication of data values and modification of structure and content has been developed. This method is called normalization. You normalize a database in order to ensure data consistency and stability, to minimize data redundancy, and to ensure consistent updatability and maintainability of the data, and avoid update and delete anomalies that result in ambiguous data or inconsistent results. SOME KEY CONCEPTS Before we continue, I would like to show the correlation between the formal names of Tables, Rows, and Columns in Relational Theory and their more common counterparts: Formal Name Common Name Also Known As Relation Table Entity
A PRIMARY KEY is one or more columns whose values uniquely identify a row in a table (See rule #2 above). A CANDIDATE KEY is one or more columns whose values could be used to uniquely identify a row in a table. The Primary Key is chosen among a table's Candidate Keys.
RELATIONAL DATABASE DESIGN The process of obtaining a set of relation along with respective control if any is known as database design although tables will suffer from a no of difficult when database operation are perform on them subsequently this indicates bad database design. A good database design doesnt have such problem clearly different designer would arrive at different design one being better then other in some aspects exactly what makes a database design good is that it offers both space efficient and process efficiency. Could be taken as reasonably good designer in other word database should occupies minimum storage space and yet eliminate the following problem. 1. 2. 3. 4. 5. 6. 7. Redundancy Inconsistency Insertion Anomalies Deletion Modification Functional Dependency Un-Normalization
NORMALISATION Normalization is the formalization of the design process of making a database compliant with the concept of a Normal Form. It addresses various ways in which we may look for repeating data values in a table. There are several levels of the Normal Form, and each level requires that the previous level be satisfied. The normalization process is based on collecting an exhaustive list of all data items to be maintained in the database and starting the design with a few "superset" tables. Theoretically, it may be possible, although not very practical, to start by placing all the attributes in a single table. For best results, start with a reasonable breakdown Normalization the goal of relation database to generate a set of relation that allows storage of information without unnecessary redundancy yet permits to retrieve information easily the right approach is to design the schema as that are in appropriate normal form some of the process of removing functional dependency from a relation is know as normalization. It is processes of organizing the data in database in such a way so as to protect all the rules or guide line of database design and to eliminate the problem like data redundancy and operating anomalies it is basically a process of decomposability method in which a relation having under desirable dependency is split into two or more
FIRST NORMAL FORM If the value of a relation instance is atomic for every attribute in a relation then relation is said to be in first normal form. The attribute item line is not a single attribute but it is composed of many attribute besides this is the number of item line is variable this form is not suitable for storage as a file in a computer further retrieval of data is difficult to fine out how many item with a specified item code are ordered one must breakup the composite attribute first before attEMPting a search that way this relation is said to be un normalized to normalized this relation a composite attribute is converted into individual attribute after doing this common value for a composite attribute are duplication as many time as there are line in composite attribute. ORDER NO ORDER ITEM QUNTITY PRICE/UNIT DATE CODE 101 020199 111 52 50 101 020199 333 30 60 101 020199 222 20 17 102 040299 444 45 20 102 040299 333 30 60 103 120499 333 40 60 The above form this form is also called that file as there are no composite attribute and every attribute single and describe one property. Functional dependency: ORDER NO Order Date ITEM CODE Price ORDER NO Item code Quantity
SECOND NORMAL FORM A relation is said to be in second normal form if it is in first normal form non-key attribute is functionally dependent on key attribute if the key has more then one attribute then no non-key attribute. The above example is in first normal form in which key is order no. and item code. The following dependency is existing in the table. ORDER NO Order Date
QUNTITY 52 30 20 45 30 40
After transforming the relation form first normal form to second normal form repetitive data like order date has been remove further if an order for an item is cancelled the price of an item is not lost.. for example if the order no 102 for the item code 444 is removed in first normal form table then the forth row will be remove and the price of item is lost but after converting it in second normal form this with not be a problem. THIRD NORMAL FORM A relation is said to be in third normal form if it is in 2nd normal and non-key attribute of a relation is functionally dependent on any other no-key attribute. ROLL NO NAME DEPARTMENT YEAR HOSTEL 101 Neha Physical Edu 1 Ganga 102 Priya Chemistry 1 Ganga 103 Lalit Maths 2 Krishna
Here roll no is the key and all the other attribute re functionally dependency on it this table is in second normal form in which it known that in the. Collage the first year students are accommodated in Krishna and year student in Krishna and third year in Kaveri and year in Godawari them non-key attribute hostel name is department on key attribute year.
NAME DEPT YEAR HOSTEL The dependency of hostel name on year Leeds to duplication of data. If it is decided to ask all the first year student to move to Kaveri hostel all the second year student to move to Ganga hostel this change should be made at many place also if the student roll no 106 left the collage the information regarding Godawari hostel is deleted so this table is not in third to transform third we will introduce another relation which include the functionality related to non-key attribute. ROLL NO 101 102 103 104 105 106 NAME Neha Priya Lalit Nitin Mohit Kunal DEPARTMENT YEAR Physical edu Chemesrty Maths Botany Geology Zoology 1 1 2 2 3 4
ROLL NO
YEAR 1 2 3 4
BOYCE CODD NORMAL FORM Reduce third normal form entities to Boyce/Codd normal form (BCNF) by ensuring that they are in third normal form for any feasible choice of candidate key as primary key. In short, Boyce Codd normal form (BCNF) addresses dependencies between columns that are part of a Candidate Key. Some of the normalizations performed above may depend on our choice of the Primary Key. BCNF addresses those cases where applying the normalization rules to a Candidate Key other than the one chosen as the Primary Key would give a different result. In actuality, if we substitute any Candidate Key for Primary Key in 2NF and 3NF, 3NF would be equivalent with BCNF. In a way, the BCNF is only necessary because the formal definitions center around the Primary Key rather than an entity item abstraction. If we define an entity item as an object or information instance that correlates to a row, and consider the normalization rules to refer to entity items, this normal form would not be required. EXAMPLE:-Consider a scenario of a large development organization, where the projects are organized in project groups, each with a team leader acting as a liaison between the overall project and a group of developers in a matrix organization. Assume we have the following situation:
Each Project can have many Developers. Each Developer can have many Projects. For a given Project, each Developer only works for one Lead Developer. Each Lead Developer only works on one Project. A given Project can have many Lead Developers.
In this case, we could theoretically design a table in two different ways: ProjectNo Developer Lead Developer 20020123 John Doe Elmer Fudd 20020123 Jane Doe Sylvester 20020123 Jimbo Elmer Fudd 20020124 John Doe Ms. Depesto Case 1: Project Number and Developer as a Candidate Key can be used to determine the Lead Developer. In this case, the Lead Developer depends on both attributes of the key, and the table is 3NF if we consider that our Primary Key.
Case 2: Lead Developer and Developer is another Candidate Key, but in this case, the Project Number is determined by the Lead Developer alone. Thus it would not be 3NF if we consider that our Primary Key. In reality, these three data items contain more than one relation (Project - Lead Developer and Lead Developer - Developer). To normalize to BCNF, we would remove the second relation and represent it in a second table. (This also illustrates why a table is formally named a relation.)
Lead Developer Developer Elmer Fudd Elmer Fudd Sylvester Ms. Depesto John Doe Jimbo Jane Doe John Doe
ProjectNo Lead Developer 20020123 Elmer Fudd 20020123 Sylvester 20020123 Elmer Fudd 20020124 Ms. Depesto
FOURTH NORMAL FORM Reduce Boyce/Codd normal form entities to fourth normal form (4NF) by removing any independently multivalued components of the primary key to two new parent entities. Retain the original (now child) entity only if it contains other, nonkey attributes. Where BCNF deals with dependents of dependents, 4NF deals with multiple, independent dependents of the Primary Key. This is a bit easier to illustrate. Let us say we wanted to represent the following data: Manager, Manager Awards, and Direct Reports. Here, a Manager could have multiple Awards, as well as multiple Direct Reports. 4NF requires that these be split into two separate tables, one for Manager Awards, and one for Manager - Direct Reports. We may need to maintain a Managers table for other Manager attributes. This table:
Awards
Manager
Awards
Scrooge McDuck Stingy John Mouse of the Month Minnie Mouse Minnie Mouse Clara
Direct Reports Table
FIFTH NORMAL FORM Reduce fourth normal form entities to fifth normal form (5NF) by removing pair wise cyclic dependencies (appearing within composite primary keys with three or more component attributes) to three or more parent entities. This addresses problems that arise from representing associations between multiple entities with interdependencies. Making it 5NF consists of adding parent tables, one for each meaningful combination that has children in the original table. A table with such information is 5NF if the information cannot be represented in multiple smaller entities alone. An example of such a situation may be the representation of Actors, Plays, and Theaters. In order to know who plays what and where, we need the combination of these three attributes. However, they each relate to each other cyclically. So to resolve this, we
Billy Bob Catcher in the Rye West 42nd Catcher in the Rye West 42nd Catch-22 Hamlet Cats Cats Broadway Broadway West 42nd Darlington
FUNCTIONAL DEPENDENCIES NOW are going to discuss functional Dependencies. For our discussion on functional dependencies assume that a relational schema has attributes (A, B, C... Z) and that the whole database is described by a single universal relation called R = (A, B, C, ..., Z). This assumption means that every attribute in the database has a unique name. What is functional dependency in a relation? A functional dependency is a property of the semantics of the attributes in a relation. The semantics indicate how attributes relate to one another, and specify the functional dependencies between attributes. When a functional dependency is present, the dependency is specified as a constraint between the attributes. Consider a relation with attributes A and B, where attribute B is functionally dependent on attribute A. If we know the value of A and we examine the relation that holds this dependency, we will find only one value of B in all of the tupples that have a given value
SQL stands for structured query language and it is also pronounce as SEQUEL. It is the most popular database query language support SQL. SQL is set of command that program and user may use to access data within the database tools are used to access
SQL OPERATORS 1) BETWEEN OPERATOR: It test for value between and inclusive of low and high range for e.g. We want to see those Employee whose salary b/w 1000 to 2000 we need to perform following query. Select name salary from EMP. Where salary b/w 1000 and 2000. 2) IN OPERATOR: It test for value in specified list for e.g to find out all Employee who have one of the three ID nos. 7902,7566,7788 Syntax Select<attribute list> Form<table name> where attribute in(V1,V2,V3.Vn); e.g select name, salary, ID, from EMP where ID(7902,7566,7788); 3) LIKE OPERATOR: Sometimes you may not know the exist value to be searched using the like operator it is possible to select a row that match a character pattern. Select* from EMP Where name like S%; 4) IS NULL: This operator specify test for value that are null. For e.g to find all Employee who have no commission the following query will be given. Syntax: Select*from<table name> Where commission is NULL; is not null
Ques5: what do you mean reports in MS-ACCESS write steps to create report using wizard and using auto report. Ans: A report is an effective way to present your data in a printable format. It provide a flexible way of viewing and printing summary information with the help of report we can have detained information at the required level picture, graphics, statically evaluated can be inserted in report to mark it more printable. The information on a report may be derived table queries report are used for:1. Presenting information in a customized way both on screen and on paper. 2. Grouping and sorting data according to your need and in order toy want. 3. Calculating avg, fields tool and drawing groups. Important point to be kept in mind while planning for reports: Generally hard copy of the report is used to communication database information with manager, Employee and client. A clearly designed and well organized report is required to present the database information in an effective manner > Following point should be kept in mind while designing a report. 1. Identify a meaningful title for the report. 2. Determine he fields and members that the report will present. 3. Decide how those fields should be sorted and grouped within the report. 4. Determine how the records should be sorted a grouped within the report.