Grade 12 Computer Science Note

Database

Relational Database Management System (RDBMS)

The database system which stores and displays data in tabular format of rows and columns, like spreadsheet, is known as Relational Database Management System.

 

Different between Database and DBMS

Database: it is a collection of related information about a subject organized in a useful manner that provides a base or foundation for procedure, such as retrieving information, drawing conclusion and make decision.

DBMS: A DBMS is a set of programs that manages the database files. It allows accessing the files, updating the records and retrieving data as requested.

The technique for designing a database using top-down methods is to write a main database parts that names all the major storage and retrievals it will need. Later, the programming team looks at the requirements of each of those database components and the process is repeated.

The top-down method starts from the general and moves to the specific. Basically, you start with a general idea of what is needed for the system and then ask the end-users what data they need to store. The analyst will then work with the users to determine what data should be kept in the database. Using the top-down method requires that the analyst has a detailed understanding of the system. The top-down method also can have shortcomings. In some cases, top-down design can lead to unsatisfactory results because the analyst and end-users can miss something that is important and is necessary for the system.

 

Different database models

  1. HierarchicDal database model: this is one of the oldest type of database models. In this model data is represented in the form of records. Each record has multiple fields. All records are arranged in database as tree like structure. The relationship between the records is called parent child relationship in which any child record relates to only a single parent type record.

  2. Network database model: it replaced hierarchical network database model due to some limitations on the model. Suppose, if an employee relates to two departments, then the hierarchical database model cannot able to arrange records in proper place. So network, database model was emerged to arranged non-hierarchical database. The structure of database is more like graph rather than tree structure.

  3. Relational database model: in this model, the data is organized into tables which contain multiple rows ad columns. These tables are called relations. A row in a table represents a relationship among a set of values. Since a table is a collection of such relationships, it is generally referred to the mathematical term relation, from which the relational database model derives its name.

  4. Entity-Relationship database model: this model is based on perception of a real world that contains a collection of basic objects, called entities and of relationship among these objects and characteristics of an entity. It shows relationship between different entities.

 

Advantages of the database being centralized

  1. easier to organize, edit, update and back-up the data

  2. less data duplication - data is only entered once but can be accessed by many users

  3. data integrity - because data is stored once different data is no longer held in different databases in various departments around the organization

 

Advantages of database

  1. Sharing data

  2. Reduced data redundancy

  3. Data backup and recovery

  4. Inconsistency avoided

  5. Data integrity

  6. Data security

  7. Data independence

  8. Multiple user interfaces

  9. Process complex query

 

Domains and Tuples

In data management and database analysis, a data domain refers to all the values which a data element may contain. The rule for determining the domain boundary may be as simple as a data type with an enumerated list of values.

Tuple is the collection of information about the attributes of table for single instance. In simple this also can be called as a 'row' in a Table.

 

 

Different between centralize and distributed database system

Centralized database system

Distributed database system

Simple type

Complex type

Located on particular location

Located in many geographical locations.

Consists of only one server

Contains servers in several locations

Suitable for small organizations

Suitable for large organizations

Less chance of data lost

More chances of data hacking, lost

Maintenance is easy and security is high

Maintenance is not easy and security is low

Failure of system makes whole system down

Failure of one server does not make the whole system down

There is no feature of load balancing

There is feature of load balancing

Data traffic rate is high

Data traffic rate is low

Cost of centralized database system is low

Cost of distributed database system is high

 

DBA and responsibilities of DBA

DBA is the most responsible person in an organization with sound knowledge of DBMS. He/she is the overall administrator of the system. He/she has the maximum amount of privileges (permission to access the database) for accessing the database, settings up system and defining the role of the employees which use the system.

Responsibilities of DBA:

  1. DBA defines data security, schemas, forms, reports, relationships and user privileges.

  2. DBA has responsibility to install. Monitor and upgrade database server.

  3. DBA provides different facilities for data retrieving and making reports as required.

  4. DBA has responsibility to maintain database security, backup-recovery strategy, and documentation of data recovery.

  5. DBA supervises all the activities in the system: addition, modification and deletion data from the database.

 

State and different types of data integrity

Mainly there are 3 types of data integrity constraints used in the database system. They are as:

  1. Domain integrity constraints: it defines a set range of data values for given specific data field. And also determines whether null values are allowed or not in the data field.

  2. Entity integrity constraints: it specify that all rows in a table have a unique identifier, known as the primary key value and it never be null i.e. blank.

  3. Referential integrity constrains: it exists in a relationship between the two tables in a database. It ensures that the relationship between the primary keys in the master table and foreign key in child table are always maintained.

 

Normalization and normalization process

Normalization is a database design process in which complex database table is broken down into simple separate tables. It makes data model more flexible and easier to maintain. There are two goals of the normalization process: eliminating redundant data and ensuring data dependencies make sense.

For example: the table shown is our database without normalized. Here in table we can see that for the large records of this table, there would be multiple data row of same values especially in the country and city column. So, we can normalize the table by splitting it into two tables where one table only stores the location area of each person name and could be referenced by some unique id. Say Area code.

id

country

city

Name

15

Nepal

Kathmandu

Alex

16

India

Delhi

Martin

17

Nepal

Kathmandu

Melman

18

Japan

Tokyo

Gloria

The above table can be normalized in two tables as below:

country

city

Area code

Nepal

Kathmandu

N1

India

Delhi

I1

Japan

Tokyo

J1

 

Id

Area code

Name

15

N1

Alex

16

I1

Martin

17

N1

Melman

18

J1

Gloria

 

 

Data and information: Data is defined as the raw facts and figures. It could be any numbers, alphabets or any combination of it.

When data are processed using a database program or software, they are converted to the meaningful result, called information.

 

Field and record: A column in a table is called field and it contains specific piece of information within a record.

A row in a table is called record and it contains information about person, event, etc. Another name of record is tuple.

 

Data dictionary: A data dictionary is a file which contains meta-data that is data about data. It also called information system catalogue. It keeps all the data information about the database system such as location, size of the database, tables, records, fields, user information, recovery system, etc.

 

DDL: DDL is used by the database designers and programmers to specify the content and structure of the table. It is used to define the physical characteristics of records. It includes commands that manipulate the structure of objects such as views, tables, and indexes, etc.

 

DML: DML is related with manipulation of records such as retrieval, sorting, display and deletion of records of data. It helps user to use query and display reports of the table. So it provides technique for processing the database.

 

Primary key: the field or fields that contain the unique value can be set as primary key. It does not permit duplicate or null values.

 

Relationship: A relationship is an association among several entities and represents meaningful dependencies between them. It is represented by diamond. There are 3 types of relationship:

  1. One to one

  2. One to many

  3. Many to many


Go Top