DATABASES Flashcards
Data management challenges:
Large amount of data • Different types of users with different access rights • Concurrent access to data • Potential failures during execution
What is the function of a DBMS?
A DBMS supports a user in the management of large amounts of
structured data.
How does a DBMS manage data?
- Query optimization
- Concurrent accessmanagement
- Transaction handling
- Check consistency of data
- Access control
History od databases
1960: Navigational DBMS 1970: Relational Databases by Edgar F. Codd 1970: SQL by Donald D. Chamberlin and Raymond F. Boyce 1990: Object Oriented Databases 2000: NoSQL
Define Relational Databases and it’s characteristics
Organizes data into tables (relations) • Typed columns • Rows are identified by unique keys called primary keys • Rows of other cells can be referenced through foreign keys
SQL enables you to :
Create a Database Drop Database Create a Table Drop a Table Alter a Table
Characteristic of SQL made tables
Columns have a datatype
Columns can have constraints
What is are the data types in SQL
Integers: INTEGER (or INT), SMALLINT Decimals: DECIMAL, FLOAT Strings: CHAR, VARCHAR, TEXT, BLOB Dates/times: DATE, DATETIME, TIMESTAMP
SQL Constraints
NOT NULL UNIQUE DEFAULT PRIMARY KEY AUTO INCREMENT FOREIGN KEY Events Referential actions
Events can be:
On Update
On Delete
Referential actions:
CASCADE
• RESTRICT/NO ACTION
• SET NULL
• SET DEFAULT
Data Manipulation can be through:
Insert Select Update Delete Filter (for Select, Update, and Delete) Grouping
Characteristics of the filter data manipulation:
Equal, Less, … • Between • In • Like Filters can also contain nested select statements!
What are the Characteristics of the grouping data manipulation?
It can be done through :
Aggregate Functions
Filtering
Examples of aggregate functions
COUNT • MAX • MIN • SUM • AVG