DMS
DMS
The ability to modify the internal schema without causing any change to
external schema is:
1. DBA is a:
(a) Software
(b) Hardware
(c) Person
(d) Others
2. The DML provides following function access to the database:
3. Aggregation is:
(a) Specialization
(b) generalization
(c) Abstraction
(a) Truncate
(b) Drop
(c) Select
(a) View
(b) Rollback
(a) Min
(b) Max
(c) Select
(d) Avg
13. An entity set that does not have sufficient attributes to form a
primary key is a:
(a) Strong entity set
(b) Weak entity set
(c) Attribute
(d) Degree.
(b) Teradata
a) Entity
b) Attribute
c) Key
d) Relationship.
Explain the roles of a database administrator (DBA)
An Employee or Product
Example An OrderItem in an Order entity
entity
Data
High data redundancy and Minimal data redundancy and high
Redundancy
inconsistency due to lack of consistency through normalization
and
normalization and constraints
Consistency
Explain the difference among primary key, candidate key and super key
1. Primary Key:
a. A primary key is a unique identifier for a record in a table.
b. It ensures that no two records have the same value for the
primary key attribute.
c. A primary key cannot contain NULL values.
d. Example: In a table of students, the StudentID can be the
primary key as it uniquely identifies each student.
2. Candidate Key:
a. A candidate key is a set of attributes that can uniquely identify a
record in a table.
b. There can be multiple candidate keys in a table.
c. Every candidate key can serve as a potential primary key.
d. Example: In a table of students, both StudentID and Email can
be candidate keys as they uniquely identify each student.
3. Super Key:
a. A super key is a set of attributes that can uniquely identify a
record in a table.
b. A super key can include one or more attributes.
c. All candidate keys and primary keys are super keys, but not all
super keys are candidate keys (super keys can have extra
attributes).
d. Example: In a table of students, {StudentID, Email} and
{StudentID, Name} can be super keys as they uniquely identify
each student, but they are not minimal like candidate keys.
Alternate Key:
• An alternate key is a candidate key that is not chosen as the primary key
of a table.
• It can uniquely identify records in the table but serves as an alternative
to the primary key.
Example:
In an Employee table:
Both Email and PhoneNumber can uniquely identify employees but are not
the primary key.
1. Specialization:
a. Specialization is the process of defining a set of subclass entities
from a superclass entity based on some distinguishing
characteristics.
b. In specialization, an entity type is divided into subtypes that have
their unique attributes or relationships in addition to those
inherited from the parent entity.
c. Example: In a database, if we have a Person entity, we can
specialize it into Employee and Customer entities. Each of these
sub-entities will have attributes specific to them, such as Salary
for Employee and PurchaseHistory for Customer.
2. Generalization:
a. Generalization is the reverse process of specialization. It is the
process of combining multiple entity types into a higher-level
generic entity type based on common characteristics.
b. In generalization, common attributes or relationships of lower-
level entities are abstracted into a higher-level entity.
c. Example: If we have Car and Bike entities, we can generalize
them into a Vehicle entity, capturing the common attributes like
Make, Model, and EngineCapacity.
3. Aggregation:
a. Aggregation is a modeling concept used to express a relationship
between a whole and its parts, or to represent a "has-a"
relationship between entities.
b. In aggregation, a higher-level entity is formed by grouping related
lower-level entities, showing how they collectively represent a
more complex entity.
c. Example: In a university database, an Instructor entity and a
Course entity can be aggregated to form a TeachingAssignment
entity, which represents the assignment of instructors to courses.
1. Entities:
a. An entity is a distinct object or "thing" in the real world that can be
identified and has an independent existence. In the context of
databases, entities are typically represented as tables, with each
row corresponding to an instance of the entity.
b. Example: In a database for a school, Student, Teacher, and
Course are entities.
2. Attributes:
a. Attributes are the properties or characteristics of an entity that
provide more details about it. Each attribute corresponds to a
column in a table, and each entity instance has values for these
attributes.
b. Example: For the Student entity, attributes could include
StudentID, Name, DateOfBirth, and Address.
3. Relationships:
a. Relationships define how entities are related to each other. They
describe the associations between different entities and can be
one-to-one, one-to-many, or many-to-many.
b. Example: In a school database, there could be a relationship
between the Student and Course entities, indicating which
students are enrolled in which courses.
4. Discriminator:
a. A discriminator is an attribute used to distinguish between
different subtypes of an entity in a database. It is often used in the
context of inheritance, where a single table is used to store
information about different but related entities.
b. Example: In a Person entity that includes both Employee and
Customer, a Type attribute could be used as a discriminator to
indicate whether a record represents an Employee or a
Customer.
5. Existence Dependencies:
a. Existence dependency refers to the relationship between entities
where the existence of one entity depends on the existence of
another entity. Typically, a weak entity is existence-dependent on
a strong entity.
b. Example: An OrderItem entity is existence-dependent on an
Order entity because an order item cannot exist without being
part of an order.
Sure! Here are the differences between Weak and Strong Entities in table
form:
Aspect Weak Entity Strong Entity
An Employee or
Example An OrderItem in an Order entity
Product entity
Example:
Examples:
Sure! Here are short explanations for DDL, DML, DCL, and TCL:
Explain how GROUP BY, HAVING and WHERE can be used in same SQL
query.
FROM Sales
GROUP BY EmployeeID
Variable
Variables bound to tuples Variables bound to attribute values
Binding