Dbms Ans 2 Mark
Dbms Ans 2 Mark
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:
- *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).
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:
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.
sql
UPDATE Accounts
sql
FROM Accounts
6. *Identify the Constraint in the following Relations and write the query for it.*
Constraints include:
sql
FROM Employee_Details e
7. *Define Normalization.*
8. *Identify the Partial and Transitive dependencies from the following Relation: Invoice*
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.
*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.
13. *State any two issues in designing E-R Model and how it can be overcome.*
- *Issue 2: Complexity*: Overly complex relationships can make the model difficult to
understand.
- *Database Design*: Designing the database schema and ensuring it meets the
requirements.
- *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.*
sql
SELECT Name
FROM Employees
sql
FROM Employees
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.
18. *State the rule to design Boyce-Codd Normal Form (BCNF) and write its significance
in database normalization.*
20. *Compare and contrast primary index and secondary index in terms of their usage
and performance in databases.*
- *Primary Index*:
- *Secondary Index*: