Sarojsir.com

collapse
...
Home / Class XII / UNIT 1. Database | NEB Class 12 Computer Science Notes

UNIT 1. Database | NEB Class 12 Computer Science Notes

May 02, 2024  SAROJ BHATTARAI  5,894 views
  1. What is Database and DBMS? List out the advantages and disadvantages of it.
  • A database is an organized collection of data that is stored and managed in a structured manner. It is designed to store, retrieve, and manage large amounts of data efficiently. A DBMS (Database Management System) is a software system that allows users to create, modify, and manage databases. It provides a centralized platform for storing, accessing, and managing data, making it easier to organize, retrieve, and manipulate information.Advantages of DBMS:
  1. Data Abstraction: DBMS allows users to view only the necessary data, hiding the underlying complexity of the data structure.
  2. Control Data Redundancy: DBMS helps in reducing data redundancy by ensuring that the same data is not stored in multiple places.
  3. Multiple Users: DBMS supports concurrent access, allowing multiple users to access and modify the data simultaneously.
  4. ACID Properties: DBMS transactions follow the ACID (Atomicity, Consistency, Isolation, Durability) properties, ensuring data integrity and consistency.
  5. Improved Data Security: DBMS provides advanced security features, such as encryption and access control, to protect data from unauthorized access.
  6. Efficient Data Manipulation: DBMS allows for easy data manipulation and querying, making it easier to retrieve and analyze data.
  7. Backup and Recovery: DBMS supports backup and recovery operations, ensuring that data is not lost in case of system failures.

Disadvantages of DBMS:

  1. Increased Cost: The cost of implementing and maintaining a DBMS can be high, including hardware, software, and personnel costs.
  2. Complexity: DBMS can be complex to set up and manage, requiring specialized knowledge and training.
  3. Database Failure: DBMS can experience failures, which can result in data loss if not properly managed.
  4. Performance: DBMS can be slower than traditional file systems for small-scale applications.
  5. Frequent Upgrades: DBMS vendors often release frequent updates, which can require additional costs for training and upgrading hardware.
  6. Size: DBMS can require a significant amount of storage space, which can be a challenge for organizations with limited resources.

In conclusion, DBMS offers numerous advantages, such as improved data security, consistency, and access, but it also comes with disadvantages, including increased cost, complexity, and potential performance issues.

2.  Explain the different models of DBMS with advantages and

=> There are several models of Database Management Systems (DBMS) that define the structure and organization of data within a database. Each model has its own advantages and disadvantages, catering to different types of applications and requirements. Here are some of the commonly used DBMS models:

  1. Hierarchical Model:
  • In this model, data is organized in a tree-like structure with a single root, and each record has a single parent.
  • Advantages:
    • Simple and easy to understand.
    • Provides efficient access to data that follows a hierarchical structure.
  • Disadvantages:
    • Lack of flexibility in representing complex relationships.
    • Data redundancy can occur due to repetitive information.

2. Network Model:

  • Similar to the hierarchical model, but allows each record to have multiple parent and child records, forming a network structure.
  • Advantages:
    • Provides more flexibility in representing complex relationships compared to the hierarchical model.
    • Supports many-to-many relationships between records.
  • Disadvantages:
    • Complexity in implementation and management.
    • Data independence is limited, as changes in the structure can affect many parts of the database.

3. Relational Model:

  • Data is organized into tables consisting of rows and columns, with each table representing an entity and each row representing a record.
  • Relationships between tables are established using keys.
  • Advantages:
    • Simplicity and ease of use.
    • Data independence, allowing changes to the database structure without affecting application programs.
    • Supports powerful querying capabilities using Structured Query Language (SQL).
  • Disadvantages:
    • Performance may degrade with large datasets.
    • Complex queries involving multiple tables can be challenging to optimize.
    • Not suitable for handling semi-structured or unstructured data efficiently.

4. Object-Oriented Model:

  • Extends the relational model by incorporating object-oriented concepts such as encapsulation, inheritance, and polymorphism.
  • Data is represented as objects, which can contain attributes and methods.
  • Advantages:
    • Provides better support for complex data types and relationships.
    • Enables encapsulation and data abstraction, improving modularity and reusability.
  • Disadvantages:
    • Lack of standardized query language.
    • Limited support in mainstream DBMS products.
    • Increased complexity in design and implementation.

5. NoSQL Model:

  • Encompasses various non-relational database technologies that diverge from the traditional relational model.
  • NoSQL databases are designed to handle large volumes of distributed data and are optimized for specific use cases such as scalability, performance, and flexibility.
  • Advantages:
    • Scalability and performance for large-scale distributed systems.
    • Flexible schema design, allowing storage of semi-structured and unstructured data.
  • Disadvantages:
    • Lack of standardized query language and transaction support.
    • Limited consistency guarantees compared to traditional relational databases.
    • Steeper learning curve and potential for increased complexity in application development.

Each DBMS model has its own set of trade-offs, and the choice of model depends on factors such as the nature of the data, the requirements of the application, scalability needs, and performance considerations.

  1. Write differentiate between centralized and distributed database
