Free Computer Science Notes Khyber Pakhtunkhwa Textbook board Chapter 7 Database fundamentals

are you searching computer science class 11 notes chapter number 7 database fundamentals.

i) Define the terms database and DBMS.

Answer:
Database: 
Definition:
“A collection of information organized in such a way that a computer program can  quickly select desired pieces of data is called database.”
 It is an electronic filing system. The database can be easily accessed, managed and updated. It can be classified according to the types of content: bibliography, full-text numeric and images, any type of data can be managed in database.
DBMS:
Abbreviation:
DBMS stands for Database Management System.
Definition:
“A a collection of programs that enables user to store, modify and extract information from a database is called DBMS.”
There are many different types of DBMS. There are small systems that run on personal computers and also huge systems that run on mainframes.
Examples:
There are some examples of database applications:

  • Computerized library systems
  •  Automated teller machines
  •  Flight reservation systems
  •   Computerized parts inventory systems.

ii) Give three examples of data and information.

Answer:
Data:
Data is the collection of raw facts and figures. It is without any proper meaning. Data may be collection of words, numbers, graphics or sounds.
Examples of data:
Following are some examples of data:
Student data on admission forms:
When students get admission in institution, they fill admission form. This form contains raw facts like name, father’s name, the address of student etc.

  • Data of citizens: 
    Data of citizens are gathered during the census.
  • Survey data : 
    Different companies collect data by the survey to know the opinion of people about their product.
  • Information:
    When raw facts and figures are processed and arranged in some order then they become information. Information has proper meanings. Information is useful in decision making.
    Examples of information:
    Following are some examples of information:
  •  Student information:
    When data of students is arranged and stored then it becomes information.
  • Census report:
    Census data is used to get report/information about the total population of a country and literacy rate etc.
  • Survey reports and results:
    Survey data is summarized into reports/information to present to the management of the company.

iii) Write three disadvantages of file management system

Answer:
A file system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them.
Some disadvantages of file management system are as follows:

  • Data is not redundant. It is duplicated in files.
  • Data is scattered is various files and data cannot be retrieved easily.
  •   It is highly complex to update.

iv) Give any four advantages of database system

Answer:
There are several advantages of database system over file system. Few of them are as follows:

Advertisements
  • No redundant data. Redundancy is removed by data normalization
  •   Data consistency and data integrity is achieved in it.
  •   Data is secured as each user has a different set of access
  •   Data is easily accessible.

v) Differentiate between DDL and DML.

Answer:
The difference between DDL and DML is as follows:

Headings                        DDLDML
Stands forDDL stands for Data Definition Language.DML stands for Data Manipulation language.
What is it?DDL is a computer language used to specifically to define data structures.DML is a grouping of computer languages used by computer programs to manipulate data in a database.
UseDDL mainly uses the CREATE command.DML uses SQL mostly and is comprised of change statements.

vi) What is data model?

Answer:
A data model normally consists of entity types, attributes, relationship, integrity rules and the definitions of those objects. Data model defines how data is connected to each other and how they are processed and stored inside the system. It is used as the start point for interface or database design. Different data models are as follows:

  • Hierarchical model
  • Network database model
  • Relational database model
  • Object oriented model
  • Object relational database model

vii) Differentiate between cardinality and modality.

Answer:
The difference between cardinality and modality is as follows:

Headings                                    CardinalityModality
Defines theCardinality defines the range of object-to-object relationships.Modality defines whether or not a relationship between two objects is mandatory.
Refers toIt refers to maximum number of times an instance in one entity can be associated with instance in the related entity.It refers to the minimum number of times an instance in one entity can be associated with an instance in the related entity.
Presented asCardinality can be presented as 1 or many.Modality can be presented as 1 or 0.
SymbolIts symbol is placed on the outside ends of the relationship line.Its symbol is placed on the inside, next to cardinality symbol.

viii) What   is primary key and foreign key?

Answer:
Primary key:
A primary key is a column or group of columns that uniquely identify a row. Every table should have a primary key. A table cannot have more than one primary key.
Foreign key:
A foreign key is a column or set of columns in one table whose values must have matching values in the primary key or another or same table. A foreign key is said to reference its primary key. It identifies the relation between two or more tables.

ix) What  is Relation?

Answer:
Relations are tables with rows and columns in database. There is a difference between a simple table and a relation that a table can have duplicate rows but a relation cannot contain duplicate rows.
Each row is called a tuple or record and each record is identified by a attributes or fields containing a unique value. Every table shares at least one field with another table in ‘one to one’, ‘one to many’ or ‘many to many’ relationships. Because of these relationships a user can access data from database.

Advertisements

x) What is the role of DBA?

Answer:
DBA (Database Administrator) is a person or group in charge, for implementing DBMS in an organization. Database Administrator’s job requires a high degree of technical expertise and ability to understand and interpret management at a senior level.
Some other responsibilities of DBA include:

  •   Implementation of Data models
  •   Makes decision concerning the content of the database
  •   Database design
  •   Performance issues
  •   Storage structure and access method definition
  •   Granting of authorization for the data access
  •   Routine maintenance which may include:

