Data and Database Flashcards

1
Q

Data

A

is a collection of facts, statistics, or information that can be represented and stored in various formats

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

Database

A

is a structured and organized storage system for data. It is designed to efficiently store, manage, retrieve, and manipulate data

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

Data Independence

A

→ Data independence is the characteristic in which we are able to modify the schema at one level of database system without altering the schema at the next higher level.
→ Data independence is a concept in database management systems (DBMS) that refers to the separation of the logical structure of the database from its physical storage details.
→ This separation allows for greater flexibility, maintainability, and scalability of a database system.

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

Physical Data Independence

A

→ Physical data independence allows you to make changes to the physical storage and access methods of the database without affecting the logical schema.
→ This means you can change how data is stored on disk, reorganize files, or choose different indexing techniques without impacting the way users or applications interact with the data.
→ Applications and users remain unaware of changes made to the underlying physical storage, ensuring that they can continue to interact with the data without disruptions.
→ This type of independence is particularly useful for database administrators and system architects who need to optimize database performance, security, or storage management.

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

Logical Data Independence

A

→ Logical data independence allows you to make changes to the logical schema of the database without affecting the external schema or the applications that use the database.
→ This means you can modify the structure of the database, such as adding or removing tables, changing data types, or modifying relationships between tables, without requiring changes in the application code.
→ Ensures that the external schema, which defines how data is presented to users and applications (through views, queries, and interfaces), remains unchanged when modifications are made to the internal schema (the way data is stored).
→ This type of independence helps in maintaining data consistency and facilitating application development and evolution.

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

Advantages of data independence

A

→ Data security and privacy
→ Easier maintenance
→ Scalability: As the database grows, data independence facilitates the addition of new data elements or tables without affecting existing queries or applications.
→ Flexibility: allows for changes to be made in the database schema (structure) without affecting the way data is accessed or presented to users.

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

main purpose of data abstraction

A

to achieve data independence

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

Levels of abstraction

A
  1. Physical level (Internal level):
    • The internal level, also known as the physical level, is the level of abstraction that defines how the data is physically stored and organized in the database.
    • It includes the details of how the data is stored on disk, the access methods used to retrieve the data, and the algorithms used to perform operations on the data.
    1. Logical level (Conceptual level):
      * The conceptual level, also known as the logical level, is the level of abstraction that defines the overall structure of the database.
      * It defines the relationships between the data elements, the constraints on the data, and the operations that can be performed on the data.
    2. View level (External level):
      * The external level, also known as the View level, is the level of abstraction that is closest to the end users.
      * It defines how the data is viewed by the users or applications that access the database.
      It provides a high-level view of the database that is tailored to the specific needs of each user or application. (highest level of abstraction)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Schema

A

A database schema defines how data is organized within a relational database.

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

Types of Schema

A
  1. Internal Schema (Physical Schema):
    • The physical schema describes how data is stored on the underlying hardware, including details such as file organization, storage allocation, and indexing methods.
    • It focuses on optimizing database performance and storage efficiency.
    • It is concerned with the physical implementation of tables, indexes, and other database objects.
  2. Conceptual Schema) Logical Schema:
    • The logical schema defines the logical structure of the database, including the tables, relationships, and constraints, without specifying how data is physically stored.
    • It is independent of the underlying hardware and storage details.
    • It serves as a high-level abstraction that helps users and application developers understand the database’s structure and relationships.
  3. External Schema (User Schema):
    • An external schema defines the view of the database as seen by the end users or applications. It presents a specific subset of the data and functionality to different user groups.
    • External schemas are often tailored to meet the needs of specific user roles or applications.
    • They provide a level of data abstraction and security by controlling what data and operations are accessible to different user groups.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Relational Data Model

A

→ The relational model represents how data is stored in Relational Databases.
→ A relational database consists of a collection of tables, each of which is assigned a unique name.

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

Relation Model Concepts

A

▪ Attribute: An attribute is a characteristic or property of an entity that is stored in a database. It corresponds to a column in a table and defines the type of data that can be stored in that column (e.g., name, age, address).
▪ Tables: Tables are two-dimensional structures in a relational database that organize data into rows (tuples) and columns (attributes). Tables are also referred to as relations in the relational model.
▪ Tuple: A tuple is a single data record or row in a table (relation). It contains values for each attribute, representing a specific instance of data.
▪ Relation Schema: The relation schema defines the logical blueprint of a relation or table. It specifies the names and data types of the attributes, as well as any constraints or rules that apply to the data in the table.
▪ Degree: The degree of a relation is the total number of attributes (columns) present in that relation. It indicates the “width” of the table.
▪ Cardinality: Cardinality refers to the number of tuples (rows) in a relation or table. It indicates the “height” of the table.
▪ Column: A column is a vertical component of a table that represents a single attribute. It contains values for that attribute for each tuple in the table.
▪ Relation Instance: A relation instance is a specific set of data contained within a table at a given point in time. It represents the actual data in the table, which consists of tuples.
▪ Relation Key: A relation key is one or more attributes (columns) in a table that uniquely identify each tuple in the table. Common types of keys include primary keys and candidate keys.
▪ Attribute Domain: The attribute domain specifies the set of all possible values that an attribute can take. It defines the data type, range, and constraints for the attribute.

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

Relational Integrity Constraints

A

Domain, Key, and Referential Integrity Constraints

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

Domain Constraint

A

§ Domain constraints define the permissible values for attributes (columns) within a table. These constraints specify the data type and range of valid values for each attribute.
§ Domain constraints ensure that data entered into a column adheres to specific data types (e.g., integers, strings) and meets any predefined limitations (e.g., a specific range of values, character length).

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

Key Constraint

A

Key constraints are used to enforce uniqueness within a table. A key constraint designates one or more attributes (columns) as keys, which guarantee that the values in those columns are unique for each row (tuple) in the table.

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

Referential Integrity Constraints

A

§ Referential integrity constraints work on the concept of Foreign Keys. A foreign key is a key attribute of a relation that can be referred in other relation.
§ Referential integrity constraint states that if a relation refers to a key attribute of a different or same relation, then that key element must exist.

16
Q

Operations in Relational Model

A

→ Insert is used to insert data into the relation
→ Delete is used to delete tuples from the table.
→ Modify allows you to change the values of some attributes in existing tuples.
→ Select allows you to choose a specific range of data.

17
Q

Advantages of Relational Database Model

A

→ Structural Independence: changes to the physical organization of data (e.g., storage methods, indexing) do not affect the logical representation of data
→ Simplicity: easy to understand and work with.
→ Easier than the Hierarchical Model
→ Data Independence: allowing changes to be made at one level (e.g., logical schema) without affecting other levels.
→ Scalability: Relational databases can be scaled both vertically (adding more resources to a single server) and horizontally (distributing data across multiple servers). This scalability allows them to accommodate growing data volumes and workloads.
→ Query capability: It makes possible for a high-level query language like SQL to avoid complex database navigation.
→ Data Integrity: Relational databases enforce data integrity through the use of key constraints, domain constraints, and referential integrity constraints. This ensures that data stored in the database is accurate and consistent.

18
Q

Disadvantages of using Relational model:

A

→ Normalization:
→ Data Complexity:
→ Doesn’t support all data types
→ Index on homogeneous data

19
Q

Data consistency

A

→ Data Consistency in DBMS is defined by a set of rules that ensure that all data points in the database system are correctly read and accepted.
→ For a database to be consistent, data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, or any combination.

20
Q

Data Abstraction

A

Data Abstraction can be defined as extracting the necessary data by ignoring the remaining irrelevant details.