DATABASE
DATABASE 1
Databse introduction Database creation and maintenance Database query
• Databse introduction • Database creation and maintenance • Database query
User INTRODUCTION TO DATABASE Application software o Typical cases 。Bank DBMS 。Supermarket ·Medical records Operating system Database VB Database VC++ engine SQL DBMS PowerBuilder Applicatio Database n software Delphi ORACLE ACCESS FOXPRO SOL SERVER
Typical cases Bank Supermarket Medical records INTRODUCTION TO DATABASE 3 Applicatio n software DBMS VB VC++ PowerBuilder Delphi ACCESS SQL SERVER ORACLE FOXPRO SQL Database engine Database User Application software DBMS Operating system Database
BASIC CONCEPTS 1.Database(DB) A database is a structured collection of data 2.Database Management System(DBMS) A set of programs that enables you to store,modify,and extract information from a database,it also provides users with tools to add,delete,access,modify,and analyze data stored in one location ·Microsoft Acess Oracle;SQLServer;MySQL;(network) 3.Database Application software Software developed by some tools(e.g.Visual C++)for database applications in certain environment
BASIC CONCEPTS 4 1. Database (DB) • A database is a structured collection of data 2. Database Management System (DBMS) • A set of programs that enables you to store, modify, and extract information from a database, it also provides users with tools to add, delete, access, modify, and analyze data stored in one location • Microsoft Acess • Oracle; SQLServer; MySQL ; (network) 3. Database Application software • Software developed by some tools (e.g. Visual C++) for database applications in certain environment
DATABASE HISTORY >3 phases for data management ·Managed manually ·Managed with files Managed with database 5
DATABASE HISTORY ➢ 3 phases for data management Managed manually Managed with files Managed with database 5
PHASE 1 o Data and codes are saved together o Data are not shared Programl Data 1 Program 2 Data 2 Program n Data n
PHASE 1 Data and codes are saved together Data are not shared 6 Program1 Data1 Program2 Data2 Program n Data n … …
Example Two C programs for finding the sum and maximum of 10 numbers *程序1:求10个数之和* *程序2:求10个数中的最大值* nclude main() main() int is=0; int is, inta[10={66,55,75,42,86,77,96,89,78,56 imta[10={66,55,75,42,86,77,96,89,78,56}; for(i=0i<10++) s=a则; s=s+a; fori=1i<10i++) printf%ds), if(s<a间)s=a]; printf%d"s)
Example:Two C programs for finding the sum and maximum of 10 numbers 7
PHASE 2 Codes and data for caluculation are separated Data are independent -Data are shared in terms of data files Program 1 Data file 1 File management Program 2 system Data file 2 Program n Data file n
PHASE 2 8 – Codes and data for caluculation are separated – Data are independent – Data are shared in terms of data files Data file1 … File management system Data file n Program1 Program2 Program n … Data file 2
o Previous example *程序3: *程序4: 文件C:Data.dat 求文件中10个数之和* 求文件中10个数的最大值* nclude<stdio.h≥ nclude <stdio.h≥ ®D.日回☒ main() main() 文件)编辑但) { 格式Q) 查看) int ix,s=0; int ix,s=-32767; FILE米p; FILE fp; 帮助) *打开文件* *打开文件* 66 fp=fopen("c:ata.dat",""), fp=fopen("c:ldata.dat","r"), 55 for(i=0i<10++) for(i=0i<10i++) 75 {*文件中读数据*树 {*文件中读数据* 42 fscanffp,"d fscanfifp,"%d"); 86 s=s+x, if(sx刘s=x; 77 } printf"%d",s), printf"%d",s); 89 fclose(p;*关闭文件* fclose(fp);*关闭文件*/ 56
Previous example 9
PHASE 3 Data are structured -Data are independent Data can be shared via DBMS - Nice user interface Maxium: SELECT Max(Num)FROM Data Average: SELECT Avg(Num)FROM Data 10
PHASE 3 10 – Data are structured – Data are independent – Data can be shared via DBMS – Nice user interface Maxium: SELECT Max(Num) FROM Data Average: SELECT Avg(Num) FROM Data