Presentation is loading. Please wait.

Presentation is loading. Please wait.

14. Databases. DATABASEMANAGEMENTSYSTEMDATABASEMANAGEMENTSYSTEM 14.1.

Similar presentations


Presentation on theme: "14. Databases. DATABASEMANAGEMENTSYSTEMDATABASEMANAGEMENTSYSTEM 14.1."— Presentation transcript:

1 14. Databases

2 DATABASEMANAGEMENTSYSTEMDATABASEMANAGEMENTSYSTEM 14.1

3 D BMS components  A database is a collection of data that is logically, but not necessarily physically, coherent.  A database management system (DBMS) defines, creates, and maintains a database and allows controlled access to users.

4 ARCHITECTUREARCHITECTURE 14.2

5 D atabase architecture

6  DBMS users can be humans or application programs.  A DBMS has three levels: internal, conceptual, and external.  The internal level of a DBMS interacts directly with the hardware and is concerned with low-level access methods and byte transfer to and from the storage device.  The conceptual level of a DBMS defines the logical view of the data as well as the data model and schema diagrams.  The external level of a DBMS interacts directly with the user.

7 DATABASEMODELSDATABASEMODELS 14.3

8 D atabase models  A database model defines the logical design of data  The model also describes the relationships between different parts of data.  Three models:  Hierarchical model  Network model  Relational model

9 H ierarchical model  Data are organized as an upside down tree  Each entity has only one parent but can have several children.

10 N etwork model  The entities are organized in a graph, where some entities can be accessed through several path.

11 RELATIONALMODELRELATIONALMODEL 14.4

12 R elational model  Data are organized in two-dimensional tables called relations.  The relational database management system (RDBMS) is the only database model in wide use today. The hierarchical and network models are obsolete.  Each column in a relation is called an attribute. The number of attributes in a relation is its degree.  Each row in a relation is called a tuple. The number of rows in a relation is its cardinality.

13 R elational model

14 R elation

15 OPERATIONSONRELATIONSOPERATIONSONRELATIONS 14.5

16 I nsert operation  None operations can be performed on relations.  An operation that operates on one relation is a unary operator. Unary operators include the insert, delete, update, select, and project operations.

17 D elete operation

18 U pdate operation

19 S elect operation

20 P roject operation

21 J oin operation  An operation that operates on two relation is a binary operator. binary operators include the join, union, intersection, and difference operations.

22 U nion operation

23 I ntersection operation

24 D ifference operation

25 STRUCTUREDQUERYLANGUAGESTRUCTUREDQUERYLANGUAGE 14.6

26 S QL  The Structured Query Language (SQL) is the language standardized by ANSI and ISO for use on relational databases.  For example: Fig 14.10Fig 14.10 select* 整個 tuple 都抓出來 fromCOURSES whereUnit = 5

27 S QL - S QL - cont ’ s For example: selectCourse- Name fromCOURSES whereUnit = 5


Download ppt "14. Databases. DATABASEMANAGEMENTSYSTEMDATABASEMANAGEMENTSYSTEM 14.1."

Similar presentations


Ads by Google