Centralized Distributed
Simple type Complex type
Located on particular location Many geographical location
Only one server Multiple server in many location
Suitable for small scale industries Suitable for large scale industries
Maintenance is easy Maintenance is difficult
Security is high Security is low
Low speed High Speed
Cheap Expensive
Failure of server affect whole network Doesn’t affect whole network
High chance of data loss Less chance of data loss

 Who is DBA? What are the major responsibilities of DBA? Write qualities of good DBA.

A DBA (Database Administrator) is a professional responsible for the overall management and performance of a database or a group of databases.

Their major responsibilities include:

  1. DBA has responsibility to install, monitor, and upgrade database server.
  2. He/she should has responsibility to maintain database security by creating backup for recovery.
  3. He/she has responsibility to conduct training on the uses of database.
  4. DBA defines user privilege, relationships and manages form, reports in database.

Qualities of good DBA

  • He/she should have sound and complete knowledge about DBMS and its operation.
  • He/she should be familiar with several DBMS packages such as MS Access, MY SQL, Oracle etc
  • He/she should have depth knowledge about the OS in which database server is running.
  • He/she should have good understanding of network architecture.
  • He/she should hove good database designing skill.

 

  1. What is normalization? Explain the normalization process with

The process of breaking down or decomposing as complex relation into simple relation. It reduces redundancy (unnecessary repetition of data) using principle of non-loss decomposition in which table are reduce to smaller tables without loss of information.

Normalization is the 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.

EF Codd has introduced few rules for normalizing the database in 1970 and these rules are known as normal forms. This process minimizes and controls the duplication of data in a database and also provides a rapid search for data from database.

Unnormalized database

Emp_code January
Emp_name February
Address March
Contact no. April
Date of birth May
Department June
Designation July
Basic_salary Daily_allowance
Travel_Allowance Gross_salary
Tax Provident _fund

 

 Normalized database

Employee Salary Month
Emp_code Basic_Salary January
Emp_name Travel_allowance February
Address Daily_allowance March
Contact no. Gross_salary April
Date of birth Provident_funt May
Department Tax June
Designation July

Advantages of normalization

  1. It reduces data redundancy (duplication of data)
  2. It improves faster sorting and indexing.
  3. It simplifies the structure of the database table.
  4. It improves the performance of a system.
  5. It avoids loss of information.

Normal Forms

Let us consider a following unnormalized table.

Name Roll Class Sub_name Sub_marks Sub_name Sub_marks
Ram 1 11 Computer 95 Account 78
Sita 1 12 Computer 98 Account 80
Hari 2 11 Computer 80 Account 82
Shyam 2 12 Computer 92 Account 83

A) 1NF ( First Normal form)

  1. 1NF sets the very basic rules for on organized database.
  2. It eliminates duplicate columns from the same table.
  3. It creates separate tables from each group of related data and identify each row with a unique column called primary key.

The objective of 1NF is to divide the base datas into logical units called tables.

In above table, we can see that column of subject nome and marks are repeated which are eliminated in 1NF.

Name Roll Class Sub_name Sub_marks
Ram 1 11 Computer 95
Ram 1 11 Account 78
Sita 1 12 Computer 98
Sita 1 12 Account 80
Hari 2 11 Computer 80
Hari 2 11 Account 82
Shyam 2 12 Computer 92
Shyam 2 13 Account 83

B) 2NF (Second Normal form)

  1. It further addresses the concept of remaining duplicate data.
  2. It should be in first normal form.
  3. It removes the date that applies to multiple row of a table and place them in separate tables.

The objective of second NF is to take data i.e. partly dependent upon the primary key and enter the data into another table.

In above table name depends upon roll no and class, subject name only depends upon class, subject marks depends upon name and subject_name. Hence, above table can be decomposed as:

Name Roll Class
Ram 1 11
Sita 1 12
Hari 2 11
Shyam 2 12

 

Subject Class
Computer 11
Account 11
Computer 12
Account 12

 

Name Sub_name Sub_marks
Ram Computer 95
Ram Account 78
Sita Computer 98
Sita Account 80
Hari Computer 80
Hari Account 82
Shyam Computer 92
Shyam Account 83

3NF (Third Normal Form)

  1. It should be in second normal form.
  2. It removes the column that are not dependent on primary key using 3NF above table can be decomposed as:
Sub_id Subject
C1 Computer
A1 Account

 

Class_id Class
XI 11
XII 12

 

Std_id Class Roll Class_id
1 Ram 1 XI
2 Sita 1 XII
3 Hari 2 XI
4 Shyam 2 XII

 

Std_id Sub_id Marks
1 C1 95
1 A1 78
2 C1 98
2 A1 80
3 C1 80
3 A1 82
4 C1 92
4 A1 83

Frequently Asked Question

1) Define DBMS. List out objectives of DBMS.

2) What is relational database model? List out the advantage of this model.

3) Differentiate between DBMS and RDBMS with example

4) Describe the centralized and distributed database model with figure.

5) What is hierarchical database model? list out its advantage and disadvantage.

6) What is normalization? Explain the normalization process with example.

7) Define DBA. what are the roles/ responsibilities and criteria of a good DBA.

8) Differentiate between database and DBMS with example.

9) write short notes on

  1. ERD
  2. SQL -> DDL, DML, DCL
  3. Data Integrity
  4. Data security
  5. Data Dictionary

Share:

Leave a comment

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