Introductory Database Question Model 1. Brief Answer Questions: (1 Marks Each)
Introductory Database Question Model 1. Brief Answer Questions: (1 Marks Each)
Introductory Database Question Model 1. Brief Answer Questions: (1 Marks Each)
Derived Attribute –
An attribute which can be derived from other attributes of the entity type is known as derived attribute. e.g.;
Age (can be derived from DOB). In ER diagram, derived attribute is represented by dashed oval.
2. Specialization :
We can say that Specialization is opposite of Generalization. In Specialization things are broken down into
smaller things to simplify it further. We can also say that in Specialization a particular entity gets divided into
sub entities and it’s done on the basis of it’s characteristics. Also in Specialization Inheritance takes place.
Example of Specialization –
Consider an entity Account. This will have some attributes consider them Acc_No and Balance. Account
entity may have some other attributes like Current_Acc and Savings_Acc. Now Current_Acc may have
Acc_No, Balance and Transactions while Savings_Acc may have Acc_No, Balance and Interest_Rate
henceforth we can say that specialized entities inherits characteristics of higher level entity.
l) Define data model.
Data models defines the data elements and the relationships between the data elements. Data Models are
used to show how data is stored, connected, accessed and updated in the database management system.
Here, we use a set of symbols and text to represent the information so that members of the organization
can communicate and understand it.
m) Differentiate between DDL and DML.
DDL DML
It stands for Data Definition Language. It stands for Data Manipulation Language.
It is used to create database schema and can be used to It is used to add, retrieve or update the data.
define some constraints as well.
It basically defines the column (Attributes) of the table. It add or update the row of the table. These
rows are called as tuple.
It doesn’t have any further classification. It is further classified into Procedural and Non-
Procedural DML.
Basic command present in DDL are CREATE, DROP, BASIC command present in DML are
RENAME, ALTER etc. UPDATE, INSERT, MERGE etc.
DDL does not use WHERE clause in its statement. While DML uses WHERE clause in its
statement.
n) List the role of database administrator.
Software installation and maintenance
Data extactraction, transformation and loading
Defining the database Schema.
Defining storage structure and access method
Defining security and integrity checks.
o) Why are table joined?
To stitch the database back together to make it easy to read and use database joins are used. They match
rows between tables. In most cases we're matching a column value from one table with another.
p) Write an example of generalization.
q) What is foreign key?
Foreign keys are the columns of a table that points to the primary key of another table. They act as a cross-reference
between tables.
Course_Id Stu_Id Stu_Id Stu_Name Stu_Age
C01 101 101 Chaitanya 22
C02 102 102 Arya 26
C03 101 103 Bran 25
C05 102 104 Jon 21
In the above example the Stu_Id column in Course_enrollment table is a foreign key as it points to the
primary key of the Student table.
r) Define transaction.
A transaction is an action or series of actions that are being performed by a single user or application program,
which reads or updates the contents of the database.
2. Short answer questions: ( 3 marks each)
a) List any four significant differences between a file processing system and a DBMS.
S.NO. FILE SYSTEM DBMS
1. File system is a software that manages and organizes DBMS is a software for managing the
the files in a storage medium within a computer. database.
2. Redundant data can be present in a file system. In DBMS there is no redundant data.
3. It doesn’t provide backup and recovery of data if it It provides backup and recovery of data even
is lost. if it is lost.
4. There is no efficient query processing in file system. Efficient query processing is there in DBMS.
5. There is less data consistency in file system. There is more data consistency because of
the process of normalization.
6. It is less complex as compared to DBMS. It has more complexity in handling as
compared to file system.
7. File systems provide less security in comparison to DBMS has more security mechanisms as
DBMS. compared to file system.
8. It is less expensive than DBMS. It has a comparatively higher cost than a file
system.
b) How is data of multivalued attribute (phone_number) of person relation (table) is stored in table?
Multivalued attribute is a type of attribute which can have zero or more values per record.
Rule: To convert a multivalued attribute in an ER diagram into relational schema, we need to create a
separate table for multivalued attribute along with the primary key of the base table.
Example:
Let us convert the Entity set Employee given in ER Diagram of Figure 1. Entity set Employee has one
multivalued attribute (represented inside double ellipse).
According to the rule stated above, we have to create two relation schemas for Employee as follows;
Employee (EID, FName, LName, DoorNo, Street, City) [Refer Composite attribute conversion]
Emp_Phone (EID, Phone)
c) What is data abstraction? Explain different layer of data abstraction in database system with diagram.
Data abstraction: As a data in database are stored with very complex data structure so when user come
and want to access any data, he will not be able to access data if he has go through this data structure. So
to simplify the interaction of user and database, DBMS hides some information which is not of user
interest, this is called data abstraction:- So developer hides complexity from user and store abstract view
of data. Data abstraction has three level of abstractions
Physical level:- This is the lowest level of data abstraction which describe How data is actual stored in
database. This level basically describe the data structure and access path /indexing use for accessing
file.
Logical level:- At this level, Programmer define the entity sets and relationship among these entity sets
using a programming language like SQL. So, the programmers work at the logical level and even the
database administrator also operates at this level.
View level:- In this level user only interact with database and the complexity remain unview. At
the view level, the users have the set of applications which they use to retrieve the data they are
interested in.
d) What do you mean by transaction? Explain the ACID properties.
A transaction is a single logical unit of work which accesses and possibly modifies the contents of a
database. Transactions access data using read and write operations. In order to maintain consistency in a
database, before and after the transaction, certain properties are followed. These are
called ACID properties.
a. Atomicity (Either all or none): By this, we mean that either the entire transaction takes place at once
or doesn’t happen at all. There is no midway i.e. transactions do not occur partially. Each transaction
is considered as one unit and either runs to completion or is not executed at all. It involves the
following two operations.
Abort: If a transaction aborts, changes made to database are not visible.
Commit: If a transaction commits, changes made are visible.
b. Consistency – Consistency indirectly depends upon remaining all three properties. The database must
remain in a consistent state after any transaction. No transaction should have any adverse effect on the
data residing in the database. If the database was in a consistent state before the execution of a
transaction, it must remain consistent after the execution of the transaction as well.
c. Isolation − In a database system where more than one transaction are being executed simultaneously
and in parallel, the property of isolation states that all the transactions will be carried out and executed
as if it is the only transaction in the system. No transaction will affect the existence of any other
transaction.
d. Durability − The database should be durable enough to hold all its latest updates even if the system
fails or restarts. If a transaction updates a chunk of data in a database and commits, then the database
will hold the modified data. If a transaction commits but the system fails before the data could be
written on to the disk, then that data will be updated once the system springs back into action.
e) How weak entity set can be converted to strong entity set?
Combing two unique key values to create one is a valid method as long as both unique keys combined
have a one to one relationship, As the weak entities do not have any primary key, they cannot be
identified on their own, so they depend on some other entity (known as owner entity). The weak entities
have total participation constraint (existence dependency) in its identifying relationship with owner
identity.
Suppose, I have taken 3 partial loan from the bank (L1, L2, L3) with following amounts. I have planned
that each and every month I shall pay 5000 amount against my all three loan accounts each. (i.e. 5000 for
each L1, L2, L2). Here, there is no way to have unique identification. So it is put in weak entity set
(payment).
• Identifying relation hold two key i.e. Lno and PaymentNo.
• Loan table: Loan(Lno., Amount)
• Loan-Payment table: (Lno., PaymentNo, Pay.Date, Pay.Amount)
Loan-Payment table
Lno. PayNo Pay.Date Pay.Amount
.
L1 20 24/7 5,000
L2 20 24/7 5,000
L3 20 24/7 5,000
f) Explain any two functions of database administrator.
Software installation and Maintenance
A DBA often collaborates on the initial installation and configuration of a new Oracle, SQL Server etc
database. The system administrator sets up hardware and deploys the operating system for the
database server, then the DBA installs the database software and configures it for use. As updates and
patches are required, the DBA handles this on-going maintenance.