o   Periodically backup the database
o   Ensuring that enough free disk space is available
o   Monitoring jobs running on the database and performance.

Extensive Questions for 1st Year computer science Notes

i) Explain different types of database models.

Answer:
Database Models:
Database systems are based on different data models or database models respectively. A data model is a collection of concepts and rules for the description of the structure of the database. Structure of the database means the data types, the constraints and the relationships for the description or storage of data respectively.
The most often used models are::

  • Hierarchal model
  • Network model
  • Relational model
  • Object oriented database model
  • Object relational database model
Explain different types of database models
Explain different types of database models : visit now : perfect24u.com

Network model:
Network model is similar as hierarchal model but it is different from that in one aspect. In networks diagram, arrow heads appear at the end of every entity joining line, means that one entity participate in  many subordinate relationships at the same time. Therefore, much more complex diagrams are used to represent the structure of the database. Networks provide more flexibility than a simple hierarchal system in the data relationships may be maintained.

Relational model:
The relational model is the best known and in today’s DBMS most often implemented database model. It defines a database as a collection of tables (relations) which contain all data. This module deals predominantly with the relational database model and the database systems based on it.

Advertisements
  • Object oriented database model:
    In object oriented database model information is presented in the form of objects like object oriented programming. These are different from relational databases as they belong to the broader management system. Database and object oriented programming capabilities are combined to form this model.

ii) What is SQL? Explain its types.

Answer:
SQL:
SQL is Structured Query Language used for the manipulation or retrieval of databases.
Types of SQL:
SQL is divided in to following languages:
–    DDL (Data Definition Language)
–    DML (Data Manipulation Language)
–    DCL (Data Control Language)

  • Data Definition Language (DDL):
    DDL defines structure of database in which the data is stored. These structures include:
    –          Database
    –          Tables
    –          Query
    –          Fields
    –          Records
  • Data Manipulation Language (DML):
    A DML is a language allows to access or manipulate data. Types in which it access data are:
    –          Retrieve information from database
    –          Insert new data in the database
    –          Delete data from database
    –          Modify already stored data in the database.
  • Data Control Language (DCL):
    DCL controls the access to the data in the database. Examples of DCL are:
    –          Give rights to the users
    –          Revoking of already given rights.

iii) Explain various steps of planning a database.

Answer:
 Steps of planning a database:
 In order to design a proper and perfect database, its process is divided into several steps. These are as follows: 

  1. Problem identification and definition:
    In first step problem is properly described that what is the actual problem for which we want to design a database. A statement is prepared which specifies the scope and objective of the problem.For example, an existing system of college has problems than the new system is planned and it is investigated that either the new system is needed to resolve the complaint or not.
  2. Feasibility study:
    If the statement prepared suggest a new system than this study is conducted which also called pilot study. It depends upon various factors like, time needed for development, cost of development, resources needed in and after development, training of personnel’s and maintenance of the new system after implementation.
  3. Requirement analysis:
    This analysis is to understand the customer needs and expectations from the proposed system. Requirements include the working of new system or the features to be included in it. For collecting this required information, a database analyst needs to work on it in the business organization to observe the current system by talking to the end-users and examine the overall system.
  4. Identifying  entities and attributes:
    At this step entities and their attributes are identified. Entity is the main object of a database. It is usually a person, place, thing or event that is included in database.
    An attribute is a property of an entity that describes it. For example, if student is an entity then its name, age, address etc. are attributes that describes the student.
  5. Assigning names to tables and columns:
    Tables are based on entities and their column or fields are attributes of an entity. For example, student is an entity , the table will be named as student. Its name, age, address are attributes than these attributes become the columns of a table.

Related: FA Part-1 Computer Science notes Chapter 4 (Inside System Unit)

iv) What is the relation? Explain the degree of relationships with examples.

Answer:
Relation:
In database the data need to be organized into tables also called relations so that redundancies don’t occur. A database table is similar in appearance to a spreadsheet, in that data is stored in rows and columns. An entity is a unique identifier in a table, which is composed of a combination of one or more attributes, and each attribute must have one and only one value. Entity can be defined as ; “Anything about which we want to keep information in the database”.
Degree of relationship:
Relationship is a meaningful association between two entities. It is the situation that exists between two entities. It is represented by a diamond symbol:

What is the relation?
What is the relation?

A degree of relationship refers to the number of participating entities in a relationship. If there are two entities involved in relationship then it is referred to as binary relationship. It there are three relationships it is called ternary relationship and so on. Basically it has three types:
i- Unary relationship:
 A unary relationship is when both participants in the relationship are same entity. For example, a subject may be prerequisite for other subject as shown in figure below:

Advertisements
Unary Relationship
Free Computer Science Notes Khyber Pakhtunkhwa Textbook board Chapter 7 Database fundamentals 9

ii- Binary relationship:
 A binary relationship is when two entities participate and is the most common relationship degree. For example, a teacher teaches a subject. It involves two entities of teacher and subject as shown in figure below:

Binary Relationship
Free Computer Science Notes Khyber Pakhtunkhwa Textbook board Chapter 7 Database fundamentals 10

