15-11-2012, 01:32 PM
Database management concepts
dbms.pptx (Size: 323.23 KB / Downloads: 186)
Database Management Systems (DBMS)
An example of a database (relational)
Database schema (e.g. relational)
Data independence
Architecture of a DBMS
Types of DBMS
Basic DBMS types
Retrieving and manipulating data: query processing
Database views
Data integrity
Client-Server architectures
Knowledge Bases and KBS (and area of AI)
Basic DBMS types
Linear files
Sequence of records with a fixed format usually stored on a single file
Limitation: single file
Example query: Salesperson='Mary' AND Price>100
Hierarchical structure
Trees of records: one-to-many relationships
Limitations:
Requires duplicating records (e.g. many-to-many relationship)
Problems when updated
Retrieval requires knowing the structure (limited data independence):
traversing the tree from top to bottom using a procedural language
Network structure: similar to the hierarchical database with the implementation
of many-to-many relationships
Relational structure
Object-Oriented structure
Objects (collection of data items and procedures) and interactions between them.
Is this really a new paradigm, or a special case of network structure?
Separate implementation vs. implementation on top of a RDBMS
Relational structure
Relations, attributes, tuples
Primary key (unique combination of attributes for each tuple)
Foreign keys: relationships between tuples (many-to-many).
Example: SUPPLIES defines relations between ITEM and SUPPLIER tuples.
Advantages: many-to-many relationships, high level declarative query language (e.g. SQL)
SQL example (retrieve all items supplied by a supplier located in Troy):
SELECT ItemName
FROM ITEM, SUPPLIES, SUPPLIER
WHERE SUPPLIER.City = "Troy" AND
SUPPLIER.Supplier = SUPPLIES.Supplier AND
SUPPLIES.Item = ITEM.Item#
Programming language interfaces: including SQL queries in the code
Retrieving and manipulating data: query processing
Parsing and validating a query: data dictionary - a relation listing all relations and
relations listing the attributes
Plans for computing the query: list of possible way to execute the query,
estimated cost for each. Example:
SELECT ItemNames, Price
FROM ITEM, SALES
WHERE SALES.Item# = ITEM.Item# AND Salesperson="Mary"
Index: B-tree index, drawbacks - additional space, updating;
indexing not all relations (e.g. the keys only)
Estimating the cost for computing a query: size of the relation, existence/size of the indices.
Example: estimating Attribute=value with a given number of tuples and the size of the index.
Query optimization: finding the best plan (minimizing the computational cost and
the size of the intermediate results), subsets of tuples, projection and join.
Static and dynamic optimization