Database Management System: Unit I: Relational Databases

Two marks Questions with Answers

Relational Databases - Database Management System

A Database Management System (DBMS) is collection of interrelated data and various programs that are used to handle the data.

Two Marks Questions with Answers

Q.1 What is Database Management System? Why do we need a DBMS? AU: May-05, Dec- 08

Ans:

A Database Management System (DBMS) is collection of interrelated data and various programs that are used to handle the data.

The primary goal of DBMS is to provide a way to store and retrieve the required information from the database in convenient and efficient manner.

Q.2 What is the purpose of database management system?

Ans:The purpose of database management system is -

Define the structure for storage of information.

Provide mechanism for manipulation of information.

In addition, the database systems must ensure the safety of information stored.

Q.3 List any two advantages of database systems.

Ans. Following are the advantages of DBMS-

1) DBMS removes the data redundancy that means there is no duplication of data in database.

2) DBMS allows to retrieve the desired data in required format.                        

3) Data can be isolated in separate tables for convenient and efficient use.

4) Data can be accessed efficiently using a simple query language.

Q.4 Define data abstraction.   AU: May-05

Ans:Data abstraction means retrieving only required amount of information of the system and hiding background details.

Q.5 What are three levels of data abstraction?

Ans:The three levels of data abstraction are -

1. Physical Level

2. Logical Level

3. View Level

Q.6 Is it possible for several attributes to have same domain? Illustrate your answer with SLO suitable example. AU: Dec- 04, 15

Ans:A domain is the set of legal values that can be assigned to an attribute. Each attribute in a database must have a well-defined domain; we can't mix values from different domains in the same attribute. Hence it is not possible for several attributes to have same domain.

For example - Student domain has attributes RollNo, Name, Address. Similarly Employee domain has EmpID, Ename,Salary,Address. We can not define the same domain for defining several attributes.

Q.7 Write the characteristic that distinguish the database approach with File based approach.   AU: May-15, Dec.-16,19

OR What are main differences between file processing system and a DBMS ?   AU: May-06, Dec.-06

Ans: Refer section 1.2


Q.8 Discuss briefly three major disadvantages of keeping organizational information in a file processing system.

Ans: Refer section 1.2

1) Data redundancy: Data redundancy means duplication of data at several places. Since different programmers create different files and these files might have different structures, there are chances that some information may appear repeatedly in some or more format at several places.

2) Data inconsistency: Data inconsistency occurs when various copies of same data may no longer get matched. For example changed address of an employee may be reflected in one department and may not be available (or old address present) for other department.

3) Difficulty in accessing data: The conventional file system does not allow to retrieve the desired data in efficient and convenient manner.

4) Data isolation: As the data is scattered over several files and files may be in different formats, it becomes to retrieve the desired data from the file for writing the new application.

Q.9 What is data model?   AU: Dec.-11, May-19

Ans:

It is a collection of conceptual tools for describing data, relationships among data, bro semantics (meaning) of data and constraints.

Data model is a structure below the database.

Q.10 What are different types of data models?

Ans:Various types of data models are –

(1) Relational Data Model 

(2) Entity Relational Data Model

(3) Object Based Data Model 

(4)Semi-structured Data Model

Q.11 Name the categories of SQL commands.

Ans: The categories of SQL commands are -

(1) Data Definition Language (DDL)

(2) Data Manipulation Language (DML)

(3) Data Control Language (DCL)

Q.12 What is data definition language? Give example.

Ans:

Data Definition Language (DDL) is a specialized language used to specify a mondatabase schema by a set of definitions.

It is a language which is used for creating and modifying the structures of tables, views, indexes and so on.

Some of the common commands used in DDL are -CREATE, ALTER, DROP.

Q.13 Give brief description of DCL command.

Ans: DCL stands for Data Control Language. It includes commands such as GRANT and REVOKE which mainly deals with the rights, permissions and other controls of the database system.

Q.14 Define the term tuple.

Ans: Tuple means a row present in the table

Q.15 Why does SQL allow duplicate tuples in a table or in a query result?

Ans:

Data can be the same. Two people may have the same name. Since SQL is a database where you store your data and data can be duplicate.

But we can apply primary key constraints, Unique constraints or Distinct keyword to identify the record uniquely

Q.16 Why key is essential? Write the different types of keys.

Ans:

Keys are used to specify the tuples distinctly in the given relation.

Various types of keys used in relational model are - Superkey, Candidate Keys, primary keys, foreign keys.

Q.17 Define primary key. Give example.

Ans:

The primary key is a candidate key chosen by the database designer to identify the tuple in the relation uniquely.

