Friday 2 April 2021

Computer Science (New) - For Class IX - 7 - Introduction to Database System - Text Book Exercise And Activity

GO TO INDEX

Chapter No.3 - Office Automation
Short Questions Answers And Text Book Exercise

Text Book Exercise

B. Respond the following:

1. Why Database Management System is preferred over Flat File System?
Ans: Advantages of Database Management System over the Flat File System

S.No.Database Management SystemFlat File System
1. Multiple users can access data simultaneously. Only one user can access at a time.
2. Capable of handling huge sets of data. Suitable only for smaller sets of data.
3. Allows non-duplication and integrity. Increases duplicate and redundant data.
4. Supports online access. Does not support remote connections.
5. Good for small, medium and large businesses. Limited only to smaller data management needs.


2. Discuss the use of databases in business with example.
Ans: Use of Database in Business:
A database is very useful in the business industry because database used to:
  • Keep track of basic transactions
  • Provide information that will help the company run the business more efficiently
  • Help managers and employees make better decisions

Small and large businesses run on databases:
  • Databases can be small in size with a few records or very large. It plays a leading role to enhance the efficiency and performance of any organization.
  • Database can store data and organized information virtually and deliver all informations with a click of a mouse.
  • Business databases help business owners organize and track their customers, inventory and employees.

Example:
1) Customer Relationship Management:
  • A customer relationship management (CRM) database can help a small business manage the lifeblood of its business and its customers.
  • A CRM database organizes all the information, a company has about its accounts, contacts, leads and opportunities.
  • A single customer's record may include his contact details, the date and amount of his last order, the total amount of his purchases for the last year, a list of his favorite products and the products he returned, details of customer service calls and more.
  • Databases can also be used to manage marketing and promotions, to export email addresses and to prepare shipping labels.

OR

2) Payroll and Scheduling Database:
  • Using a database to manage employee information can simplify scheduling and help prevent payroll errors.
  • An employee database contains such fields as hourly wage, salary or commission, tax withholding rates, year-to-date income and accrued vacation time.
  • Other employee benefits, such as health insurance and retirement account contributions, can also be recorded in a database.
  • Two or more databases can be linked to each other to create an association between a sales representative in the personnel database and the accounts she is responsible for in the CRM database.

OR

3) Business Data Analysis:
  • The strong reporting features of databases make them useful resources for analyzing data and predicting future trends.
  • For example, a productivity report might show that productivity slows so much on the Friday afternoons before a three-day holiday weekend that you may as well just let the staff go early on those days.
  • A sales promotion effectiveness report might show that sales of certain products increased after an email promotion while sales of other products increased after an in-store promotion. Customer behavior is predictable, and a database can help you anticipate and fulfill your customers' needs.

3. What is the difference between Design View and Datasheet View?
Ans: Difference Between Design View and Datasheet View:

S.No.Design ViewDatasheet View
1. Design view shows the field and their types and other properties, but not the data..  Datasheet view shows the data in the database.
2. Design view allows user to create or change the table, form, or other database object, and configure the fields. Design view helps in modifing the database  Datasheet view also allows user to enter and edit the data. It does not let you change the format of the database, other than minor changes (such as displayed column widths).


4. Why is it important to carefully decide the data type for each field?
Ans: It is important to carefully decide the data type for each field because:
  • A data type determines the kind and range of  data that can be stored in a given database table (field or column).
  • Every field in a table has properties and these properties define the characteristics and behaviour of the field.
  • The data type also determines the kind and values that user can store in any given field.
  • Each field consisting of only a single data type and has its own range of values.
  • User can also use data type to define variables and store procedure input and output parameters.
  • User must select a data type for each column or variable appropriate for the data stored in that column or variable.
  • In addition, user must consider storage requirements and choose data types that allows for efficient storage.
  • Choosing the right data for tables, stored procedures, and variables not only improves user performance by ensuring a correct execution plan, but it also improves data integrity by ensuring that the correct data is stored with in a database.
  • Ms Access supports differnt types of data, each with a specific purpose. Most common are numeric, date/time, text, boolean.
  • For example:
    (a) If a field should only store a whole number, declaring it as an INTEGER, it prevents user from writing any contrary string into it. The data types of the fields also affect what operators and functions we can apply to them in queries.
    (b) We can take a substring of a string or convert a string to UPPER CASE, but we can't do either or those with a number. On the other hand, we can do arithmetic with numbers (add them, multipy them, etc), calculate the average, and so on.
  • The data type is also important when we ask the database to sort our result set. If we sort by a numeric column, it will sort numericalIy (smallest number first, or largest first if we specified that it should sort descending). If we sort by a string column, it will sort asciibetically (character by character, with numbers coming before letters, like "apple", "banana", "carrot", this can give us surprising and usually unhelpful results for strings containing numbers, since "9" sorts after " 152 because '1' < '9').

5. What is the difference between table and view?
Ans: Difference Between Table And View

S.No.TableView
1. It is a collection of data elements organized in shape of rows and columns. Views are treated as a virtual/logical table used to view or manipulate parts of the table.
2. Table is a physical entity that means data is actually stored in the table. Views do not store data. It maintains the security of data and ensure that no changes occur in the original data..
3. It is used to store the data. It is used to extract data from the table.
4. It is an independent data object. It depends on the table. Therefore we cannot create a view without using tables.
5. It is not an easy task to replace the table directly because of its physical storage. It is an easy task to replace the view and recreate it whenever needs.
6. It occupies space on the systems. It does not occupy space on the systems.


6. Explain entities, attributes and relationships with one example of each.
Ans: 1. Entity:
  • In literal sense, an entity is any individual object which has its own qualities and properties.
  • In database terms, an entity is an independent table and its fields are known as attributes.
  • For example:
    A Payroll database will contain an entity named Employees.

2. Field Or Attributes:
  • Fields are also called attributes or columns.
  • It is the smallest component in a database.
  • It is where the actual data is stored during data entry.
  • All data fields in the same table, have unique names.
  • Multiple fields make up a data record, several data records make up a data table, and several data tables make up a database.
  • For Example:
    The Employees entity will contain various attributes like EmployeeID, Name, Designation, Salary, etc.

3. Relationship:
  • When the database structures grew and became more complex, a lot of data started to become redundant which means that data was being unnecessarily duplicated.
  • This created a need to connect data entities instead of repeating same data in multiple tables.
  • This resulted in the creation of relationships and Relational Database Management Systems (RDBMS).
Definition:
A relationship defines the connection between two tables. It creates a connection from an attribute of one entity with an attribute of another entity.
Types:
Three types of relationships can be defined between entities:
(i) One to One Relationship:
  • This type of relationship defines that a record in one entity can be connected to only one record in another entity.
  • This is not a very common type of relationship because the data from related entities can directly be placed in a single entity.
  • However, this type of relationship is used to divide larger entities into smaller ones.
  • Example: Student table is used to store personal information of individual student. It has an Id field and a ClassId field to setup a One-to-One relationship between student and class table.

(ii) One to Many Relationship:
  • This type of relationship defines that a record in one entity can be connected to many records in another entity.
  • This is the most common type of relationship used in relational databases.
  • This relationship can also be seen as Many to One Relationship.
  • Example:
    Teachers and Teacher class tables use to creates a One-to-Many relationship.

(iii) Many to Many Relationship:
  • In this type of relationship, one or more records of one entity are connected to one or more records of another entity.
  • Usually, a third entity known as “junction table” is used to create the many-to-many relationship between two related entities.
  • Example:
    Many teachers can be associated with many classes. This requires a Many-to-Many relationship between Class and Teachers tables.

7. List the major characteristics of primary and foreign keys.
Ans: (1) Primary Key:
  • A primary key is used to uniquely identify a record in an entity.
  • When a primary key is applied to any attribute in an entity, it forces the rules of Primary Key onto that attribute.
  • These rules are:
    (i) The attribute (field) must contain a unique value to identify a record. A unique value means that two records in the same entity cannot have the same value stored in this attribute where Primary Key is applied.
    (ii) The value of the attribute where Primary Key is applied, cannot be null.

(2) Foreign Key:
  • A foreign key is used to define the connection or relation between two entities.
  • The foreign key of one entity is configured to be connected to the primary key of another entity.
  • When a foreign key is applied on an attribute, it enforces that the value for that attribute should match any record in the related entity having a primary key.

8. Write three benefits of using relationships in the database.
Ans: A relationship is an important component of a relational database.
  1. It establishes a connection between a pair of tables that are logically related to each other. A pair of tables is logically related via the data each contains.
  2.  It helps to further refine table structures and minimize redundant data. As we establish a relationship between a pair of tables, we will inevitably make minor modifications to the table structures. These refinements will make the structures more efficient and minimize any redundant data that the tables may contain.
  3. It is the mechanism that enables us to draw data from multiple tables simultaneously.
A properly defined relationship ensures relationship-level integrity, which guarantees that the relationship itself is reliable and sound.

9. Discuss the importance of ERD in business.
Ans: Entity Relationship Diagram (ERD) graphically displays the structure of a database. Following are the importance of Entity-relationship diagram (ERD) in business.
  • Assist the Database Developer:
    The ER Diagram assists the design even before the construction of tables begins.
  • Visualizing Data:
    This helps the users to plan how to organize data. Entity relationship diagramming is functional as a method of better visualizing data. Every manager of a multinational enterprise knows that spreadsheets are pretty much useless when it comes to understanding the overall picture of their entity's operations and how they are structured in relation to each other.ERD takes advantage of the basic learning strategy that's programmed into our minds by extending the programming into compatible and digestible visualizations of the relationships making up our entity.
  • Documentation Tool:
    ER Diagrams can work as a documentation to make others understand the core of the database. Software applications that diagram entity relationships are meant to make those relationships come to life on the screen (and in our mind), thus making them much easier to understand.
  • Logic of the database:
    It communicates the logical structure of the database to the users. It's only with ERD software that senior management, board and stockholders will be able to assess the whole business and to plot a viable strategy. Basically, an ERD's function is to bring all of that data stored in our servers to life so we can make sense of it.
  • Blueprint:
    An ER Diagram is considered as the blueprint of the database. An ERD tells a story about our entity's current state. It's also an essential part of how we analyze events and plan for the future. So diagramming should not only show what the current state of affairs is, but it should also show the potential ways structures and organizations within an entity can be altered and the potential effects of these changes. For groups that operate with hundreds or thousands of interconnected entities on a multinational scale, without planning, can not make sense.

10. Write any two statements from the following ER Diagram.


Ans:In above diagram,
  • (i) Entities are in rectangular boxes:
    (a) company
    (b) Advertisement
    (c) Candidate
    (d) Interview

  • (ii) Relationships are in Diamond Shape:
    (a) Releases = Company releases Advertisement
    (b) Applies for = Candidate applies for company (job), Candidates applies for advertisement
    (c) Faces = Candidate faces interview
    (d) Takes = company takes interview

C. Match the columns:

S.No.AS.No.BC
(i) Primary Key (a) Attributes(i), (b)
(ii) Integer data(b) Always unique value in field(ii), (d)
(iii) Relationship(c) Data in plain text form(iii), (c)
(iv) Field(d) Number without decimal point(iv), (a)
(v) View(e) Connection between two tables(v), (f)
(vi)  Flat file system(f) Shows virtual data(vi), (c)
(vii) Entity(g) Table with its own attributes (vii), (g)


Activity

1. Create few tables and practice; adding, updating and deleting records in MS Access.
Ans:

2. Create a table in MS Access by importing Excel Sheet. Examine the data type of each eld after importing. Make changes in data types where it is required.
Ans:

3. Create different views to show data from two tables.
Ans:

4. In supervision of your teacher, draw a simple ERD on paper and implement that in MS Access. Your ERD should include at least three entities, list of attributes of each table, proper data type assignment for each eld, implementation of primary and foreign keys and simple relationships between entities.
Ans:

More Short Questions Answers

Q. :Differentiate between flat file system and database system?
Ans: Difference Between Fat File System and Database System
S.No.Fat File systemDatabase System
1. A database is an electronic system that stores data in organized form and is composed of tables which contains records and fields. Flat file system is limited to simple rows and columns, like a spreadsheet.
2. Most databases contain multiple tables. It stores data in a single table structure.
3. Each of the tables in database, has different fields that are relevant to the information stored in the table. Flat file databases are usually in plain text format, with only one record per line and are separated using delimiters such as tabs or commas.
4. Generally, a database is an electronic system that facilitates easy access, manipulation and updating of data. A flat file is the older version of database and easy access, manipulation and updating of data are not possible.
5. Example: NADRA (National Database Registration Authority) databases Example: Excel spreadsheet


Q. : Differentiate between database and database management system (DBMS).
Ans: Difference between Database and DBMS
S.No.DatabaseDBMS
1. A collection of related pieces of data, whose purpose is to solve the data management needs of an institution is called a Database. DBMS are very complex software which save the data on the secondary storage devices and which are used to manipulate databases.
2. A Database is a collection of related data organised in a way that data can be easily accessed, managed and updated. DBMS provides us with an interface or a tool, to perform various operations like creating database, storing data in it, updating data, creating tables in the database and a lot more.
3. Database can be software based or hardware based, with one sole purpose, storing data. A DBMS is a software that allows creation, definition and manipulation of database, allowing users to store, process and analyse data easily.
4. very less information can be modified at a time. a lot of information can be changed at one time (as it can have many users using it at the same time).
5. As databases can be handled manually, the retrieval of information can be very slow. The retrieval of information is very quick.
6. The databases do not ensure that the data will be available after failure arises. DBMS ensures that the data will always be available even after system failures.
7. Example: General store database, NADRA data base Example: MySql, Oracle, SQL Server, IBM DB2, PostgreSQL, Amazon SimpleDB (cloud based) etc.




No comments:

Post a Comment