8 Lecture
CS403
Midterm & Final Term Short Notes
Attributes
Attributes are characteristics or properties of an entity in a database or data model. In other words, attributes describe the properties, features or traits of an object or concept. For example, in a database of customers, attributes may includ
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
- Which of the following is a characteristic of an attribute in a database?
A. It describes the structure of a database
B. It represents a relationship between entities
C. It describes the properties of an entity
D. It defines the rules for data manipulation
Answer: C
What is the difference between a single-valued and a multi-valued attribute?
A. Single-valued attributes are mandatory, while multi-valued attributes are optional.
B. Single-valued attributes can have only one value, while multi-valued attributes can have multiple values.
C. Single-valued attributes are used to identify an entity, while multi-valued attributes are used to describe the entity.
D. Single-valued attributes are atomic, while multi-valued attributes are composite.
Answer: B
Which of the following data types can an attribute have?
A. String
B. Numeric
C. Date
D. All of the above
Answer: D
Which of the following is not an example of an attribute?
A. Customer ID
B. Order Date
C. Product Price
D. Customer Address Book
Answer: D
In database design, what is the purpose of defining attributes?
A. To identify relationships between entities
B. To define the structure of the database
C. To describe the properties of an entity
D. To enforce data integrity rules
Answer: C
Which of the following is an example of a composite attribute?
A. Customer Name
B. Customer Address
C. Customer Phone Number
D. Customer Email Address
Answer: B
Which of the following is an example of a derived attribute?
A. Customer ID
B. Order Total
C. Product Description
D. Order Quantity
Answer: B
Which of the following is an example of a domain constraint on an attribute?
A. A maximum length for a string attribute
B. A minimum and maximum value for a numeric attribute
C. A specific set of values for a categorical attribute
D. All of the above
Answer: D
In a database table, what is a key attribute?
A. An attribute used to uniquely identify each entity
B. An attribute used to describe the properties of an entity
C. An attribute used to define the relationships between entities
D. An attribute used to enforce data integrity rules
Answer: A
What is the difference between a primary key and a foreign key in a database?
A. A primary key is used to uniquely identify an entity, while a foreign key is used to represent a relationship between entities.
B. A primary key is used to represent a relationship between entities, while a foreign key is used to uniquely identify an entity.
C. A primary key and a foreign key are the same thing.
D. A primary key is used to enforce data integrity rules, while a foreign key is used to define the structure of the database.
Answer: A
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
Define the term "attribute" in the context of a database. Answer: In the context of a database, an attribute is a characteristic or property of an entity or a relationship. Explain the difference between a simple and a composite attribute. Answer: A simple attribute contains only one value, while a composite attribute is composed of multiple values. What is a derived attribute? Answer: A derived attribute is an attribute that can be calculated or derived from other attributes. What is a multivalued attribute? Answer: A multivalued attribute is an attribute that can have multiple values for a single instance of an entity. How is a null value represented in an attribute? Answer: A null value in an attribute represents a missing or unknown value. What is an atomic attribute? Answer: An atomic attribute is an attribute that cannot be divided into smaller parts. Explain the difference between a key attribute and a non-key attribute. Answer: A key attribute is used to uniquely identify an instance of an entity, while a non-key attribute does not have this property. What is a domain in the context of attributes? Answer: A domain is the set of possible values that an attribute can take. Give an example of a domain for an attribute. Answer: For example, the domain of an attribute "age" can be any positive integer value between 0 and 120. What is an attribute domain constraint? Answer: An attribute domain constraint is a rule that specifies the allowed values for an attribute based on its domain.