0% found this document useful (0 votes)
35 views7 pages

Dbms Ans 2 Mark

Uploaded by

ashwanth0811
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views7 pages

Dbms Ans 2 Mark

Uploaded by

ashwanth0811
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Sure, let’s go through each question one by one.

1. *Define Database Management System (DBMS).*

A *Database Management System (DBMS)* is software that provides an interface to


manage, manipulate, and query data stored in a database. It allows users to create,
update, delete, and retrieve data in a structured and efficient manner while ensuring
data integrity, security, and concurrency control. Examples of DBMS include MySQL,
PostgreSQL, Oracle, and Microsoft SQL Server.

2. *Identify the Attributes and specify the Type of Attribute from the following ER
diagram.*

To answer this, I would need to see the actual ER diagram. However, in general,
attributes in an ER diagram can be classified into:

- *Simple Attribute*: Cannot be divided further (e.g., Employee_ID, Name).

- *Composite Attribute*: Can be divided into smaller sub-parts (e.g., Address might be
divided into Street, City, State).

- *Derived Attribute*: Value can be derived from other attributes (e.g., Age derived
from Date of Birth).

- *Multi-valued Attribute*: Can have multiple values (e.g., Phone Numbers).

3. *An entity in CUSTOMER entity set is associated with at most one entity in LOAN set.
An entity in LOAN, however, can be associated with any number (zero or more) of
entities in CUSTOMER. What is the cardinality of the relation between LOAN and
CUSTOMER?*

The cardinality of the relation between LOAN and CUSTOMER is *one-to-many*. This
means:

- One CUSTOMER can be associated with at most one LOAN.

- One LOAN can be associated with many CUSTOMERS.


4. *Explain the concept of weak entity sets and their importance in database design.*

A *weak entity set* is an entity that cannot be uniquely identified by its own attributes
alone. Instead, it relies on a "strong" or "owner" entity set and a partial key (a key that
can uniquely identify the weak entity within the context of the owner entity). Weak
entities are important in database design because they represent entities that are
dependent on another entity for their identification. This is often used to model
relationships where the weak entity's existence is dependent on the strong entity.

5. *Write SQL queries for the following:*

i) *Change the city for account-number A-101 to Harrison:*

sql

UPDATE Accounts

SET City = 'Harrison'

WHERE Account_Number = 'A-101';

ii) *Display account-number and ssn number whose name is Johnson:*

sql

SELECT Account_Number, SSN

FROM Accounts

WHERE Name = 'Johnson';

6. *Identify the Constraint in the following Relations and write the query for it.*

Constraints include:

- *Primary Key Constraint*: Ensures uniqueness of records.


- *Foreign Key Constraint*: Ensures referential integrity between tables.

Based on the relations provided:

- Employee_Details might have Emp_ID as a primary key.

- Payroll might have Empid as a foreign key referencing Emp_ID in Employee_Details.

SQL Query to list employees who have salaries in Payroll:

sql

SELECT e.Emp_ID, e.Emp_Name

FROM Employee_Details e

JOIN Payroll p ON e.Emp_ID = p.Empid;

7. *Define Normalization.*

*Normalization* is the process of organizing data within a database to reduce


redundancy and improve data integrity. The goal is to divide large tables into smaller,
related tables and define relationships between them. This process involves applying a
series of rules called normal forms, such as 1NF, 2NF, and 3NF, to ensure the data
structure is efficient and minimizes duplication.

8. *Identify the Partial and Transitive dependencies from the following Relation: Invoice*

Without the actual relation schema, here's a general explanation:

- *Partial Dependency*: Occurs when a non-prime attribute is dependent on part of a


candidate key, rather than the whole candidate key.

- *Transitive Dependency*: Occurs when a non-prime attribute depends on another


non-prime attribute, rather than depending directly on a candidate key.

Example:
If Invoice has columns Invoice_ID, Product_ID, Product_Name, and Quantity, and if
Product_Name depends on Product_ID, this could indicate transitive dependency if
Product_ID is not part of the primary key.

9. *What is the purpose of indexing in a database?*

