Dbms Qns
Dbms Qns
When it is Designed when the database is initially set Changes frequently as data is inserted,
created up; it does not change often. updated, or deleted in the database.
Contains Does not contain any data itself; it's just a Contains data at any given moment; it's a
Data design or skeleton. snapshot of the current state of the
database.
Purpose Defines the overall design and structure of Represents the current state of the
the database. database with data at that moment.
Example Tables, columns, and relationships between Data like customer names, orders, and
tables. products.
3. List any SIX major advantages of using a DBMS(3)(6 points)
1. Controlling Redundancy
Prevents duplication of data, saving storage space and ensuring
consistency.
Example: Stores information like a student’s name in only one place.
2. Controlling Inconsistency
Ensures data remains accurate and free from conflicting information.
Reducing redundancy also reduces inconsistency.
3. Data Integrity and Security
Maintains data accuracy and enforces access controls for security.
Example: Ensures only authorized users can view or modify salary data.
4. Facilitating Data Sharing
Allows multiple users to access and use the same data for different
purposes.
Example: Various departments can share customer data for reports and
analysis.
5. Concurrent Access and Crash Recovery
Manages multiple users accessing data simultaneously without errors.
Protects data from being lost during system crashes.
6. Providing Backup and Recovery
Creates backups and restores data in case of system failures.
Example: Restores the database if a system crash occurs during a
transaction.
4. What is the concept of a weak entity used in data modelling? Define the
terms entity type, Identifying relationship type.
An entity set may not have sufficient attribute to form a primary key is
termed a weak entity set.
• An entity set that has a primary key is termed as strong entity set.
• For a weak entity set to be meaningful, it must be associated with another
entity set, called the identifying or owner entity set.
• A weak entity set does not have a primary key.
Weak entities are represented with double rectangular box in the ER
diagram and the identifying relationships are represented with double
diamond.
In the above ER Diagram, ‘Payment’ is the weak entity. ‘Loan Payment’ is
the identifying relationship and ‘PaymentNumber’ is the partial key.
iii. What constraints do the partial key and the identifying relationship of
the weak entity type specify in this diagram?
The constraints are:
Partial Key Constraint: Ensures the uniqueness of a home when
combined with the owner's identifier.
Identifying Relationship Constraint: Each home must be associated with
exactly one owner to establish its identity.
iv. List the names of all relationship types and specify the (min, max)
constraint on each participation of an entity type in a relationship type.
Relationships and Constraints:
Owns (Owner ↔ Home):
Owner (1, n)
Home (1, 1)
Lists (Agent ↔ Home):
Agent (1, n)
Home (0, 1)
Works At (Agent ↔ Office):
Agent (1, 1)
Office (1, n)
Buys (Buyer ↔ Home):
Buyer (1, 1)
Home (0, n)
Associates (Buyer ↔ Agent):
Buyer (1, 1)
Agent (1, n)
v. Suppose that every customer must have at least one account but is
restricted to at most two loans at a time, and that a bank branch cannot
have more than 1,000 loans. How does this show up on the (min, max)
constraints?
Customer ↔ Account: (1, n) for the customer, indicating at least one
account.
Customer ↔ Loan: (0, 2) for the customer, restricting the maximum
number of loans to two.
Branch ↔ Loan: (0, 1,000) for the branch, restricting loans to a
maximum of 1,000 per branch.