For example - Consider a Student database as Student (RollNo,Name,Address). The primary key for this database is RollNo. The primary is underlined.

Q.18 Define foreign key. Give example.

Ans:

Foreign key is a single attribute or collection of attributes in one table that refers to the primary key of other table.

For example - Consider a Student database as Student (RollNo,Name,Address) and Course(CourseId, CourseName, RollNo). Here RollNo is a foreign key

Q.19 What is the difference between primary key and foreign key?

Ans:

Q.20 What is referential integrity?

Ans:

The referential integrity rule states that "whenever a foreign key value is used it must reference a valid, existing primary key in the parent table".

Example: Consider the situation where you have two tables : Employees and Managers. The Employees table has a foreign key attribute entitled ManagedBy, which points to the record for each employee's manager in the Managers table.

Q.21 What is domain integrity? Give example.   AU: Dec.-08

Ans: Domain integrity ensures that all the data items in a column fall within a defined set of valid values. Each column in a table has a defined set of values, such as the set of all numbers for zip (five-digit), the set of all character strings for name.

Q.22 What are different types of integrity constraints used in designing relational databases?     AU: Dec.-07

Ans:Different types of integrity constraints are

(1) Entity Integrity Constraint

(2) Referential Integrity Constraint

(3) Domain Integrity Constraint

(4) Key Integrity Constraint

Q.23 List the reasons why null value might be introduced into the database.    AU: May-06

Ans: NULL is a special value provided by database in two cases - 

i) When field values of some tuples are unknown(For e.g. city name is not assigned and 

ii) inapplicable(For e.g. middle name is not present).

Q.24 List various operators used in relational algebra.

Ans:Various operators used in Relational algebra are

(1) Selection Operator

(2) Projection Operator(II)

(3) Cartesian Product(x).

(4) Rename Operator (ρ)

Q.25 Describe briefly any two undesirable properties that a database design may have.

Ans: The two undesirable properties that a database design may have

(1)Repetition of data

(2) In-ability of representation of certain information in database.

Q.26 Specify with suitable examples, the different types of keys used in database management system.

Ans: Refer section 1.10

1) Super Key(SK)

2) Candidate Key(CK)

3) Primary Key(PK)

4) Alternate Key

5) Foreign key

Q.27 Define data independence.

Ans: Data independence is an ability by which one can change the data at one level without affecting the data at another level. Here level can be physical, conceptual or external.

Q.28 Distinguish between physical and logical data independence.

Ans: Refer section 1.6

1. Physical Independence: This is a kind of data independence which allows the modification of physical schema without requiring any change to the conceptual schema. For example - if there is any change in memory size of database server then it will not affect the logical structure of any data object.

2. Logical Independence: This is a kind of data independence which allows the modification of conceptual schema without requiring any change to the external schema. For example - Any change in the table structure such as addition or deletion of some column does not affect user views.

By these data independence the time and cost acquired by changes in any one level can be reduced and abstract view of data can be provided to the user.

Q.29 What is meant by instance and Schema of the database?

Ans:

When information is inserted or deleted from the database then the database gets changed. The collection of information at particular moment is called instances.

The overall design of the database is called schema.

Q.30 Differentiate between Dynamic SQL and Static SQL.   AU: Dec.-14,15,16,17, May-15

Ans:                                                                         

Q.31 List any eight applications of DBMS.    AU: May-19

Ans: Refer section 1.1

1) Accounting: Database systems are used in maintaining information employees, salaries, and payroll taxes.

2) Manufacturing: For management of supply chain and tracking production of items in factories database systems are maintained.

3) For maintaining customer, product and purchase information the databases are used.

4) Banking: In banking sector, for customer information, accounts and loan and for performing banking applications the DBMS is used.

5) For purchase on credit cards and generation of m`onthly statements database systems are useful.

6) Universities: The database systems are used in universities for maintaining student information, course registration, and accounting.

7) Reservation systems: In airline/railway reservation systems, the database is used to at maintain the reservation and schedule information.

8) Telecommunication: In telecommunications for keeping records of the calls made, generating monthly bills, maintaining balances on prepaid calling cards, and storing information about communication networks the database systems are used.

Q.32 Expression in Relational algebra, the division operation(/) using the project, cartesian product and minus operations. Give a simple example.    AU: Dec.-19

Ans: Let, R(A, B) and S(B) be two relations. R÷ S is denoted as - ΠA(R) - ΠA (ΠA (R) × S - R)

Database Management System: Unit I: Relational Databases : Tag: : Relational Databases - Database Management System - Two marks Questions with Answers