A database system is composed of four components; Data Hardware Software Users which coordinate with each other to form an effective database system. 1) Data - It is a very important component of the database system. Most of the organizations generate, store and process 1arge amount of data. The data acts a bridge between the machine parts i.e. hardware and software and the users which directly access it or access it through some application programs. Data may be of different types. User Data - It consists of a table(s) of data called Relation(s) where Column(s) are called fields of attributes and rows are called Records for tables. A Relation must be structured properly. Metadata - A description of the structure of the database is known as Metadata. It basically means "data about data". System Tables store the Metadata which includes. - Number of Tables and Table Names - Number of fields and field Names - Primary Key Fields Application Metadata - It stores the structure and format of Queries, reports and other applications components. ' 2. Hardware - The hardware consists of the secondary storage devices such as magnetic disks (hard disk, zip disk, floppy disks), optical disks (CD-ROM), magnetic tapes etc. on which data is stored together with the Input/Output devices (mouse, keyboard, printers), processors, main memory etc. which are used for storing and retrieving the data in a fast and efficient manner. Since database can range from those of a single user with a desktop computer to those on mainframe computers with thousand of users, therefore proper care should be taken for choosing appropriate hardware devices for a required database.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 2
3. Software - The Software part consists of DBMS which acts as a bridge between the user and the database or in other words, software that interacts with the users, application programs, and database and files system of a particular storage media (hard disk, magnetic tapes etc.) to insert, update, delete and retrieve data. For performing these operations such as insertion, deletion and updation we can either use the Query Languages like SQL, QUEL, Gupta SQL or application softwares such as Visual 3asic, Developer etc. 4. Users - Users are those persons who need the information from the database to carry out their primary business responsibilities i.e. Personnel, Staff, Clerical, Managers, Executives etc. On the basis of the job and requirements made by them they are provided access to the database totally or partially. The various types of users which can access the database are:- Database Administrators (DBA) Database Designers End Users Components of a DBMS DBMSs are the technology tools that directly support managing organizational data. With a DBMS you can create a database including its logical structure and constraints, you can manipulate the data and information it contains, or you can directly create a simple database application or reporting tool. Human administrators, through a user interface, perform certain tasks with the tool such as creating a database, converting an existing database, or archiving a large and growing database. Business applications, which perform the higher level tasks of managing business processes, interact with end users and other applications and, to store and manage data, rely on and directly operate their own underlying database through a standard programming interface like ODBC.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 3
Database Engine: The Database Engine is the core service for storing, processing, and securing data. The Database Engine provides controlled access and rapid transaction processing to meet the requirements of the most demanding data consuming applications within your enterprise.Use the Database Engine to create relational databases for online transaction processing or online analytical processing data. This includes creating tables for storing data, and database objects such as indexes, views, and stored procedures for viewing, managing, and securing data. You can use SQL Server Management Studio to manage the database objects, and SQL Server Profiler for capturing server events.
Data dictionary: A data dictionary is a reserved space within a database which is used to store information about the database itself. A data dictionary is a set of table and views which can only be read and never altered.Most data dictionaries contain different information about the data used in the enterprise. In terms of the database representation of the data, the data table defines all schema objects including views, tables, clusters, indexes, sequences, synonyms, procedures, packages, functions, triggers and many more. This will ensure that all these things follow one standard defined in the dictionary. The data dictionary also defines how much space has been allocated for and / or currently in used by all the schema objects.A data dictionary is used when finding information about users, objects, schema and storage structures. Every time a data definition language (DDL) statement is issued, the data dictionary becomes modified. A data dictionary may contain information such as: ! Database design information ! Stored SQL procedures ! User permissions ! User statistics ! Database process information ! Database growth statistics ! Database performance statistics Query Processor : A relational database consists of many parts, but at its heart are two major components: the storage engine and the query processor. The storage engine writes data to and reads data from the disk. It manages records, controls concurrency, and maintains log files.The query processor accepts SQL syntax, selects a plan for executing the syntax, and then executes the chosen plan. The user or program interacts with the query processor, and the query processor in turn interacts with the storage engine. The query processor isolates the user from the details of execution: The user specifies the result, and the query processor determines how this result is obtained.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 4
The query processor components include ! DDL interpreter ! DML compiler ! Query evaluation engine Report writer: Also called a report generator, a program, usually part of a database management system, that extracts information from one or more files and presents the information in a specified format. Most report writers allow you to select records that meet certain conditions and to display selected fields in rows and columns. You can also format data into pie charts, bar charts, and other diagrams. Once you have created a format for a report, you can save the format specifications in a file and continue reusing it for new data. Database User There are four different types of database users. Application programmers:- A person who prepares application program are called application programmer. Application programs operates on the data in all the usual ways: retrieving information, creating new information, deleting or changing existing information. Sophisticated users:- Sophisticated users interact with the system without writing programs. Instead, they form their requests in a database query language. Each such query is submitted to a query processor whose function is to take a DML statement and break it down into instructions that the database manager understands. Specialized users:-Some sophisticated users write specialized database application that do not fit into the traditional data processing framework. Among these application are computer-aided design systems, knowledge- base and expert systems, systems that store data with complex data types eg:-For Graphics and Audio data. End users:-Unsophisticated users interact with the system by invoking one of the permanent application programs that have been written previously. Thus they are persons who uses the information generated by a computer based system. Retrival is the most common function for this class of user. Naive users: They are unsophisticated users who interact with the system by using permanent application programs (e.g. automated teller machine).
Data abstraction
It can be summed up as follows.
1. When the DBMS hides certain details of how data is stored and maintained, it provides what is called as the abstract view of data. 2. This is to simplify user-interaction with the system. 3. Complexity (of data and data structure) is hidden from users through several levels of abstraction.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 5
Data abstraction is used for following purposes: 1. To provide abstract view of data. 2. To hide complexity from user. 3. To simplify user interaction with DBMS.
Levels of data abstraction There are three levels of data abstraction.
1. Physical level: It describes how a record (e.g., customer) is stored. Features are: a) Lowest level of abstraction. b) It describes how data are actually stored. c) It describes low-level complex data structures in detail. d) At this level, efficient algorithms to access data are defined.
2. Logical level: It describes what data stored in database, and the relationships among the data. Features are: a) It is next-higher level of abstraction. Here whole Database is divided into small simple structures. b) Users at this level need not be aware of the physical-level complexity used to implement the simple structures. c) Here the aim is ease of use. d) Generally, database administrators (DBAs) work at logical level of abstraction.
3. View level: Application programs hide details of data types. Views can also hide information (e.g., salary) for security purposes. Features are:
a) It is the highest level of abstraction. b) It describes only a part of the whole Database for particular group of users. c) This view hides all complexity. d) It exists only to simplify user interaction with system. e) The system may provide many views for the whole system.
Instances and Schemas
Instances and Schemas are similar to types and variables in programming languages.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 6
1.Schema a: The overall design of a database is called database schema. E.g., the database consists of information about a set of customers and accounts and the relationship between them. It is analogous to variable along with its type information in a program. Types of Schemas (partitioned according to levels of abstraction): a. Physical schema: It is database design at the physical level. It is hidden below logical schema, and can be changed easily without affecting application programs. b. Logical schema: It is database design at the logical level. Programmers construct applications using logical schema. It is by far the most important schema, in terms of its effect on application programs. c. Sub schema: It is schema at view level.
2. Instance:
It is the actual content of the database at a particular point in time. It is analogous to the value of a variable.
Data Models A model is a representation of reality, real world objects and events, and their associations. It is an abstraction that concentrates on the essential, inherent aspects of an organization and ignore the accidental properties. A data model represents the organization itself. Let should provide the basic concepts and notations that will allow database designers and end users unambiguously and accurately to communicate their understanding of the organizational data. Data Model can be defined as an integrated collection of concepts for describing and manipulating data, relationships between data, and constraints on the data in an organization. data model is a collection of concepts for describing data, its relationships, and its constraints provides a clearer and more accurate description and representation of data Standard platform that enables database designers and end-users to communicate Come in three varieties: A data model comprises of three components: A structural part, consisting of a set of rules according to which databases can be constructed.
A manipulative part. Defining the types of operation that are allowed on the data (this includes the operations that are used or updating or retrieving data from the database and for changing the structure of the database). Possibly a set of integrity rules, which ensures that the data is accurate. The purpose of a data model is to represent data and to make the data understandable. There have been many data models proposed in the literature. They fall into three broad categories:
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 7
Object Based Data Models Physical Data Models Record Based Data Models The object based and record based data models are used to describe data at the conceptual and external levels, the physical data model is used to describe data at the internal level. Importance of Data models Data models representations, usually graphical, of complex real-world data structures Facilitate interaction among the designer, the applications programmer and the end user End-users have different views and needs for data Data model organizes data for various users
Categories or Types of Data model 1. Hierarchical Model
The hierarchical data model organizes data in a tree structure. There is a hierarchy of parent and child data segments. This structure implies that a record can have repeating information, generally in the child data segments. Data in a series of records, which have a set of field values attached to it. It collects all the instances of a specific record together as a record type. These record types are the equivalent of tables in the relational model, and with the individual records being the equivalent of rows. To create links between these record types, the hierarchical model uses Parent Child Relationships. These are a 1:N mapping between record types. This is done by using trees, like set theory used in the relational model, "borrowed" from maths. For example, an organization might store information about an employee, such as name, employee number, department, salary. The organization might also store information about an employee's children, such as name and date of birth. The employee and children data forms a hierarchy, where the employee data represents the parent segment and the children data represents the child segment. If an employee has three children, then there would be three child segments associated with one employee segment. In a hierarchical database the parent-child relationship is one to many. This restricts a child segment to having only one parent segment. Hierarchical DBMSs were popular from the late 1960s, with the introduction of IBM's Information Management System (IMS) DBMS, through the 1970s.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 8
Hierarchical data files permits records to be grouped together. This allows a superior-subordinate or parent- child relationship (a single one-to-many relationship) to be defined between records. In simple forms, the superior or parent records are used to collect information that is common to all the subordinate/child records of the same group. This has an immediate effect of reducing redundancy with the data base.
Advantages & Disadvantages of Hierarchical model Advantages! Many features form the foundation for current data models Generated a large installed base of programmers Who developed solid business applications Disadvantages! Complex to implement Difficult to manage Lacks structural independence Implementation limitations Lack of standards (Company vs. Industry or Open)
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 9
2. Network Model
The popularity of the network data model coincided with the popularity of the hierarchical data model. Some data were more naturally modeled with more than one parent per child. So, the network model permitted the modeling of many-to-many relationships in data. In 1971, the Conference on Data Systems Languages (CODASYL) formally defined the network model. The basic data modeling construct in the network model is the set construct. A set consists of an owner record type, a set name, and a member record type. A member record type can have that role in more than one set, hence the multiparent concept is supported. An owner record type can also be a member or owner in another set. The data model is a simple network, and link and intersection record types (called junction records by IDMS) may exist, as well as sets between them . Thus, the complete network of relationships is represented by several pairwise sets; in each set some (one) record type is owner (at the tail of the network arrow) and one or more record types are members (at the head of the relationship arrow). Usually, a set defines a 1:M relationship, although 1:1 is permitted. The CODASYL network model is based on mathematical set theory.
Resembles hierarchical model Difference child can have multiple parents Collection of records in 1: M relationships Set Relationship of at least two record types Owner Equivalent to the hierarchical models parent Member Equivalent to the hierarchical models child ->In the network data model, the database consists of a collection of set-type occurrences. ->Each set-type occurrence has one occurrence of OWNER RECORD, with zero or more occurrences of MEMBER
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 10
RECORDS. ->The member sets belonging to different owners are disjoint. ->To define a network database one needs to define:
(a) the database record types which consist of data items, and
(b) the set-types.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 11
ADVANTAGES ! Provide very efficient High-speed retrieval
! Simplicity:- The network model is conceptually simple and easy to design. Ability to handle more relationship types The network model can handle Ease of data access"the one-to-many and many- to- many relationships. In the network database terminology, a relationship is a set. Each set comprises of two types of records:- an owner record and a member record, In a network model an application can access an owner record and all Data Integrity In a network model, no"the member records within a set. member can exist without an owner. A user must therefore first define the owner record and then the member record. This ensures the integrity
! Data Independence The network model draws a clear line of demarcation between programs and the complex physical storage details. The application programs work independently of the data. Any changes made in the data characteristics do not affect the application program.
DISADVANTAGES
! System complexity In a network model, data are accessed one record at a time. This males it essential for the database designers, administrators, and programmers to be familiar with the internal data structures to gain access to the data. Therefore, a user friendly database management system cannot be created using the network model
! Lack of Structural independence. Making structural modifications to the database is very difficult in the network database model as the data access method is navigational. Any changes made to the database structure require the application programs to be modified before they can access data. Though the network model achieves data independence, it still fails to achieve structural independence.
3. Relational Model RDBMS - relational database management system) A database based on the relational model developed by E.F. Codd. A relational database allows the definition of data structures, storage and retrieval operations and integrity constraints. In such a database the data and relations between them are organised in tables. A table is a collection of records and each record in a table contains the same fields.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 12
Properties of Relational Tables: ! Values Are Atomic ! Each Row is Unique ! Column Values Are of the Same Kind ! The Sequence of Columns is Insignificant ! The Sequence of Rows is Insignificant ! Each Column Has a Unique Name Certain fields may be designated as keys, which means that searches for specific values of that field will use indexing to speed them up. Where fields in two different tables take values from the same set, a join operation can be performed to select related records in the two tables by matching values in those fields. Often, but not always, the fields will have the same name in both tables. For example, an "orders" table might contain (customer-ID, product-code) pairs and a "products" table might contain (product-code, price) pairs so to calculate a given customer's bill you would sum the prices of all products ordered by that customer by joining on the product-code fields of the two tables. This can be extended to joining multiple tables on multiple fields. Because these relationships are only specified at retreival time, relational databases are classed as dynamic database management system. The RELATIONAL database model is based on the Relational Algebra. Before the relational data model, existing data models had no particular good way to separate the conceptual designs from implementations. Pre-relational models depended upon being able to determine explicitly where and how individual records were stored. Early relational proponents argued that the relational data model viewed information logically rather than physically, but this is not quite correct. Earlier data models associated the logical and physical aspects of information together; logically-related information was stored in physical proximity within a data file. The relational data model first separated the logical from the physical aspects. The relational data model looks at information as an unordered collection of "relations." Each relation is populated with unordered "tuples" of the same unordered "field" structure. Fields may only contain values of a well-defined ("atomic") domain or the null value. The unordered aspect needs to be emphasized. For expository purposes, relations are often viewed as "tables". The tuples constitute the "rows" of the table; values for a specific field constitute "columns". However, the "table data model" tends to impose a very non- relational ordering on both tuples and fields. Relations are an abstraction of how data is stored; tables are just one of many possible implementations.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 13
4. Object-oriented Model It should not be surprising whatsoever by now that the OO approach to data modeling is that all information can be stored in objects. The problem arises in trying to get OO proponents to agree upon exactly what an "object" is supposed to be. Objects tend to be defined at a very general level. There are many things that an object could be; many features that may be implemented. There are relatively few that an object is required to be. For instance, in some ways, an object looks a lot like an "entity instance" from the ERM or a "tuple" from the relational model. Objects may also include some kind of behavior that manipulates its fields or attributes. On the other hand, an object need not have any such behavior, which makes entities and tuples perfectly good examples of objects. Unfortunately, this provides a distorted notion of what objects are to practitioners who have mastered the ERM or relational model. It would quickly raise questions about the value of OO approaches if it did not seem to provide anything different from what could be done with existing models. Consequently, the principles for the OO data model are not as well-established as for other models. Even the vocabulary is sometimes at odds. There are at least two distinct viewpoints for OO that have emerged: an analysis view that defines a class as the common intersections of features shared by distinct objects, and the development view that defines a class as a blueprint for instantiating objects with common features. To confuse the issue further, another definition of class means the collection of all objects either instantiated from the same blueprint (development view) or that happen to possess the same shared properties (analysis view). Implementation of OO programming languages (where OO has been remarkably successful) has created some confusion about what features are needed in an OO data model. Programming languages are definitely in the development camp.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now! 14
OO masters deem something to be an object because it is useful to consider that thing as if it were an object. Objects include state (attributes or fields) and dynamic behavior (methods). Object behavior is triggered by receiving a "message" or "event". These triggers may originate externally or within the object. In regards to data models, some value has been shown to use objects as shown in the following table: 5. Semi structured Model
In semistructured data model, the information that is normally associated with a schema is contained within the data, which is sometimes called ``self-describing''. In such database there is no clear separation between the data and the schema, and the degree to which it is structured depends on the application. In some forms of semistructured data there is no separate schema, in others it exists but only places loose constraints on the data. Semi-structured data is naturally modelled in terms of graphs which contain labels which give semantics to its underlying structure. Such databases subsume the modelling power of recent extensions of flat relational databases, to nested databases which allow the nesting (or encapsulation) of entities, and to object databases which, in addition, allow cyclic references between objects.
Semistructured data has recently emerged as an important topic of study for a variety of reasons. First, there are data sources such as the Web, which we would like to treat as databases but which cannot be constrained by a schema. Second, it may be desirable to have an extremely flexible format for data exchange between disparate databases. Third, even when dealing with structured data, it may be helpful to view it as semistructured for the purposes of browsing.
In semistructured data model, the information that is normally associated with a schema is contained within the data, which is sometimes called ``self-describing''. In such database there is no clear separation between the data and the schema, and the degree to which it is structured depends on the application. There are couple more models but you don't have to know them unless you are into Database background.
6. Associative Model
The associative model divides the real-world things about which data is to be recorded into two sorts: Entities are things that have discrete, independent existence. An entitys existence does not depend on any other thing. Associations are things whose existence depends on one or more other things, such that if any of those things ceases to exist, then the thing itself ceases to exist or becomes meaningless.
An associative database comprises two data structures:
1. A set of items, each of which has a unique identifier, a name and a type. 2. A set of links, each of which has a unique identifier, together with the unique identifiers of three other things, that represent the source, verb and target of a fact that is recorded about the source in the database. Each of the three things identified by the source, verb and target may be either a link or an item.
pdfMachine A pdf writer that produces quality PDF files with ease! Produce quality PDF files in seconds and preserve the integrity of your original documents. Compatible across nearly all Windows platforms, simply open the document you want to convert, click print, select the Broadgun pdfMachine printer and thats it! Get yours now!