Viva Questions
Viva Questions
A database is an organized collection of data that is stored and accessed electronically. Databases are designed to
efficiently store, manage, and retrieve large amounts of information.
What are popular database models?
1. Relational Database Model:
• Description: Data is organized into tables (also called relations) consisting of rows and columns. Each
row represents a record, and each column represents an attribute of the record.
• Examples: MySQL, PostgreSQL, Oracle, Microsoft SQL Server.
2. NoSQL Database Models:
• Document Store:
o Description: Data is stored in documents (typically JSON or BSON), which can have a flexible
schema.
o Examples: MongoDB, CouchDB.
Key-Value Store:
o Description: Data is stored as key-value pairs, where each key is unique and maps to a value.
o Examples: Redis, DynamoDB, Riak.
• Column Store:
o Description: Data is stored in columns rather than rows, optimizing read performance for large
datasets.
o Examples: Apache Cassandra, HBase.
• Graph Database:
o Description: Data is stored as nodes and edges, representing entities and their relationships.
o Examples: Neo4j, Amazon Neptune.
3. Hierarchical Database Model:
• Description: Data is organized in a tree-like structure with parent-child relationships. Each child node has
only one parent node.
• Examples: IBM Information Management System (IMS), Windows Registry.
• Use Cases: Used in applications with a clear hierarchical relationship, such as organizational structures
and file systems.
4. Network Database Model:
• Description: Data is organized as a graph structure, allowing multiple parent-child relationships. It is a
more flexible version of the hierarchical model.
• Examples: Integrated Data Store (IDS), CA-IDMS.
Object-Oriented Database Model:
• Description: Data is represented as objects, like object-oriented programming. Objects contain both data
and methods for data manipulation.
• Examples: db4o, ObjectDB.
What is data administrator and database administrator?
Data Administrator (DA)
Role and Responsibilities
Data Governance: Establishing policies and procedures for managing data within the organization, ensuring
data quality, consistency, and compliance with regulations.
Data Modeling: Designing and maintaining the data architecture, including the creation of data models that
define the structure, relationships, and constraints of the data.
Data Security: Implementing and enforcing data security policies to protect sensitive information from
unauthorized access and breaches.
Data Standards: Defining and maintaining data standards, including naming conventions, data definitions,
and metadata management.
Data Quality Management: Ensuring the accuracy, completeness, and reliability of the data by implementing
data validation and cleansing processes.
Coordination: Collaborating with other departments and stakeholders to understand their data needs and
ensuring that data management practices support the organization's goals and objectives.
Skills and Knowledge
1. Understanding of data governance frameworks and best practices.
2. Expertise in data modeling tools and techniques.
3. Knowledge of data security principles and practices.
4. Familiarity with data quality management tools and methodologies.
5. Strong analytical and problem-solving skills.
6. Excellent communication and collaboration skills.
Database Administrator (DBA)
Role and Responsibilities
Database Installation and Configuration: Setting up and configuring database management systems
(DBMS) such as MySQL, PostgreSQL, Oracle, or SQL Server.
Database Maintenance: Performing routine maintenance tasks such as backups, recovery, and patch
management to ensure the database operates smoothly.
Performance Tuning: Monitoring and optimizing database performance to ensure efficient query execution
and response times.
Security Management: Implementing security measures such as access controls, encryption, and auditing to
protect the database from unauthorized access and threats.
Database Design and Implementation: Creating and managing database schemas, tables, indexes, and other
database objects to support application requirements.
Data Recovery: Planning and executing data recovery strategies to protect against data loss and ensure
business continuity.
Troubleshooting: Identifying and resolving database issues, such as performance bottlenecks, connectivity
problems, and data corruption.
User Support: Assisting developers, analysts, and other users with database-related issues and providing
technical support as needed.
Skills and Knowledge
Naive User: Interacts through applications and Sophisticated User: Interacts directly with the
interfaces database using SQL and advanced tools
Naive User: Limited understanding of the Sophisticated User: In-depth knowledge of the
database structure and query languages database schema, query optimization, and database
management tools.
Naive User: Routine tasks like data entry, basic Sophisticated User: Complex tasks like custom
retrieval, and updates querying, data analysis, and schema design.
Naive User: Relies on predefined queries and Sophisticated User: Creates and modifies queries
reports and reports as needed.
What is meant by people and procedure?
"People" refers to the various individuals who interact with the database system, each playing a distinct
role to ensure the system's operation, maintenance, and utilization. Key roles include:
Database Administrators (DBAs):
Responsibilities: Managing and maintaining the database system, ensuring its performance, security,
backup, and recovery.
Skills: Knowledge of DBMS, SQL, performance tuning, security protocols, and data integrity.
Database Designers:
Responsibilities: Designing the database schema, defining tables, relationships, constraints, and indexes.
Skills: Data modeling, understanding of normalization, and database design principles.
Application Developers:
Responsibilities: Writing applications that interact with the database, including queries, transactions, and
business logic.
Skills: Proficiency in SQL, programming languages, and understanding of database APIs and drivers.
End Users:
Responsibilities: Using applications to perform tasks such as data entry, querying, and generating reports.
Skills: Basic knowledge of using the application interfaces and understanding the data relevant to their tasks.
Data Analysts:
Responsibilities: Analyzing data, generating insights, and creating reports.
Skills: Advanced SQL, data analysis tools, and understanding of the database schema.
System Administrators:
Responsibilities: Managing the hardware and operating systems on which the database runs.
Skills: Knowledge of system administration, network configuration, and security.
Procedures
"Procedures" refer to the documented methods and processes that guide the interaction with the database
system. These procedures ensure that the database is used consistently and correctly, maintaining data integrity,
security, and performance. Key procedures include:
Backup and Recovery Procedures:
Steps to regularly back up data and restore it in case of data loss or corruption.
Importance: Ensures data availability and business continuity.
Security Procedures:
Measures to protect the database from unauthorized access, including user authentication, authorization,
and encryption.
Importance: Safeguards sensitive data and complies with regulations.
Data Entry Procedures:
Guidelines for entering data into the database to ensure consistency, accuracy, and completeness.
Importance: Maintains data quality and integrity.
Query and Reporting Procedures:
Standards for writing and executing queries and generating reports to ensure efficient data retrieval and
analysis.
Importance: Optimizes performance and ensures relevant data is retrieved.
Maintenance Procedures:
Regular tasks such as indexing, defragmentation, and updates to maintain database performance.
Importance: Keeps the database running smoothly and efficiently.
Change Management Procedures:
Processes for managing changes to the database schema, application code, and infrastructure.
Importance: Ensures changes are tested, documented, and implemented without disrupting operations.
Audit Procedures:
Methods for tracking and logging database access and changes to detect and investigate unauthorized or
suspicious activities.
Importance: Enhances security and compliance.
What is difference between DBMS and RDMS?
DBMS RDBMS
Software for managing databases using various data models A type of DBMS that uses a relational model
(hierarchical, network, etc.). with structured tables (relations).
What is difference between file management system and Database management system?
FMS DBMS
Manages data files on a computer system. Software for managing structured data in
databases.
Individual files. Organized into tables.
Often unstructured or semi-structured. Highly structured with predefined schemas.
Manual navigation through file directories. SQL or other query languages.
High, with possible duplication. Reduced due to normalization.
Limited enforcement mechanisms. Strong enforcement with keys and constraints.
Basic file-level security. Advanced features like role-based access control.
Less scalable, cumbersome with large volumes. Highly scalable and efficient.
Examples: FAT32, NTFS, HFS+, ext4. Examples: MySQL, PostgreSQL, Oracle,
Microsoft SQL Server, MongoDB.
Limited support. Robust support.
What is Entity?
An entity is an object or concept that can be distinctly identified and has a set of attributes that describe it. It is
used to model real-world objects or concepts within a database.
What is a File?
File is a digital container used to store data on a storage medium. Files are a more general concept and can be
used to store various types of data, not necessarily organized in a structured manner like in databases.
What is Attribute?
Attributes are the properties or characteristics of an entity. For example, a "Customer" entity might have attributes
like CustomerID, Name, Address, and PhoneNumber.
What is Tuple?
A tuple is a collection of related data items (values) that represent a single entity instance within a table. Each
value in the tuple corresponds to a specific attribute of the table.
What is cardinality of relation?
Cardinality of a relationship refers to the number of instances of one entity that can or must be associated with
instances of another entity. It describes the nature of the relationship between entities in terms of how many
entities are involved in a particular relationship.
Types of Cardinalities
1. One-to-One (1:1):
o In a one-to-one relationship, each instance of Entity A is associated with exactly one instance of
Entity B, and vice versa.
o Example: A "Person" entity and a "Passport" entity might have a one-to-one relationship if each
person can only have one passport and each passport is assigned to only one person.
2. One-to-Many (1):
o In a one-to-many relationship, each instance of Entity A can be associated with multiple instances
of Entity B, but each instance of Entity B is associated with only one instance of Entity A.
o Example: A "Department" entity and an "Employee" entity where each department can have
multiple employees, but each employee belongs to only one department.
3. Many-to-One (N:1):
o In a many-to-one relationship, multiple instances of Entity A can be associated with one instance
of Entity B, but each instance of Entity B is associated with only one instance of Entity A.
o Example: An "Order" entity and a "Customer" entity where each customer can place multiple
orders, but each order is placed by only one customer.
4. Many-to-Many (M):
o In a many-to-many relationship, multiple instances of Entity A can be associated with multiple
instances of Entity B.
o Example: A "Student" entity and a "Course" entity where students can enroll in multiple courses,
and each course can have multiple students enrolled.
What is ERD?
An Entity-Relationship Diagram (ERD) is a visual representation of the data and the relationships between entities
in a database. It is a crucial tool in database design that helps to model the structure of a database and understand
the data requirements of a system.
Who invented RDBMS?
The concept of the Relational Database Management System (RDBMS) was introduced by Edgar F. Codd.
Codd, an English computer scientist, published his groundbreaking paper titled "A Relational Model of Data for
Large Shared Data Banks" in 1970. This paper outlined the principles of the relational model, which
revolutionized the way data is stored, managed, and queried.
What is functional dependency?
functional dependency is a concept that specifies the relationship between two sets of attributes where one
attribute determines the value of another attribute. It is denoted as X → Y, where the attribute set on the left side
of the arrow, X is called Determinant, and Y is called the Dependent.
Properties of Functional dependency (Armstrong’s axioms)
There are 3 types of Axioms:
1. Reflexivity Axiom:
For a set of attributes A and a subset B of A, if B is a subset of A (B⊆A), then A→B. This axiom
represents a trivial property where a set of attributes implies itself.
2. Augmentation Axiom:
If A→B is true and Y is a set of attributes, then AY→BY is also true. This axiom demonstrates that
adding attributes to dependencies does not alter the fundamental dependencies. If A→B holds, AC→BC
holds for any set of attributes C.
3. Transitivity Axiom:
If A→B holds and B→C holds, then A→C also holds, like the transitive rule in algebra. Functionally, it
means that if A determines B and B determines C, then A determines C. If X→Y and Y→Z are true, then
X→Z is also true.
What is Transitive dependency?
When an indirect relationship causes functional dependency, it is called Transitive Dependency.
If P -> Q and Q -> R is true, then P-> R is a transitive dependency.
What is Normalization?
• Normalization is the process of organizing the data in the database.
• Normalization is used to minimize the redundancy from a relation or set of relations. It is also used to
eliminate undesirable characteristics like Insertion, Update, and Deletion Anomalies.
• Normalization divides the larger table into smaller and links them using relationships.
• The normal form is used to reduce redundancy from the database table.
Reason for Normalization:
The main reason for normalizing the relations is removing these anomalies. Failure to eliminate anomalies
leads to data redundancy and can cause data integrity and other problems as the database grows. Normalization
consists of a series of guidelines that helps to guide you in creating a good database structure.
Data modification anomalies can be categorized into three types:
• Insertion Anomaly: Insertion Anomaly refers to when one cannot insert a new tuple into a relationship
due to lack of data.
• Deletion Anomaly: The delete anomaly refers to the situation where the deletion of data results in the
unintended loss of some other important data.
• Updatation Anomaly: The update anomaly is when an update of a single data value requires multiple
rows of data to be updated.
2NF A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional
dependent on the primary key.
4NF A relation will be in 4NF if it is in Boyce Codd's normal form and has no multi-valued
dependency.