iii- Ternary relationship:
A ternary relationship occurs when three entities are participating in the relationship.  For example, an institution wants to record which teacher  taught which subject in which courses, as shown in figure below. Relationship ‘CST’ here represents ‘Course, Subject and Teacher’.

Ternary relationship
Free Computer Science Notes Khyber Pakhtunkhwa Textbook board Chapter 7 Database fundamentals 11

v) What is ERD? Draw an ERD for the following systems.
a) Hospital management system
b) Airline booking system

Answer:
ERD:
An ERD stand for Entity Relationship Diagram is used to represent the requirement analysis at the conceptual design stage. The database is designed from the ER Diagram or it can be said that ERD is converted into database.
Each entity in the diagram corresponds to a table in the database.
The attributes of an entity correspond to fields of a tables.
The ER Diagram is converted to the database.
a) ERD of Hospital Managwement system
ERD of hospital management system is given below:

ERD Hospital management system
Free Computer Science Notes Khyber Pakhtunkhwa Textbook board Chapter 7 Database fundamentals 12

Above erd of hospital management system includes all basic entities that are responsible to run hospital effectively and also their respectively attributes are given.
b) ERD of Airline booking system
ERD of Airline booking system is given below:

ERD Airline booking system
Free Computer Science Notes Khyber Pakhtunkhwa Textbook board Chapter 7 Database fundamentals 13

Above ERD of  airline booking system consists of all those entities which are involved in booking system of airline and their respective attributes are also mentioned here.

Advertisements

vi) Describe different steps of Transformation of E-R Model into Relational Schema.

Answer:
Transformation of E-R Model into relational schema:
a.    Transforming Entities to Relational Schema:
Each entity is converted by a table or a relation. Each table has name similar as of entity. Each table has a number of rows and columns. Each column shows an attribute. Each row contains data of different columns combine to make a record or tuple.
b.    Transforming attributes to relational schema:
Each column represents an attribute also called field of table. For example, if student is an entity than name, age, marks, roll_no will its attributes which are shown by columns in a table. Figure below shows the transformation of attributes into columns.
c.    Transforming Relationships to Relational Schema:
The relationships of E-R diagram must also be shown in relational schema. The representation of schema depends upon the nature of relationship. Usually, it is represented by creating primary key in one relation and representing it as foreign key in another relation.

Transformation of ERD model into Relational Schema
Free Computer Science Notes Khyber Pakhtunkhwa Textbook board Chapter 7 Database fundamentals 14

The above figure shows transformation of ERD model into Relational Schema i.e. into a relation / table. The ERD has four entities which are transformed into four columns of table.

vii) What is Normalization? Explain the following Normal Forms 1NF, 2NF, 3NF.

Answer:
Normalization:
Normalization is the process in database which reduces redundancies of data. It will make data more simple and easy for users to understand it by removing complexities from data. This technique is used while designing a database. Database is implemented only if it is in normalized form because otherwise it creates a lot of errors.
Normal forms:
Data is normalized in several steps, those are called normal forms (NF). Different types of dependencies are removed in these normal forms. The normal forms are:

  • First Normal Form (1NF)
  •  Second Normal Form (2NF)
  • Third Normal Form (3NF)

Normalization is achieved when data is in 3NF. Consider an example of the student table:
STUDENT:

Read more: 11th Class Computer Science Notes Chapter 6 (Wireless Communications)

Advertisements
StudentId    Advisor    Adv-room    Class1    Class2    
1022Ali412101-07143-01
4123Ahmad216201-01214-01

The table above is not normalized as one advisor has two classes stored in same row. It shows repeating groups. Now we will apply normalization on this table:
First Normal Form: (1NF)
1NF can be defined as:
“A relation R is in First Normal Form if and only if all underlying domains contain atomic values only.”
STUDENT:

Student#    Advisor    Adv-room    Class#    
1022Ali412101-07
1022Ali412143-01
4123Ahmad216201-01
4123Ahmad216214-01

The above table is now in 1NF.
Second Normal Form: (2NF)
2NF can be defined as:
“To be in 2NF, a relation must be in 1NF and every non-key attribute must depend on the key and all parts of the key.”
In 1NF the multiple Class# values for each Student# value was shown in Student table. Class# is not functionally dependent on Student#, which is a primary key. So, in 2NF ,Class# is moved to another table called Registration table, as shown below.
STUDENT:

Student#    Advisor    Adv-Room    
1022Ali412
4123Ahmad216

REGISTRATION:

Student#    Class#    
1022101-07
1022143-01
1022159-02
4123201-01
4123211-02
4123214-01

 Now the tables are in 2NF.
Third Normal Form (3NF):
Definition:
“To be in 3NF, a relation must be in 2NF and non-key attribute must not depend on any other non-key attribute.”
When a relation is in third normal form, then the data will be in consistent state.
In 2NF Adv-room( the advisor’s office number) was functionally dependent on the Advisor. The solution is to move that attribute from student table to faculty table. This has been done in tables below:
STUDENT:

Student#    Advisor    
1022Ali
4123Ahmad

FACULTY:

Name    Room    Dept    
Ali41242
Ahmad21642

Now  the data is in 3NF and there is no redundancy in it.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top