Database Attributes and Operations, Cheat Sheet of Database Programming

Various types of database attributes, including simple, composite, multivalued, and derived attributes. It also discusses database operations such as querying, projecting, selecting, and joining data. Explanations and examples for concepts like primary keys, constraints, and relational algebra. It covers fundamental sql operations like creating, updating, and deleting data, as well as set operations like union, intersection, and difference. The document also touches on topics like views, transactions, and database design principles. Overall, this document serves as a comprehensive introduction to the core concepts and techniques in database management systems.

Typology: Cheat Sheet

2023/2024

Uploaded on 09/23/2023

alemgena-tadele
alemgena-tadele 🇪🇹

1 document

1 / 82

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Database Questions and Answers – The Entity-Relationship Model
This set of Database Multiple Choice Questions & Answers (MCQs) focuses
on “The Entity-Relationship Model”.
1. 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.
2. Entity is a _________
a) Object of relation
b) Present working model
c) Thing in real world
d) Model of relation
View Answer
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52

Partial preview of the text

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”.

  1. 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.
  2. 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.

  1. 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.
  2. 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.

  1. 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.
  2. 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.

  1. 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”.
  2. _____________ 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.

  1. 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).
  2. 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.

  1. 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.
  2. ______ 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.

  1. ____________ 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”.
  2. 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.

  1. 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.
  2. 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.

  1. 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.
  2. 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

  1. 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.
  2. 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.

  1. 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
  2. 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.

  1. 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.
  2. 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

  1. 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.
  2. 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.

  1. 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”.
  2. 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