Unit 1
Unit 1
UNIT-1
8 MARKS:
1. What are the problems with traditional file processing system? Explain briefly
1) Data Redundancy : Since each application has its own data file, the same data may
have to be recorded and stored in many files. For example, personal file and payroll file,
both contain data on employee name, designation etc. The result is unnecessary duplicate
or redundant data items. This redundancy requires additional or higher storage space,
costs extra time and money, and requires additional efforts to keep all files up to-date.
3) Lack of Data Integration : Since independent data file exists, users face difficulty in
getting information on any ad hoc query that requires accessing the data stored in many
files. In such a case complicated programs have to be developed to retrieve data from
every file or the users have to manually collect the required information.
4) Program Dependence: The reports produced by the file processing system are
program dependent, which means if any change in the format or structure of data and
records in the file is to be made, the programs have to modified correspondingly. Also, a
new program will have to be developed to produce a new report.
6) Limited Data Sharing : There is limited data sharing possibilities with the traditional
filesystem. Each application has its own private files and users have little choice to share
the data outside their own applications. Complex programs required to be written to
obtain data from several incompatible files.
7) Poor Data Control : There was no centralized control at the data element level, hence
a traditional file system is decentralized in nature. It could be possible that the data field
may have multiple names defined by the different departments of an organization and
depending on the file it was in. This situation leads to different meaning of a data field in
different context or same meaning for different fields. This causes poor data control.
8) Problem of Security : It is very difficult to enforce security checks and access rights
in a traditional file system, since application programs are added in an adhoc manner.
2. Why would you choose a database system instead of simply storing data in
operating- system files? Explain briefly
3. Efficient data access: It stored huge amount of data efficiently and can be retrieved
whenever a need arise.
4. Data can be shared: The data stored in the database can be shared by the users or
programs.
5. Standards can be enforced: The data in the database follows some standards. Eg: a
field ‘Name’ should have 40 characters long. Some standards are ANSI, ISO, etc.
6. Security restrictions can be applied: The data is of great value so it must be kept
secure and private. Data security means the protection of data against accidental or
intentional disclosure or unauthorized destruction or modification by unauthorized
person.
7. Integrity can be maintained: It ensures that the data is to be entered in the database
is correct.
8. Crash recovery: Some times all or a portion of the data is lost when a system crashes.
A good DBMS helps to recover data after the system crashed.
o Ans: A DBMS has appropriate languages and interfaces to express database queries
and updates.
o Database languages can be used to read, store and update the data in the database.
o DDL stands for Data Definition Language. It is used to define database structure or
pattern.
o It is used to create schema, tables, indexes, constraints, etc. in the database.
o Using the DDL statements, you can create the skeleton of the database.
o Data definition language is used to store the information of metadata like the number
of tables and schemas, their names, indexes, columns in each table, constraints, etc.
DML stands for Data Manipulation Language. It is used for accessing and manipulating data
in a database. It handles user requests.
o DCL stands for Data Control Language. It is used to retrieve the stored or saved data.
o The DCL execution is transactional. It also has rollback parameters.
(But in Oracle database, the execution of data control language does not have the feature
of rolling back.)
There are the following operations which have the authorization of Revoke:
TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical
transaction.
Database users are categorized based up on their interaction with the database. These are
seven types of database users in DBMS.
1. Database Administrator (DBA) : Database Administrator (DBA) is a
person/team who defines the schema and also controls the 3 levels of database.
The DBA will then create a new account id and password for the user if he/she
need to access the database. DBA is also responsible for providing security to
the database and he allows only the authorized users to access/modify the data
base. DBA is responsible for the problems such as security breaches and poor
system response time.
• DBA also monitors the recovery and backup and provide technical
support.
• The DBA has a DBA account in the DBMS which called a system or
superuser account.
• DBA repairs damage caused due to hardware and/or software
failures.
• DBA is the one having privileges to perform DCL (Data Control
Language) operations such as GRANT and REVOKE, to
allow/restrict a particular user from accessing the database.
2. Naive / Parametric End Users : Parametric End Users are the unsophisticated
who don’t have any DBMS knowledge but they frequently use the database
applications in their daily life to get the desired results. For examples, Railway’s
ticket booking users are naive users. Clerks in any bank is a naive user because
they don’t have any DBMS knowledge but they still use the database and
perform their given task.
3. System Analyst :
System Analyst is a user who analyzes the requirements of parametric end users.
They check whether all the requirements of end users are satisfied.
4. Sophisticated Users : Sophisticated users can be engineers, scientists, business
analyst, who are familiar with the database. They can develop their own
database applications according to their requirement. They don’t write the
program code but they interact the database by writing SQL queries directly
through the query processor.
5. Database Designers : Data Base Designers are the users who design the
structure of database which includes tables, indexes, views, triggers, stored
procedures and constraints which are usually enforced before the database is
created or populated with data. He/she controls what data must be stored and
how the data items to be related. It is responsibility of Database Designers to
understand the requirements of different user groups and then create a design
which satisfies the need of all the user groups.
6. Application Programmers : Application Programmers also referred as System
Analysts or simply Software Engineers, are the back-end programmers who
writes the code for the application programs. They are the computer
professionals. These programs could be written in Programming languages such
as Visual Basic, Developer, C, FORTRAN, COBOL etc. Application
programmers design, debug, test, and maintain set of programs called “canned
transactions” for the Naive (parametric) users in order to interact with database.
7. Casual Users / Temporary Users : Casual Users are the users who occasionally
use/access the database but each time when they access the database they require
the new information, for example, Middle or higher level manager.
8. Specialized users : Specialized users are sophisticated users who write
specialized database application that does not fit into the traditional data-
processing framework. Among these applications are computer aided-design
systems, knowledge-base and expert systems etc.
Ans: Applications:
1. Universities:
It is an undeniable application of the database. Universities have so much data which can be
stored in the database, such as student information, teacher information, non-teaching staff
information, course information, section information, grade report information, and many
more. University information is kept safe and secure in the database.
Anyone who needs information about the student, teacher, or course can easily retrieve it from
the database. Everything needs to be maintained because even after ten years, information may
be required, and the information may be useful, so maintaining complete information is the
primary responsibility of any university or educational institution.
2. Banking:
It is one of the major applications of databases. Banks have a huge amount of data as millions
of people have accounts that need to be maintained properly. The database keeps the record of
each user in a systematic manner. Banking databases store a lot of information about account
holders. It stores customer details, asset details, banking transactions, balance sheets, credit
card and debit card details, loans, fixed deposits, and much more. Everything is maintained
with the help of a database.
Nowadays, everyone has a smartphone and accounts on various social media sites like
Facebook, LinkedIn, Pinterest, Twitter, Instagram, etc. People can chat with their friends and
family and make new friends from all over the world. Social media has millions of accounts,
which means they have a huge amount of data that needs to be stored and maintained. Social
media sites use databases to store information about users, images, videos, chats, etc.
5. Library Management System:
There are hundreds and thousands of books in the library, so it is not easy to maintain the
records of the books in a register or diary, so a database management system is used which
maintains the information of the library efficiently. The library database stores information like
book name, issue date, author name, book availability, book issuer name, book return details,
etc.
6. E-commerce Websites:
E-commerce websites are one of the prominent applications of the database. Websites such as
Flipkart, Myntra, Amazon, Nykaa, Snapdeal, Shopify, and many more, are online shopping
websites where people buy items online. These websites have so much data. These websites
use databases to securely store and maintain customer details, product details, dealer details,
purchase details, bank & card details, transactions details, invoice details, etc. You can analyze
the sales and maintain the inventory with the help of a database.
7. Medical:
There is a lot of important data collection in the medical field, so it is necessary to use the
database to store data related to the medical field, such as patient details, medicine details,
practitioner details, surgeon details, appointment details, doctor schedule, patient discharge
details, payment detail, invoices, and other medical records. The database management system
is a boon for the medical field because it helps doctors to monitor their patients and provide
better care.
When there is big data regarding accounting and finance, there is a need to maintain a large
amount of data, which is done with the help of a database. The database stores data such as
accounting details, bank details, purchases of stocks, invoice details, sales records, asset details,
etc. Accounting and finance database helps in maintaining and analyzing historical data.
9. Industries:
The database management system is the main priority of industries because they need to store
huge amounts of data. The industry database stores customer details, sales records, product
lists, transactions, etc. All the information is kept secure and maintained by the database.
It is one of the applications of database management systems that contain data such as
passenger name, passenger check-in, passenger departure, flight schedule, number of flights,
distance from source to destination, reservation information, pilot details, accounting detail,
route detail, etc. The database provides maintenance and security to airline data.
11. Telecommunication:
We cannot deny that telecommunication has brought a remarkable revolution worldwide. The
Telecom field has huge data, and it is very difficult to manage big data without a database; that
is why a telecom database is required, which stores data such as customer names, phone
numbers, calling details, prepaid & post-paid connection records, network usage, bill details,
balance details, etc.
12. Manufacturing:
In the manufacturing field, a lot of data needs to be maintained regarding supply chain
management, so the database maintains the data such as product details, customer information,
order details, purchase details, payment info, worker's details, invoice, etc. Manufacturing
companies produce and supply products every day, so it is important to use a database.
Ans:
In DBMS, there are three levels of data abstraction, which are as follows:
1. Physical or Internal Level:
The physical or internal layer is the lowest level of data abstraction in the database management
system. It is the layer that defines how data is actually stored in the database. It defines methods
to access the data in the database. It defines complex data structures in detail, so it is very
complex to understand, which is why it is kept hidden from the end user.
Data Administrators (DBA) decide how to arrange data and where to store data. The Data
Administrator (DBA) is the person whose role is to manage the data in the database at the
physical or internal level. There is a data center that securely stores the raw data in detail on
hard drives at this level.
The logical or conceptual level is the intermediate or next level of data abstraction. It explains
what data is going to be stored in the database and what the relationship is between them.
It describes the structure of the entire data in the form of tables. The logical level or conceptual
level is less complex than the physical level. With the help of the logical level, Data
Administrators (DBA) abstract data from raw data present at the physical level.
View or External Level is the highest level of data abstraction. There are different views at this
level that define the parts of the overall data of the database. This level is for the end-user
interaction; at this level, end users can access the data based on their queries.
Ans:
Data Independence
o Data independence can be explained using the three-schema architecture.
o Data independence refers characteristic of being able to modify the schema at one level
of the database system without altering the schema at the next higher level.
o Logical data independence refers characteristic of being able to change the conceptual
schema without having to change the external schema.
o Logical data independence is used to separate the external level from the conceptual
view.
o If we do any changes in the conceptual view of the data, then the user view of the data
would not be affected.
o Logical data independence occurs at the user interface level.
o Physical data independence can be defined as the capacity to change the internal schema
without having to change the conceptual schema.
o If we do any changes in the storage size of the database system server, then the
Conceptual structure of the database will not be affected.
o Physical data independence is used to separate conceptual levels from the internal
levels.
o Physical data independence occurs at the logical interface level.
7. Explain Database System Architecture with neat diagram
8. Explain Storage Manager and Query Processor components of DBMS with neat
diagram
Ans:
The database system is divided into three components: Query Processor, Storage Manager,
and Disk Storage. These are explained as following below.
Architecture of DBMS
1. Query Processor: It interprets the requests (queries) received from end user via an
application program into instructions. It also executes the user request which is received
from the DML compiler.
Query Processor contains the following components –
• DML Compiler: It processes the DML statements into low level instruction
(machine language), so that they can be executed.
• DDL Interpreter: It processes the DDL statements into a set of table containing
meta data (data about data).
• Embedded DML Pre-compiler: It processes DML statements embedded in an
application program into procedural calls.
• Query Optimizer: It executes the instruction generated by DML Compiler.
2. Storage Manager: Storage Manager is a program that provides an interface between the
data stored in the database and the queries received. It is also known as Database Control
System. It maintains the consistency and integrity of the database by applying the
constraints and executing the DCL statements. It is responsible for updating, storing,
deleting, and retrieving data in the database.
It contains the following components –
• Authorization Manager: It ensures role-based access control, i.e,. checks
whether the particular person is privileged to perform the requested operation or
not.
• File Manager: It manages the file space and the data structure used to represent
information in the database.
• Buffer Manager: It is responsible for cache memory and the transfer of data
between the secondary storage and main memory.
• Data Dictionary: It contains the information about the structure of any database
object. It is the repository of information that governs the metadata.
• Indices: It provides faster retrieval of data item.
The structure of a Database Management System (DBMS) can be divided into three main
components: the Internal Level, the Conceptual Level, and the External Level.
1. Internal Level: This level represents the physical storage of data in the database.
It is responsible for storing and retrieving data from the storage devices, such as
hard drives or solid-state drives. It deals with low-level implementation details
such as data compression, indexing, and storage allocation.
2. Conceptual Level: This level represents the logical view of the database. It deals
with the overall organization of data in the database and the relationships
between them. It defines the data schema, which includes tables, attributes, and
their relationships. The conceptual level is independent of any specific DBMS
and can be implemented using different DBMSs.
3. External Level: This level represents the user’s view of the database. It deals
with how users access the data in the database. It allows users to view data in a
way that makes sense to them, without worrying about the underlying
implementation details. The external level provides a set of views or interfaces
to the database, which are tailored to meet the needs of specific user groups.
The three levels are connected through a schema mapping process that translates data from
one level to another. The schema mapping process ensures that changes made at one level
are reflected in the other levels.
In addition to these three levels, a DBMS also includes a Database Administrator (DBA)
component, which is responsible for managing the database system. The DBA is
responsible for tasks such as database design, security management, backup and recovery,
and performance tuning.
Overall, the structure of a DBMS is designed to provide a high level of abstraction to users,
while still allowing low-level implementation details to be managed effectively. This
allows users to focus on the logical organization of data in the database, without worrying
about the physical storage or implementation details.
Ans:
ER model stands for the Entity Relationship Model in the database management
system (DBMS). It is the first step of designing to give the flow for a concept. It is the DFD
(Data Flow Diagram) requirement of a company.
It is the basic building block for relational models. Not that much training is required to design
the database project. It is very easy to convert the E-R model into a relational table or to a
normalized table.
It is a high-level data model diagram that defines the conceptual view of the database. It acts
as a blueprint to implement a database in future.
Components of ER diagram
• Entity
• Attributes
• Relationship
• Weak entity
• Strong entity
• Simple attribute
• Key attribute
• Composite attribute
• Derived attribute
• Multivalued attribute
It may be an object, person, place or event that stores data in a database. In a relationship
diagram an entity is represented in rectangle form. For example, students, employees,
managers, etc.
Entity set
It is a collection of entities of the same type which share similar properties. For example, a
group of students in a college and students are an entity set.
Entity is characterised into two types as follows −
The entity types which consist of key attributes or if there are enough attributes for forming a
primary key attribute are called a strong entity set. It is represented by a single rectangle.
For Example,
Roll no of student
EmpID of employee
An entity does not have a primary key attribute and depends on another strong entity via foreign
key attribute. It is represented by a double rectangle.
Attributes
It is the name, thing etc. These are the data characteristics of entities or data elements and data
fields.
Types of attributes
The types of attributes in the Entity Relationship (ER) model are as follows −
• Single value attribute − These attributes contain a single value. For example, age,
salary etc.
• Multivalued attribute − They contain more than one value of a single entity. For
example, phone numbers.
• Composite attribute − The attributes which can be further divided. For example,
Name-> First name, Middle name, last name
• Derived attribute − The attribute that can be derived from others. For example, Date
of Birth.
Relationship
It is used to describe the relation between two or more entities. It is represented by a diamond
shape.
Degree of Relationship
• Unary Relationship
• Binary Relationship
• Ternary Relationship
• n-ary Relationship
Ans:
• Attributes are the descriptive properties which are owned by each entity of an Entity
Set.
• There exist a specific domain or set of values for each attribute from where the
attribute can take its values.
Types of Attributes-
1. Simple attributes
2. Composite attributes
3. Single valued attributes
4. Multi valued attributes
5. Derived attributes
6. Key attributes
1. Simple Attributes-
Simple attributes are those attributes which can not be divided further.
Example-
Here, all the attributes are simple attributes as they can not be divided further.
2. Composite Attributes-
Composite attributes are those attributes which are composed of many other simple attributes.
Example-
Here, the attributes “Name” and “Address” are composite attributes as they are composed of
many other simple attributes.
Single valued attributes are those attributes which can take only one value for a given entity
from an entity set.
Example-
Here, all the attributes are single valued attributes as they can take only one specific value for
each entity.
Multi valued attributes are those attributes which can take more than one value for a given
entity from an entity set.
Example-
Here, the attributes “Mob_no” and “Email_id” are multi valued attributes as they can take
more than one values for a given entity.
5. Derived Attributes-
Derived attributes are those attributes which can be derived from other attribute(s).
Example-
Here, the attribute “Age” is a derived attribute as it can be derived from the attribute “DOB”.
6. Key Attributes-
Key attributes are those attributes which can identify an entity uniquely in an entity set.
Example-
Here, the attribute “Roll_no” is a key attribute as it can identify any student uniquely.
Ans:
The Entity Relational Model is a model for identifying entities to be represented in the
database and representation of how those entities are related. The ER data model specifies
enterprise schema that represents the overall logical structure of a database graphically.
The Entity Relationship Diagram explains the relationship among the entities present in the
database. ER models are used to model real-world objects like a person, a car, or a company
and the relation between these real-world objects. In short, the ER Diagram is the structural
format of the database.
Why Use ER Diagrams In DBMS?
• ER diagrams are used to represent the E-R model in a database, which makes
them easy to be converted into relations (tables).
• ER diagrams provide the purpose of real-world modeling of objects which
makes them intently useful.
• ER diagrams require no technical knowledge and no hardware support.
• These diagrams are very easy to understand and easy to create even for a naive
user.
• It gives a standard solution for visualizing the data logically.
Symbols Used in ER Model
ER Model is used to model the logical view of the system from a data perspective which
consists of these symbols:
• Rectangles: Rectangles represent Entities in the ER Model.
• Ellipses: Ellipses represent Attributes in the ER Model.
• Diamond: Diamonds represent Relationships among Entities.
• Lines: Lines represent attributes to entities and entity sets with other
relationship types.
• Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
• Double Rectangle: Double Rectangle represents a Weak Entity.
12. Discuss the representation of weak entities, participation and key constraints in ER
diagram
Ans:
2. Weak Entity
An Entity type has a key attribute that uniquely identifies each entity in the entity set. But
some entity type exists for which key attributes can’t be defined. These are called Weak
Entity types.
For Example, A company may store the information of dependents (Parents, Children,
Spouse) of an Employee. But the dependents don’t have existed without the employee. So
Dependent will be a Weak Entity Type and Employee will be Identifying Entity type for
Dependent, which means it is Strong Entity Type.
A weak entity type is represented by a Double Rectangle. The participation of weak entity
types is always total. The relationship between the weak entity type and its identifying
strong entity type is called identifying relationship and it is represented by a double
diamond.
Participation Constraint
Participation Constraint is applied to the entity participating in the relationship set.
1. Total Participation – Each entity in the entity set must participate in the relationship. If
each student must enroll in a course, the participation of students will be total. Total
participation is shown by a double line in the ER diagram.
2. Partial Participation – The entity in the entity set may or may NOT participate in the
relationship. If some courses are not enrolled by any of the students, the participation in the
course will be partial.
The diagram depicts the ‘Enrolled in’ relationship set with Student Entity set having total
participation and Course Entity set having partial participation.
Every student in the Student Entity set participates in a relationship but there exists a course
C4 that is not taking part in the relationship.
Ans:
Generalization and specialization are the Enhanced Entity Relationship diagram (EER-
diagram)
1. Generalization :
It works on the principle of bottom up approach. In Generalization lower level functions are
combined to form higher level function which is called as entities. This process is repeated
further to make advanced level entities.
In the Generalization process properties are drawn from particular entities and thus we can
create generalized entity. We can summarize Generalization process as it combines
subclasses to form superclass.
Example of Generalization –
Consider two entities Student and Patient. These two entities will have some characteristics
of their own. For example Student entity will have Roll_No, Name and Mob_No while
patient will have PId, Name and Mob_No characteristics. Now in this example Name and
Mob_No of both Student and Patient can be combined as a Person to form one higher level
entity and this process is called as Generalization Process.
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.
After applying generalization and specialization, the structure of resultant figures are same.
14. Describe about entity, entity set, relationship, relationship set with suitable examples
Ans:
Entity
An Entity may be an object with a physical existence – a particular person, car, house, or
employee – or it may be an object with a conceptual existence – a company, a job, or a
university course.
Entity Set: An Entity is an object of Entity Type and a set of all entities is called an entity
set. For Example, E1 is an entity having Entity Type Student and the set of all students is
called Entity Set. In ER diagram, Entity Type is represented as:
Entity Set
1. Strong Entity
A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not depend on
other Entity in the Schema. It has a primary key, that helps in identifying it uniquely, and it
is represented by a rectangle. These are called Strong Entity Types.
2. Weak Entity
An Entity type has a key attribute that uniquely identifies each entity in the entity set. But
some entity type exists for which key attributes can’t be defined. These are called Weak
Entity types.
For Example, A company may store the information of dependents (Parents, Children,
Spouse) of an Employee. But the dependents don’t have existed without the employee. So
Dependent will be a Weak Entity Type and Employee will be Identifying Entity type for
Dependent, which means it is Strong Entity Type.
A weak entity type is represented by a Double Rectangle. The participation of weak entity
types is always total. The relationship between the weak entity type and its identifying
strong entity type is called identifying relationship and it is represented by a double
diamond.
Strong Entity and Weak Entity
Entity-Relationship Set
A set of relationships of the same type is known as a relationship set. The following
relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1, and S3 as registered in C3.
Relationship Set
2. Binary Relationship: When there are TWO entities set participating in a relationship, the
relationship is called a binary relationship. For example, a Student is enrolled in a Course.
Binary Relationship
3. n-ary Relationship: When there are n entities set participating in a relation, the
relationship is called an n-ary relationship.
Ans: In aggregation, the relation between two entities is treated as a single entity. In
aggregation, relationship with its corresponding entities is aggregated into a higher level entity.
For example: Center entity offers the Course entity act as a single entity in the relationship
which is in a relationship with another entity visitor. In the real world, if a visitor visits a
coaching center then he will never enquiry about the Course only or just about the Center
instead he will ask the enquiry about both.
16. With an example briefly describe Aggregation versus Ternary Relationships
3MARKS:
Ans:
A database management system (DBMS) is a software application that allows users to define,
create, and maintain databases, as well as to retrieve and manipulate data in those databases.
DBMSs provide a number of features and capabilities that make them essential for managing
large and complex datasets, including:
• Data organization: DBMSs organize data into a logical structure that makes it easy to
store, retrieve, and update.
• Data integrity: DBMSs help to ensure that data is accurate and consistent.
• Data security: DBMSs provide features to protect data from unauthorized access and
modification.
• Concurrency control: DBMSs allow multiple users to access and modify data in a
database at the same time without causing conflicts.
• Performance optimization: DBMSs are designed to optimize the performance of
database operations, such as queries and updates.
Goals of DBMS
Ans:
1. Duplicate Data
Data is stored more than once in different files, that means duplicate data may occur in all
these files. Since all the files are independent on each other so it is very difficult to overcome
this error and if anyone finds this error then it will take time and effort to solve this issue.
For Example: A student is having record in college library and in Examination department.
Then his name, roll number, fathers name and class will be same in both the departments.
Also these departments are not dependent on each other. So it create lots of duplicates value
about that student and when he needs any change for his name or class then he has to go to
both the departments to make these changes happen otherwise it will create problem for him.
2. Inconsistency
In file processing system, various copies of same data may contain different values. Data is
not consistent in this system, it means if a data item needs to be changed then all the files
containing that data need to be modified. It may create a risk of out dated values of data.
For Example: If you change student name in library then his name should be changed in all
the departments related to the student.
3. Accessing Anomalies
Accessing anomalies means that it is not easy to access data in a desired or efficient way. It
always puts these constraints in the programs by adding some codes. In File Processing
System, poor data integrity often arises and it becomes very difficult to add new constraints at
that time.
For Example: The maximum marks of the student can never be more than 100.
19. Explain the functionalities of DBA.
Ans:
Ans:
Ans:
o Logical data independence refers characteristic of being able to change the conceptual
schema without having to change the external schema.
o Logical data independence is used to separate the external level from the conceptual
view.
o If we do any changes in the conceptual view of the data, then the user view of the data
would not be affected.
o Logical data independence occurs at the user interface level.
Ans:
23. Explain the role of Query Processor component in DBMS.
Ans: Query processing is a process of translating a user query into an executable form. It
helps to retrieve the results from a database. In query processing, it converts the high-level
query into a low-level query for the database. Query processing is a very important
component of DBMS. It is critical to the performance of applications that rely on database
operations.
Ans:
• The storage manager is the component of a database system that provides the
interface between the low-level data stored in the database and the application
programs and queries submitted to the system. the storage manager is responsible
for storing, retrieving, and updating data in the database.
25. Differentiate single valued and multi valued attributes with an example.
Ans:
26. How to represent Entity sets and Relationship sets in an ER diagram? Quote
suitable example
Entity Set: An Entity is an object of Entity Type and a set of all entities is called an entity
set. For Example, E1 is an entity having Entity Type Student and the set of all students is
called Entity Set. In ER diagram, Entity Type is represented as:
Entity Set
A set of relationships of the same type is known as a relationship set. The following
relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1, and S3 as registered in C3.
Relationship Set
27. How to represent a weak entity set in an ER diagram? Quote suitable example
Ans:
An Entity type has a key attribute that uniquely identifies each entity in the entity set. But
some entity type exists for which key attributes can’t be defined. These are called Weak
Entity types.
For Example, A company may store the information of dependents (Parents, Children,
Spouse) of an Employee. But the dependents don’t have existed without the employee. So
Dependent will be a Weak Entity Type and Employee will be Identifying Entity type for
Dependent, which means it is Strong Entity Type.
A weak entity type is represented by a Double Rectangle. The participation of weak
entity types is always total. The relationship between the weak entity type and its
identifying strong entity type is called identifying relationship and it is represented by a
double diamond.
Ans:
Recursive Relationship
If there is a relationship between two entities and they both belong to the same entity type, then
this is called a recursive relationship. We can say a relationship between the same entity set is
called a recursive relationship. In the ER diagram, we can use one entity that will enter and exit
from itself will denote the recursive relationship. While mapping the ER diagram into the table,
we must consider the foreign key in the table for mapping the recursive relationship.
For Example, if a boy marries a girl and both belong to the human entity set, then this is called
the recursive relationship.
So, we can indirectly say that if an entity participates more than once in a relationship for
different roles, then this is called a recursive relationship. In the above example, the person
entity will be used for a boy, and then, on the other hand, it will be used for a girl, and there
will be a relation between them.
Examples:
We can understand the recursive relationships using the case study of an organization. In an
organization, we have employees and a CEO. Any successful organization follows the
hierarchy of employees where employees are arranged at their levels, and they report to their
supervisors. We can have two roles of relationships in an organization which are: supervisor
and subordinate. In an organization, each employee can have a maximum of only one
supervisor, but one supervisor can supervise more than one subordinate. Let's suppose we have
one relationship named 'reporting' between supervisors and subordinates.
Ans:
For example, Faculty and Student entities can be generalized and create a higher level entity
Person.
30. Explain about Specialization in an ER Model.
Ans:
Ans:
In aggregation, the relation between two entities is treated as a single entity. In aggregation,
relationship with its corresponding entities is aggregated into a higher level entity.
For example: Center entity offers the Course entity act as a single entity in the relationship
which is in a relationship with another entity visitor. In the real world, if a visitor visits a
coaching center then he will never enquiry about the Course only or just about the Center
instead he will ask the enquiry about both.
32. Explain the distinction between Binary versus Ternary Relationship.
Ans:
2MARKS:
Ans:
Metadata is simply defined as data about data. It means it is a description and context of the
data. It helps to organize, find and understand data. Let me explain to you by giving a real-
world example of metadata:
Every time you take a photo with today’s cameras a bunch of metadata is gathered and saved
with it. Such as
File name,
Ans:
The following SQL creates a table called "Persons" that contains five columns: PersonID,
LastName, FirstName, Address, and City:
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
The ALTER TABLE command adds, deletes, or modifies columns in a table.
The ALTER TABLE command also adds and deletes various constraints in a table.
WHERE condition;
The DELETE statement is used to delete existing records in a table.
DELETE FROM table_name WHERE condition;
36. How do you add column to table and delete column from table?
Ans: The ALTER TABLE statement is used to add, delete, or modify columns in an existing
table.
The ALTER TABLE statement is also used to add and drop various constraints on an existing
table. ALTER TABLE table_name
To delete a column in a table, use the following syntax (notice that some database systems
don't allow deleting a column): ALTER TABLE
table_name
Ans:
o Physical data independence can be defined as the capacity to change the internal schema
without having to change the conceptual schema.
o If we do any changes in the storage size of the database system server, then the
Conceptual structure of the database will not be affected.
o Physical data independence is used to separate conceptual levels from the internal
levels.
o Physical data independence occurs at the logical interface level.
38. Give syntaxes to DROP and TRUNCATE commands
Ans:
Syntax
DROP object object_name ;
The major difference between TRUNCATE and DROP is that truncate is used to delete the
data inside the table not the whole table.
The major difference between TRUNCATE and DROP is that truncate is used to delete the
data inside the table not the whole table.
Ans:
• Database design
• Performance issues
• Database accessibility
• Capacity issues
• Data replication
• Table Maintenance
Ans:
Ans:
Ans:
• It
specifies that each entity in the entity set must compulsorily participate in at least
one relationship instance in that relationship set.
• That is why, it is also called as mandatory participation.
• Total participation is represented using a double line between the entity set and
relationship set.
Example-
Here,
• Double line between the entity set “Student” and relationship set “Enrolled in”
signifies total participation.
• It specifies that each student must be enrolled in at least one course.
Ans:
• Itspecifies that each entity in the entity set may or may not participate in the
relationship instance in that relationship set.
• That is why, it is also called as optional participation.
• Partial participation is represented using a single line between the entity set and
relationship set.
Example-
Here,
• Single line between the entity set “Course” and relationship set “Enrolled in” signifies
partial participation.
• It specifies that there might exist some courses for which no enrollments are made.