1 / 17

Introduction to Database

Introduction to Database. ISYS 263. File Concepts. File consists of a group of records. Each record contains a group of fields. Key field, grouping field, calculated field Example: Student file SID Sname Major Sex GPA S1 Peter CIS M 3.0 S3 Paul ACCT M 2.7 S5 Mary CIS F 3.2.

radams
Download Presentation

Introduction to Database

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Database ISYS 263

  2. File Concepts • File consists of a group of records. Each record contains a group of fields. • Key field, grouping field, calculated field • Example: Student file • SID Sname Major Sex GPA • S1 Peter CIS M 3.0 • S3 Paul ACCT M 2.7 • S5 Mary CIS F 3.2

  3. Various Types of File • Database file • Created and managed by a DBMS • Spreadsheet file • Created and managed by a spreadsheet software • XML file • Extensible Markup Language • Comma-Delimited file – A text file that can be processed by any programming languages, DBMS and spreadsheet. • "s5","peter",3.5 • "s1","paul",3 • "s7","mary",2 • Comma-Delimited file demo: stdata.txt • Access –External Data/Text File • Excel – Data/Get External Data/From Text

  4. XML: Data with the Meaning of Data (User-Defined Tags) <?xml version="1.0" ?> <Books> <Book> <ISBN>1-34567-04-01</ISBN> <Authors> <AuthorName>John Smith</AuthorName> <AuthorName>Peter Chen</AuthorName> <AuthorName>David Chao</AuthorName> </Authors> <Price> $45.00</Price> <Description>This is a grerat book</Description> </Book> <Book> <ISBN>1-34567-04-02</ISBN> <Authors> <AuthorName>Adam Smith</AuthorName> </Authors> <Price> $25.00</Price> <Description>This is a second great book</Description> </Book> </Books>

  5. Database Concepts • A database is a collection of related files. • Support business operations • Provide information • A database management system is a software that enables users to create and maintain a database.

  6. Relational Database • Data is logically structured within relations. • Each relation is a table (file) with named columns (attributes, fields) and rows (records). • Example of relational database systems: • MS Access, MS SQL Server • Oracle, MySQL • IBM DB2 • Sysbase, Informix, etc.

  7. Major Functions of Database Management • Creating a database • Analysis: Entity-Relationship Diagram • Design: Design file structure • Implementation • Accessing a database • Updating a database

  8. Introduction to MS Access

  9. Creating a New Database • MS Office button/New • Blank database • New database name and location

  10. Access Objects • Tables • Create a new table: Create/Table Design • Open a table: • Double click the table name • Home/View: • Datasheet view • Design view • Queries • Create a new query: Create/Query Design • Others: Forms, Reports, Pages

  11. Creating a Table • Create/Table Design: • Field name • Field data type • Create table by using table templates • Create/Table Templates/select template • Create a primary key • Never let Access to create a primary key for you. • Enter data

  12. Example: Create an Employee Table • Database name: HRdatabase • Table name: Employee • Table fields: • EmpID: Text, 10 characters • EmpName: Text, 30 characters • Sex: Text, 1 character • HireDate: DateTime field • Salary: Currency field

  13. Create a new Query • Create/Query design/Show table • Select fields • Add criteria • Sorting • Total and subtotal • Query design tools/Total • A Total row is added to the design view • Select function from the total row’s dropdown list

  14. Creating a New Form • Using Form Wizard • Create/Form • Create/More Forms/Form Wizard

  15. Database design objectives • Eliminate data duplication. • Problems with duplication: • Inconsistent data • double entry • waste space • Link related records in related tables. • Example: • StudentTable: SID, Sname, Address, Major, • StudentAccountTable: SID, Sname, Address, Balance

  16. Database Design Example • Example: • Employee Table: EmpID, EmpName, Sex, HireDate,Salary • Department Table: DeptID, DepName, DeptPhone • Assumption an employee works for one department and a department has many employees, • 1. how to link an employee record to the department record the employee works for? • 2. how to link a department record to all its employees? • Note: A table’s key field plays an important role in linking related records.

  17. MS Word’s Mail Merge with Data from a Query • Mailings/Start Mail Merge/Step by Step Mail Merge Wizard • Step 1: Select document type – letter • Step 2: Select starting document – Use current document • Step 3: Select recipients – From database/browse • Step 4: Write your letter – • Address book, greeting line, More item • Step 5: Preview your letters • Step 6: Complete the merge

More Related