04 databases Flashcards
(88 cards)
what is a database?
a collection of data organised in a manner that allows access, retrieval and use of that data. It is a set of related data.
what is data?
Data is the raw form of knowledge and doesn’t carry any significance. Simple and useless. Examples:
- facts
- raw & unorganised
- individual & unrelated
- doesn’t depend on information
- graphs, numbers, figures
what is information?
knowledge gained through study, communication etc. It is a result of analysing and interpreting data and relating it together. Examples
- puts facts into context
- organised
- related & makes sense in context
- depends on data
- works, thoughts etc.
what is a primary key
a primary key uniquely identifies each record. For example, a patient ID, that links to a appointment entity.
what is file maintenance
it refers to the procedures that keep data current, this includes things like:
- adding records
- modifying records
- deleting records
what is data dictionary
A data dictionary is a document that defines the basic organisation of a database. It contains a list of all the elements in the database, the number of records in each table and the names and types of each field.
what is a flat file database
A flat-file database is a collection of data where information is stored in a single table/two dimensional database. Data is arranged in rows (records) across columns (fields).
what is a relational database
A relational database has multiple tables that are related together, through keys. It allows for more flexibility and control over database constraints. It is usually created through a process called normalisation.
what is a DBMS (database management system)
DBMS is a specially designed software application that interacts with the user, other applications and the database itself to capture and analyse data. The purpose of a DBMS is to allow the definition, creation, querying, update, and administration of databases. A database file is not generally portable across different DBMSs, but different DBMSs can interoperate by using standards such as SQL and ODBC to allow a single application to work with more than one database.
what is a RDBMS (relational database management system)
A RDBMS allows developers to store and handle data in multiple tables. It is a collection of programs and capabilities that enable IT teams and others to create, update, administer and otherwise interact with a relational database. RDBMS’s store data in the form of tables, with most commercial relational database management systems using Structured Query Language (SQL) to access the database. It provides a dependable method of storing and retrieving large amounts of data while offering a combination of system performance and ease of implementation.
what are 3 features of RDBMS
Data storage
The relational tables are structured for storing and retrieving data. It takes care how the data is organised on the disk, where it is stored and how the data moves when you update it.
Data Management
When we create the data into our database, we can insert data into the database. The data management manages the physical storage of data and works closely with the data storage module. Allows user to do data lookup operations, though SELECT, UPDATE and DELETE statements.
Data Concurrency
Allows the administrator & users to use the same database whilst performing different operations. Multiple users, applications and reports might connect to them. They can read and modify data in the database at the same time.
what are the two types of data consistency
Two or more users making changes at the same time on the same piece of data can cause conflicts and inconsistencies in the database. This is avoided by the use of transactions and locks.
Transactions
Consists of an entire set of changes a user makes, up to when the user presses a button to run a command.
Locks
Users can ‘lock’ a table , row or columns so only 1 user can modify it at one given time.
DBMS vs RDBMS
DBMS
- general term for a database system
- hierarchical, network etc
- doesn’t have relationships
- other languages
- doesn’t have advanced features.
RDBMS
- relational databases
- stores data in rows & columns in tables
- primary and foreign keys
- SQL as standard language
- advanced data management features
what is the role of a RDBMS in handling access to data
Uses complex algorithms that support multiple concurrent user access to the database while maintaining data integrity. Security management is an overlay service that the RDBMS provides for the basic database as it is used in enterprise settings. RDBMS’s support the work of database administrators (DBAs) who manages and monitors database activity. RDBMS’s manage log files that track system performance based on selected operational parameters. This enables measurement of database usage, capacity and performance, particularly query performance. RDBMS’s provide graphical interfaces that help DBAs visualize database activity.
what are the two types of independence of data from RDBMS
Logical data
Refers to immunity of external schemas (external views) to changes in conceptual schema. Conceptual schema changes (e.g. addition/removal of entities).
Should not require changes to external schema or rewrites of application programs.
Physical data
Refers to immunity of conceptual schema (database model) to changes in the internal schema. Internal schema changes e.g., using different file organizations, storage structures. Should not require change to conceptual (external) schemas.
what is an entity
an entity is a table. It is a person, place, object, event or a concept.
what is an attribute with an example about patients details.
It defines an entity. For example, a table of patients. Some attributes of patients are patientID, Name, Section, DoB, Gender etc. Records are stored in rows and are a collection of related attributes.
Entities/relations v tables/files
- An Entity is implemented in the form of a file/table
- An Entity in an ER model can also be referred to as a ‘Relation’ when all fields are atomic and there are no repeating fields (1NF)
- A Database can contain many tables/Files in relation
- Tuples or rows are implemented as records
- Attributes are implemented as fields in your data dictionary
- Relationships remain relationships (1:M, 1:1, M:N) but referential integrity is enforced
what are some entity types
Tangible Entity
The Entity or Object which exists in the physical world. You can physically touch it.
Intangible Entity
The Entity or Object that has a logical definition but does not exist physically.
Entity type
The collection of an object with similar attributes.
Strong Entity Type
Strong entities have a key attribute by which each instance can be identified .
Weak Entity Type
This type of entity doesn’t have a main or unique attribute. Weak entity types require borrowed attributes from other entities for its precise identity.
rules for relational databases
- Each table has a unique name
- Each table contains multiple rows
- Each row in a table is unique
- Every table has a key to uniquely identify rows
- Each column in a table has unique attribute names
what is a composite/compound key
- composed of multiple attributes
- only the combination of attributes uniquely identify as records
- considered weak.
what is a foreign key
It is a field whose value is the same as a primary key of another table.
what is a cardinality
the relationship of a relational database (1:1, 1:M, M:N)
what is a 1:1 relationship
- a student has 1 locker and 1 locker has one student