Databases(Mid term) Flashcards

1
Q

What is a schema in Databases

A

It is a blueprint that defines the structure of the database.
How the table, fields/columns, Relationships, constraints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a database

A

A Database is a structural organization of information and data.
It has five aspects to it Data storing, retrieving, managing, security, sharing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are two aspects of databases.

A

Data storing, retrieving, managing, security, sharing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the downsides to traditional file storing systems.

A

1 | Data redundancy
2 | Data access
3 | Data Management

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name the three levels of Databases abstraction.

A

Physical- Describes how it data is stored
Logical- Explains the relationships between data.
View- Hides certain information from being displayed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the types of Data?

A

Categories:
a) Attribute Data: Characterizes or describes features.
Example: Eye color, type of car.
b) ‘Open’ Data: Free-form text or responses that don’t fit into predefined categories.
Example: Open-ended survey responses.
c) Ordinal Data: Data with a meaningful order but no fixed intervals between values.
Example: Customer satisfaction ratings (e.g., satisfied, neutral, dissatisfied).
d) Nominal Data: Data without an inherent order or ranking
Example: Types of fruits, categories of books.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is structured data? Give two example.

A

Highly organized and easily searchable data is called structured data.
2) Stored in databases (e.g., SQL databases).
3) Examples- Spreadsheets. SQL databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q8] What is the role of a database administrator? List any two responsibilities.

A

Ans) 1) The role of the data administrator is to coordinate all the activities of the database
system
2) The database administrator has a good understanding of the enterprise’s information
resources and needs.
3) Database administrator’s duties include:
a) Schema definition
b) Storage structure and access method definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q9] What is a transaction in a database system?

A

Ans) 1) A transaction is a collection of operations that performs a single logical function in a
database application
2) Transaction-management component ensures that the database remains in a consistent
state despite system failures (e.g., power failures and operating system crashes) and
transaction failures.
3) Concurrency-control manager controls the interaction among the concurrent
transactions, to ensure the consistency of the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q10] What is unstructured data? Give two examples.

A

Ans) 1) Data that is not organized in a pre-defined manner is called unstructured data.
2) Includes text, images, videos, and social media posts.
3) Examples- Emails and Social media content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Q11] What are the advantages of using structured data?

A

Ans) 1) Ease of Analysis: Simple to manipulate, aggregate, and analyze.
2) Supports complex queries and reporting.
3) Data Integrity: Enforces data integrity through constraints and relationships.
Example: Foreign key constraints to maintain referential integrity.
4) Scalability: Efficient storage and retrieval for large datasets.
Example: Indexing for faster search and retrieval.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Q12] Define an ER (Entity-Relationship) diagram. What is its primary use?

A

Ans) 1) Definition: An ER diagram visually represents entities, their attributes, and
relationships in a system.
2) Primary Use: It is used to model and design database structures.
4) Clarification: Helps clarify data requirements and interactions among stakeholders.
5) Guidance: Serves as a blueprint for database implementation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Q13] What is relational algebra? Name any two operations in relational algebra with
examples.

A

Ans) 1) Relational algebra is a procedural query language used in relational databases to
manipulate and retrieve data.
2) It uses a set of operations to perform queries on relations(tables).
.3) Two Operations in Relational Algebra:
a) Selection( ): Retrieve rows that satisfy a given condition
Eg.: ( )(salary>5000). Retrieves all employees with a salary greater than 5000.
b) Projection( ):retrieve specific columns from a relation.
Eg: ( )(name,age). Retrieves only the name and the age column from the employee
table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q14] What is the difference between nominal and ordinal data?

A

Ans) 1) Ordinal Data: Data with a meaningful order but no fixed intervals between values.
Example: Customer satisfaction ratings (e.g., satisfied, neutral, dissatisfied).
2) Nominal Data: Data without an inherent order or ranking
Example: Types of fruits, categories of books.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are different types of attributes in ER diagrams give example of each.

A

Ans) 1) Classes of Attributes
a) Single-valued attribute: A single-valued attribute can have only a single value.
Examples: A person can have only one social security number.
b) Multi-valued attributes: Multivalued attributes can have many values.
Examples: A person may have several college degrees.
Multivalued attributes are shown by a double line connecting to the entity.
c) Simple Attribute: A simple attribute cannot be subdivided.
Examples: Age, Sex, and Marital status
d) Composite attribute: A composite attribute can be further subdivided to
yield additional attributes.
Examples: ADDRESS, Street, City, State, Zip
PHONE NUMBER, Area code, Exchange number
e) Derived Attribute: A derived attribute is not physically stored within the database;
instead, it is derived by using an algorithm.
Example: AGE can be derived from the data of birth and
the current date.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q17] Discuss the different types of relationships in ER diagrams.

A

Ans) In ER diagrams, relationships describe how entities are associated with one another.
Here are the main types of relationships:
1. One-to-One (1:1):
* Description: Each entity in the relationship corresponds to exactly one entity in the other
set.
* Example: Each person has one unique passport, and each passport is assigned to one
person.
2. One-to-Many (1:N):
* Description: One entity in the relationship can be associated with multiple entities in the
other set, but those entities can only relate back to one.
* Example: A teacher can teach multiple courses, but each course is taught by only one
teacher.
3. Many-to-One (N:1):
* Description: Multiple entities in one set can be associated with a single entity in another
set.
* Example: Many students can enrol in one course, but each course has many students

17
Q

Q23] Explain the concept of levels of abstraction in a DBMS with examples

A

Ans) 1. Physical Level
* Definition: Details how data is physically stored.
* Example: Data stored in binary files or B-trees on a hard disk.
2. Logical Level
* Definition: Defines what data is stored and relationships among data.
* Example: Schema for a library system:
o Entities: Books (BookID, Title, AuthorID), Authors (AuthorID, Name)
o Relationship: An author can write multiple books.
3. View Level
* Definition: User-specific view of data, hiding complexities.
* Example:
o Student View: Displays enrolled courses and grades.
o Admin View: Allows adding courses and updating records.