WEEK 8 - INTRODUCTION TO DATABASES Flashcards
1
Q
What is a database?
A
- a collection of data organized to serve many applications simultaneously by storing and managing data so they appear to be in one location
2
Q
purpose of databases?
A
- to efficiently store, manage, and retrieve large volumes of data
- to minimize redundancy and ensure data integrity and consistency
- to facilitate multi-user access and distributed access to data
3
Q
components of databases
A
- tables: organized into rows (records) and columns (fields/attributes)
- fields: characteristics or properties of the data
- records: instances of data entries
4
Q
why do we need databases?
A
- data volume: the amount of business data increases every year, including sales, purchases, salary activities, client enquiries
- business intelligence: databases store transaction data that can be analyzed to produce valuable business intelligence
- efficiency: databases minimize redundancy and enable efficiency data retrieval and management
5
Q
example of data base in toy store
A
- customer data: customer ID, name etc
- sales agent data: agent ID, name etc
- order data: order ID, date etc
- product data: toy ID, name, price etc
6
Q
how do relational databases work?
A
- organize data into tables that are related to each other
- each table represents an entity (eg. customer, sales, product)
- use of keys to establish relationships between tables
7
Q
what is a primary key in relational databases?
A
- a unique identifier for each record in a table
8
Q
what is a foreign key in relational databases?
A
- a field that links one table to a primary key in another table
9
Q
define normalization in relational databases?
A
- process of organizing data to minimize redundancy and improve data integrity
- first normal form (1NF): data stored in tables without repeating groups
- second normal form (2NF): 1NF plus all non-key attributes depend on the entire primary key
- third normal form (3NF): 2NF plus no transitive dependencies
10
Q
example of normalization
A
- customer table: contains customer details
- order table: contains order details, linked to the customer table via a foreign key
- product table: contains product details, linked to the order table via a foreign key
11
Q
function of database management systems (DBMS)
A
- software for creating, storing, organizing and accessing data from a database
- provides tools for data definition, querying and reporting
12
Q
capabilities of database management systems (DBMS)
A
- data definition: specify the structure of the database
- data dictionary: stores definitions of data elements and their characteristics
- querying and reporting: use of SQL for data manipulation and extraction
13
Q
SQL example:
A
- retrieves clients with debts greater than $1000
- SELECT Clientname, Debt FROM Client WHERE Debt > 1000
14
Q
define cloud databases
A
databases hosted on cloud services, offering scalability and flexible pricing
15
Q
define distributed databases
A
- databases stored in multiple physical locations, providing consistency and reliability