Download Database Attributes and Operations and more Cheat Sheet Database Programming in PDF only on Docsity!
Database Questions and Answers – The Entity-Relationship Model This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “The Entity-Relationship Model”.
- An ________ is a set of entities of the same type that share the same properties, or attributes. a) Entity set b) Attribute set c) Relation set d) Entity model View Answer Answer: a Explanation: An entity is a “thing” or “object” in the real world that is distinguishable from all other objects.
- Entity is a _________ a) Object of relation b) Present working model c) Thing in real world d) Model of relation View Answer
Answer: c Explanation: For example, each person in a university is an entity.
- The descriptive property possessed by each entity set is _________ a) Entity b) Attribute c) Relation d) Model View Answer Answer: b Explanation: Possible attributes of the instructor entity set are ID, name, dept name, and salary.
- The function that an entity plays in a relationship is called that entity’s
a) Participation b) Position c) Role d) Instance View Answer Answer: c Explanation: A relationship is an association among several entities.
b) 0 c) NULL d) Blank Space View Answer Answer: c Explanation: NULL always represents that the value is not present.
- Which of the following can be a multivalued attribute? a) Phone_number b) Name c) Date_of_birth d) All of the mentioned View Answer Answer: a Explanation: Name and Date_of_birth cannot hold more than 1 value.
- Which of the following is a single valued attribute a) Register_number b) Address c) SUBJECT_TAKEN d) Reference View Answer
Answer: a Explanation: None.
- In a relation between the entities the type and condition of the relation should be specified. That is called as______attribute. a) Desciptive b) Derived c) Recursive d) Relative View Answer Answer: a Explanation: Consider the entity sets student and section, which participate in a relationship set takes. We may wish to store a descriptive attribute grade with the relationship to record the grade that a student got in the class. Database Questions and Answers – Constraints This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Constraints”.
- _____________ express the number of entities to which another entity can be associated via a relationship set. a) Mapping Cardinality
d) Many-to-one View Answer Answer: d Explanation: Here more than one entity in one set is related to one one entity in other set.
- Data integrity constraints are used to: a) Control who is allowed access to the data b) Ensure that duplicate records are not entered into the table c) Improve the quality of data entered for a specific property d) Prevent users from changing the values stored in the table View Answer Answer: c Explanation: The data entered will be in a particular cell (i.e., table column).
- Establishing limits on allowable property values, and specifying a set of acceptable, predefined options that can be assigned to a property are examples of: a) Attributes b) Data integrity constraints c) Method constraints d) Referential integrity constraints View Answer
Answer: b Explanation: Only particular value satisfying the constraints are entered in the column.
- Which of the following can be addressed by enforcing a referential integrity constraint? a) All phone numbers must include the area code b) Certain fields are required (such as the email address, or phone number) before the record is accepted c) Information on the customer must be known before anything can be sold to that customer d) Then entering an order quantity, the user must input a number and not some text (i.e., 12 rather than ‘a dozen’) View Answer Answer: c Explanation: None.
- ______ is a special type of integrity constraint that relates two relations & maintains consistency across the relations. a) Entity Integrity Constraints b) Referential Integrity Constraints c) Domain Integrity Constraints d) Domain Constraints View Answer
Answer: d Explanation: Foreign key is used when primary key of one relation is used in another relation.
- ____________ is preferred method for enforcing data integrity a) Constraints b) Stored Procedure c) Triggers d) Cursors View Answer Answer: a Explanation: Constraints are specified to restrict entries in the relation. Database Questions and Answers – Entity-Relationship Diagrams This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Entity-Relationship Diagrams”.
- Which of the following gives a logical structure of the database graphically ? a) Entity-relationship diagram b) Entity diagram c) Database diagram
d) Architectural representation View Answer Answer: a Explanation: E-R diagrams are simple and clear—qualities that may well account in large part for the widespread use of the E-R model.
- The entity relationship set is represented in E-R diagram as a) Double diamonds b) Undivided rectangles c) Dashed lines d) Diamond View Answer Answer: d Explanation: Dashed lines link attributes of a relationship set to the relationship set.
- The Rectangles divided into two parts represents a) Entity set b) Relationship set c) Attributes of a relationship set d) Primary key View Answer
Answer: d Explanation: Diamond represents a relationship set and rectangle represents a entity set.
- An entity set that does not have sufficient attributes to form a primary key is termed a __________ a) Strong entity set b) Variant set c) Weak entity set d) Variable set View Answer Answer: c Explanation: An entity set that has a primary key is termed a strong entity set.
- For a weak entity set to be meaningful, it must be associated with another entity set, called the a) Identifying set b) Owner set c) Neighbour set d) Strong entity set View Answer Answer: a
Explanation: Every weak entity must be associated with an identifying entity; that is, the weak entity set is said to be existence dependent on the identifying entity set. The identifying entity set is said to own the weak entity set that it identifies.It is also called as owner entity set. advertisement
- Weak entity set is represented as a) Underline b) Double line c) Double diamond d) Double rectangle View Answer Answer: c Explanation: An entity set that has a primary key is termed a strong entity set.
- If you were collecting and storing information about your music collection, an album would be considered a(n) _____ a) Relation b) Entity c) Instance d) Attribute View Answer
b) Relational c) Structural d) Compiler View Answer Answer: a Explanation: Query language is a method through which the database entries can be accessed.
- Student(ID, name, dept name, tot_cred) In this query which attribute form the primary key? a) Name b) Dept c) Tot_cred d) ID View Answer
- Which one of the following is a procedural language? a) Domain relational calculus b) Tuple relational calculus c) Relational algebra d) Query language View Answer
Answer: c Explanation: Domain and Tuple relational calculus are non-procedural language.Query language is a method through which the database entries can be accessed.
- The_____ operation allows the combining of two relations by merging pairs of tuples, one from each relation, into a single tuple. a) Select b) Join c) Union d) Intersection View Answer Answer: b Explanation: Join finds the common tuple in the relations and combines it.
- The result which operation contains all pairs of tuples from the two relations, regardless of whether their attribute values match. a) Join b) Cartesian product c) Intersection d) Set difference View Answer Answer: b
Explanation: Select is used to view the tuples of the relation with or without some constraints. advertisement
- The _______ operator takes the results of two queries and returns only rows that appear in both result sets. a) Union b) Intersect c) Difference d) Projection View Answer Answer: b Explanation: The union operator gives the result which is the union of two queries and difference is the one where query which is not a part of second query.
- A ________ is a pictorial depiction of the schema of a database that shows the relations in the database, their attributes, and primary keys and foreign keys. a) Schema diagram b) Relational algebra c) Database diagram d) Schema flow View Answer
Answer: a Explanation: None.
- The _________ provides a set of operations that take one or more relations as input and return a relation as an output. a) Schematic representation b) Relational algebra c) Scheme diagram d) Relation flow View Answer Answer: b Explanation: None. Database Questions and Answers – SQL Basics and SQL Data Definition This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “SQL Basics and SQL Data Definition”.
- Which one of the following is used to define the structure of the relation, deleting relations and relating schemas? a) DML(Data Manipulation Langauge) b) DDL(Data Definition Langauge) c) Query