*Indexing* improves the speed of data retrieval operations on a database table at the
cost of additional space and maintenance overhead. An index helps in quickly locating
the rows based on the indexed columns, thus speeding up query performance,
especially for large datasets.

10. *Distinguish between fixed length records and variable length records.*

- *Fixed Length Records*: Each record in the file has the same length. This simplifies
data retrieval and storage but may waste space if records are not uniformly filled.

- *Variable Length Records*: Records can vary in length, allowing for more efficient
use of space. However, it complicates data retrieval and may require additional
mechanisms to handle varying lengths.

11. *Differentiate between strong entity set and weak entity set.*

- *Strong Entity Set*: An entity that can be uniquely identified by its own attributes
alone. It has a primary key.

- *Weak Entity Set*: An entity that cannot be uniquely identified by its own attributes
and relies on a strong entity for identification. It uses a partial key and is often identified
with the help of a strong entity’s key.

12. *Consider an E-R diagram with entities Department and Employee. Describe how to
identify and represent multivalued attributes in this diagram.*
- *Multivalued Attribute*: An attribute that can hold multiple values for a single entity.
For example, if an Employee can have multiple Skills, then Skills would be a multivalued
attribute.

- *Representation*: In an ER diagram, a multivalued attribute is represented by a


double oval connected to the entity it belongs to.

13. *State any two issues in designing E-R Model and how it can be overcome.*

- *Issue 1: Redundancy*: Duplicate data can occur in ER models.

- *Solution*: Normalize the database design to eliminate redundancy.

- *Issue 2: Complexity*: Overly complex relationships can make the model difficult to
understand.

- *Solution*: Simplify the model by breaking it into smaller, manageable components


and using clear relationships.

14. *Mention the significance about the roles of DBA.*

- *Database Design*: Designing the database schema and ensuring it meets the
requirements.

- *Performance Tuning*: Optimizing database performance through indexing and


query optimization.

- *Security Management*: Implementing security measures to protect data.

- *Backup and Recovery*: Ensuring data is backed up regularly and can be recovered
in case of failure.

15. *Write any two SQL queries to demonstrate the special operators such as LIKE and
BETWEEN.*

- *LIKE*: Find names starting with 'J':

sql

SELECT Name
FROM Employees

WHERE Name LIKE 'J%';

- *BETWEEN*: Find employees hired between two dates:

sql

SELECT Name, Hire_Date

FROM Employees

WHERE Hire_Date BETWEEN '2023-01-01' AND '2023-12-31';

16. *Given the relation Book (ISBN, Title, Author, Publisher, Year), identify and write the
foreign key constraints for the table.*

Assuming Book is a standalone table, it doesn’t have foreign keys in this context.
However, if there were related tables such as Publisher with Publisher_ID, Publisher_ID
in Book could be a foreign key.

17. *Discuss the role of functional dependencies in the process of normalization.*

*Functional Dependencies* are used to determine how attributes in a relation depend


on each other. They play a crucial role in normalization by helping to identify partial,
transitive, and other dependencies that need to be resolved to achieve higher normal
forms. Properly addressing functional dependencies ensures that the database schema
is free from anomalies and redundant data.

18. *State the rule to design Boyce-Codd Normal Form (BCNF) and write its significance
in database normalization.*

- *BCNF Rule*: A table is in BCNF if, for every functional dependency X → Y, X is a


superkey.
- *Significance*: BCNF eliminates anomalies and redundancy by ensuring that every
functional dependency’s left-hand side is a superkey, which results in a more robust
and efficient database design.

19. *Give an analogy to demonstrate file organization.*

- *Analogy*: Think of file organization like arranging books in a library. Fixed-length


records are like books of the same size placed on specific shelves, while variable-length
records are like books of different sizes placed in different sections with enough space
to accommodate varying sizes.

20. *Compare and contrast primary index and secondary index in terms of their usage
and performance in databases.*

- *Primary Index*:

- *Usage*: Created on the primary key of a table.

- *Performance*: Generally faster for retrieval operations because it maintains a


unique ordering based on the primary key.

- *Characteristics*: The data is physically ordered according to the primary key.

- *Secondary Index*:

- *Usage*: Created on non-primary key columns to improve search performance on


those columns.

You might also like