This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
Database is such an Integration part of our day-to-day life that often we are not conscious are using one. To start discussion of database, in this section we examine some applications of database systems. Database is collection of related data and the Database Management System (DMS) to the software that manages and controls access the database. If studying at university that will be database system contain student information, the course student are enrolled in, details about student grant, the modules student have taken in previous years or taking this year, and details of all student examination results. Contains the relevant year of enrollment and a database, which contains details of staff who work at the university, to wage office personal data and detailed information related to the wage database.
2.0 Primary Key
A key is a set of columns that can be used to identify or access a particular row or rows. The key is identified in the description of a table, index, or referential constraint. The same column can be part of more than one key.
The primary key relationship duplicate tuples, it is always possible to uniquely identify each row. This means that a relationship is always one primary key. In the worst case, the whole attribute group can be used as the primary key, but usually some of the smaller subset is sufficient to distinguish between tuples. The candidate has not been selected key is the primary key spare room key.
The primary key of a relational table uniquely determine each record in the table. It can either be a normal attribute that is guarantee to be unique or it can be produce by the DBMS. Primary keys may form of a single attribute in combination.
For example, a school teacher recorded the students' personal detail and the attributes were including student id, name, address, phone number and age as shown in the following table:
Tan Eng Sim
15 , jalan satu , taman dua , perak .
Tan Eng Hua
15 , jalan satu , taman dua , perak .
16 , jalan palima , taman satu , perak .
Teo Weng Khong
56 , jalan selatan , taman ramai , perak .
86 , jalan deman , taman houtang , perak .
Chang Yuk Loon
100 , jalan am , taman satu , perak .
As the table shown above, different student had a different personal info, but sometime the student may have a same personal info, like name or address. According to the table shown above, there are 2 students having a same address, phone number and name, all of them are 15 years old, and only the student ID is different. Since the student ID is uniquely and it is no repeated and the other record in table like name and address is repeated and not unique, so the student ID will suitable becomes the primary key, and the database engine can tell the difference between the tuple by using these primary key.
2.1 Foreign Key
A foreign key is a field in relational tables that match to the primary key in column of other table. The foreign key can be used to cross to reference tables. The foreign key is an attributes, within one relation that matches the candidate key of same relation.
A property in more than one foreign key relationship, the relationship between its appearance usually represent two kinds of relationships tuple.
For example, included in the relationship of branch_No Branch and the staff is very deliberate, and the staff of each branch of the link, in the details of the branch. In Section the relationship, branch_No is the main key. However, in staff relations branch_No the attribute exists, to cope with their work on the relationship of the staff to the branch office staff and, branch_No is a foreign key. We say, family relationships of employee relations attributes branch_No goals Branch branch_No primary key attribute in.
22 Jalan Pekaka
37 Jalan Tan
10 Taman Gold
40 Jalan Ikan
11 Taman Lee
A primary key and foreign key is a set of columns, which can be used to identify or access a row or a set of rows in a database is called a key. A primary key in a relational database is a combination of columns in a table that uniquely identify a row of the table. Foreign key in a relational database is a field in a table that matches the primary key of another table. The foreign key is used to cross reference tables.
4.0 Relational database
The relational database is a set of normalization of relations has a significant relationship name, relational database structure and appropriate normalization.Relational database is a collection to organize as a set of formal characterization tables from which data can be easy access. Create a relational database relational model. The software used in a relational database is called a relational database management system (RDBMS). The relational database is an ascendant choice in data, over other models like the stratification database model or the network model.
The mathematical concept of the relationship on the basis of the relational model, it is physically represented as a table. From mathematical terminology, a trained mathematician, set theory and predicate logic. This section explains the terminology and structure of the concept of the relational model.
Relational database management system (RDBMS) requirements to be regard as the users of the database table. It does not apply to the physical structure of the databaseï¼Œ it can use a variety of storage structures to achieve.
Relational data in the relationship, it is an object held to represent the information in the database. A relationship is represented as a two-dimensional table, and columns correspond to the properties of the rows of a table in the table corresponding to a single record and table. The attributes may appear in any order relationship remains the same relationship, therefore, to convey the same meaning.
For example, the information on branch offices is represented by the BRANCH relation, columns for attributes BRANCH NO, STREET, CITY, and POSTCODE. Similarly, the information on staff is represented by the STAFF relation, with columns for attributes STAFF NO, Fname, lname, position, sex, DOB, salary, and branchNo.
4.0.2 Alternative terminology
The terminology for the relational modal can be quite confusing. In fact, one-third of the set of terms are sometimes used: a relationship may be referred to as a file, as the tuple of the record, as the properties of the field. The term stems from the fact that the body, RDBMS can be stored in one file for each relationship. The relational database is a set of mathematical terms, roughly equivalent to SQL database. The table are summarizes some of the most important relational database terms and their SQL data.
4.1 Object-Oriented Database
Object Oriented Database also called Object Database Management System (ODBMS). The Object Oriented Database is a database management system in information is deputation in the objects as using in oriented programming. Object oriented databases store objects data such as integers, strings and real number. The objects contain both executable code and data.
4.1.1Advantages Object-Oriented Database
The combination of objects in OODBMS, you can store any number of atom types, and other purposes. Therefore, it may have a large class, it has many small and medium itself has many smaller classes, class, ad infinitum. In a relational database, there is a lot of work to be done, there is a large table, a lot of empty fields, or through some of the smaller, standardized table via a foreign key.
4.1.2 Comparison to relational database
The relational database store data in two dimensional. The two dimensional have rows and columns. The relational database tables are "normalized" is not repeated more often than necessary. Table columns depend on a primary key to identify the column. If once the specific columns are identified, data more rows or one row associated with that column be obtained or changed.
Objects into relational database, they are described in terms of simple real number data or string. Instance the case of an airplane. In one table rows and columns describing its dimensions and characteristics.
4.2 Introduction of Object-Relational
Object-relational mapping (ORM) is a mechanism that makes it possible to address access and manipulate objects without having to consider objects relate to their data sources. Object-relational mapping (ORM) lets programmer maintain a consistent view of objects over time, even as the sources that deliver them, the sinks that receive them and the applications that access them changes.
The ORM mapping details between a set of objects and underlying XML repositories or other data, simultaneously hiding the often changing details of related interfaces form developers and the code they create.
Object-relational mapping encapsulates change in the data source itself, so that when data sources or their APIs change, only Object-relational mapping needs to change to keep up - not the applications that use object-relational mapping to insulate themselves from this kind of effort. This capacity lets developers take advantage of new classes as they become available and also makes it easy to extend ORM-based applications. In many cases, object-relational mapping changes can incorporate new technology and capability without requiring changes to the code for related applications.
4.2.1 Advantages of Object-Relational Database
The main advantage of the extended relational data model reuse and sharing. The reuse from extended focus on the implementation of the standard features of the DBMS server, rather than the ability to encode each application. For example, an application may need to represent points, lines and polygons and calculates the distance between the two points, between a point and a line, with the distance of the associated function, whether a point of the polygon contained in the space inside the data type , and whether the two polygons overlap region, in addition to others. Embed this feature eliminates the need for the server, will be defined in each of its application, and thus allows all applications sharing function. These advantages also give rise to increased productivity both for the developer and for the end-user.
The gains from using an object-oriented database management system (OODBMS) while developing an application to using an object-oriented database programming language are so many. The savings in expansion time by not having to worry about separate data models as well as the fact that there is less code to write due to the lack of impedance mismatch is a very attractive. In my view, there is reason to choose a relational database management system (RDBMS) over an object-oriented database management system (OODBMS) for new application development unless there are legacy issues that have to be dealt with.