IT Applications Theory Slideshows By Mark Kelly Vceit.com Last modified : 6 Dec 2013 Databases II: Structure, naming, data types, data formats.

Slides:



Advertisements
Similar presentations
Organisation Of Data (1) Database Theory
Advertisements

1 Chapter 1 & 2 Relational Databases and Queries CS101 WVU.
UNIVERSITY OF PALESTINE business computer application College of Business Instructor: Mr. Ahmed Abumosameh.
VCE IT Theory Slideshows By Mark Kelly Vceit.com Naming Conventions for solution elements.
Video Rental Store M.S. Access Module CAS 133 Basic Computer Skills/MS Office Russ Erdman.
Database A collection of related information stored on a computer and organized in a manner that allows access, retrieval, and use of that data.
Lecture Access – Tables. What are Tables? Records Fields.
IT Applications Theory Slideshows By Mark Kelly vceit.com Database Design Tools Version 2.
Database Software Application
Unit 18: Database Modelling
BIS121 IT for Business Application Lecture 8 – Database (Part I)
Databases C HAPTER Chapter 10: Databases2 Databases and Structured Fields  A database is a collection of information –Typically stored as computer.
Access 2007 Database Application Managing Business Information Effectively BCIS 1 and 2.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Microsoft Access Intro Class 2 Designing Databases and Tables.
Access Tutorial 2 Building a Database and Defining Table Relationships
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
DATABASE DESIGN USING MICROSOFT ACCESS. What is a Database?  DMS Database management system  Database Collection of data organized in a manner that.
VCE IT Theory Slideshows By Mark Kelly vceit.com Data Types 1 a.
Designing a Database (Part I) -Identify all fields needed to produce the required information -Group related fields into tables -Determine Each Table’s.
Microsoft Access – Tutorial 2 Designing Databases In this tutorial, we will create a new database create a new table import tables from an existing database.
Relational Databases (MS Access)
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
® Microsoft Access 2010 Tutorial 2 Building a Database and Defining Table Relationships.
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
Chapter 17 Creating a Database.
CIS 250 Advanced Computer Applications Introduction to Access.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Presented By: Gail Rose-Innes Camps Bay High School ICT & CAT Department Microsoft Access 2010.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms – Project 5.
Database Management Systems.  Database management system (DBMS)  Store large collections of data  Organize the data  Becomes a data storage system.
MS Access. Access is a DBMS/RDMS DBMS = Database Management System RDMS = Relational Database Management System.
1 U3O2: Structure & Role of Relational Databases Flat File Vs Relational Database Refer to the software as “database management system (DBMS)” –E.g. Access,
Database collection of related information stored in an organized form Database program software tool for storage & retrieval of that information.
Microsoft ® Office Access 2003 Training Get to know Access CGI presents:
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
A Skills Approach Access 2010 Working with Tables © 2012 The McGraw-Hill Companies, Inc. All rights reserved Chapter 2.
Relational Databases. Relational database  data stored in tables  must put data into the correct tables  define relationship between tables  primary.
Microsoft Access.  What is Data ?  Data vs. Information  Database History.  What is a Database?  Examples for Small and Large Databases.  Types.
Databases and Speadsheets
IT Applications Theory Slideshows Databases II: Structure, Naming, data types, data formats.
Access Lessons 1, 2 and 3 ©2009 M and K Solutions, LLC – All Rights Reserved.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
Mr C Johnston ICT Teacher
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Chapter 10: Working with Large Data Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
VCE IT Theory Slideshows By Mark Kelly vceit.com Version 2 – updated for 2016 Data Types 1 a.
Microsoft Access Prepared by the Academic Faculty Members of IT.
Databases Flat Files & Relational Databases. Learning Objectives Describe flat files and databases. Explain the advantages that using a relational database.
MICROSFTACCESS tables. DATA TYPES Field TypeWhat It Holds Short Text Text up to 255 characters long (including spaces and punctuation). Use a Text field,
N5 Databases Notes Information Systems Design & Development: Structures and links.
VCE IT Theory Slideshows
VCE IT Theory Slideshows
U3O2: Structure & Role of Relational Databases
Databases Chapter 9 Asfia Rahman.
VCE IT Theory Slideshows – ITI Updated for 2016
IT Applications Theory Slideshows
REDCap Data Migration from CSV file
Database Normalisation VCE IT Theory Slideshows - Informatics
VCE IT Theory Slideshows by Mark Kelly study design
Flat Files & Relational Databases
Spreadsheets, Modelling & Databases
ICT Database Lesson 2 Designing a Database.
Lecture 2 Lecturer: awdang aziz MS access
Data Dictionaries Begin.
Presentation transcript:

IT Applications Theory Slideshows By Mark Kelly Vceit.com Last modified : 6 Dec 2013 Databases II: Structure, naming, data types, data formats

OVERVIEW capabilities and limitations of DBMS structure of databases naming conventions flat file and relational databases; data types and data formats; Need to include... ITA U3O2-07 naming conventions to support efficient use of an RDBMS ITA U3O2-08 Data types, including text (string), number, date/time, Boolean (true/false) ITA U3O2-09 Data formats used for display, including fixed decimal places, various date formats, 12 hour/24 hour time, true/false, yes/no

Terms to know Table Fields Records Field types – including Boolean Validation – range, type, existence, existence in limited list

Terms to know Limited list, value list Access hierarchy Scripting, macros Calculated/computed fields Hungarian fieldname notation – E.g. G_Total (global field), frmWages (form)

Concepts to know Normalisation Design tools – Entity Relationship Diagram – Data Dictionary – Data structure diagram/chart

Terms to Know Key field, primary key, match field Foreign key Relational Flat-file Relationships – 1:1 – 1:many – many:many

Terms to Know Examiners should not use “MS Access” terminology in exam questions – but play it safe. Know these… Form (input) layout Query find Report (output) layout

Structure of databases Databases need at least one table of data (relational databases need at least two tables) Each table consists of fields (columns) e.g. surname, postcode, pay rate Each field needs to be defined before data is entered Each field has a type, e.g. Text, number, Boolean.

Structure of databases A table’s row containing a full set of fields about a person or item is a record (e.g. Fred’s surname, postcode, pay rate) Related tables are linked by relationships to allow lookups of data from other tables. E.g. using a customer ID entered in the sales table can extract their name, address, payment history etc from the customer table.

Relationships can be complicated

Naming conventions Use a consistent style when naming fields, tables etc. Avoids confusion – E.g. global fields (one value per table instead of one value per record) can cause incorrect results if treated as an ordinary field. – If named g_FieldName, its nature is obvious

Naming conventions Hungarian Notation: field names, variables etc are preceded by a type descriptor. E.g. – tblStaff = table of staff – numAbsences = numeric field – qryUnderPaid = stored query – rptLetters = stored report – frmNewCustomer = input form

Naming Conventions Do not use spaces in fieldnames! – Use Under_scores or – CamelCase – Using capitals to start words (e.g. AccountNumber) Make fieldnames self-descriptive, not obscure (e.g. CAN = customer account number) – Prevents errors by referring to the wrong field!

Flat file and relational databases Flat file databases have one table (like an Excel worksheet) Relational databases have 2 or more related tables (like an Excel VLOOKUP) VLOOKUP actually defines a relationship between the key value Calculated Age and a matching value in the Age lookup table.

Why relational? Reduces data redundancy (unnecessary repetition) Normalisation = dividing a flat file database into related tables

Before normalisation: flat file After normalisation: relational Department data is only stored once. So: Less storage required Department changes now only made once, not once for each worker in the dept!

To find a worker’s extension: - get their department from the STAFF table - use the relationship between the tables to find the same department in the DEPARTMENTS table - Read across to the field you want to fetch

The department field in the staff table is a key field Used to look up matching data in the other table. In the related table (DEPARTMENTS), the matching key field must be unique. If there were 2 departments, the results of a lookup would be unreliable at best.

Primary & Foreign Keys A field is a primary key when it appears in the table where it is defined. A key field appearing in a table other than the one that defines it is called a foreign key. An example is easier to understand…

Remember the last example? STAFF_TABLE Name Department DEPARTMENTS _TABLE Department Boss Extension The Department field is defined in the departments table, so in that table it is a primary key. The same field appears in the staff table, but it is not defined there – it’s just referred to there. So in the staff table, Department is a foreign key.

Data types and data formats Data types specify the type of data that can be stored in a field. Typically: Text (anything that can be typed) Number (some DBMS offer a range of number types such as byte, integer, floating point etc) Date/Time (allows time and date calculations) Boolean (yes/no, true/false) Container (In Filemaker, can hold any type of data e.g. photos, music, entire documents

Calculated fields (Filemaker) Data is not typed in. DBMS calculates the field’s contents using a formula (which is very like an Excel formula). E.g. – Field 1 (number): Amount_Due – Field 2 (number): Amount_Paid – Field 3 (calculated): – Amount_Owing = Amount_Due - Amount_Paid

Calculated fields (Access) A new field defined in a query with a formula calculates new information based on existing data.

Calculated fields Contents are recalculated whenever the data used by the formula changes (like in Excel) Some Filemaker formulae using functions and logical structures like IF and CASE: Let ( ys = u_KidYear & SEM; Case ( ys="71" ; 4.25 ; ys="72" ; 4.5 ; ys="81" ; 4.75 ; ys="82" ; 5 ; ys="91" ; 5.25 ; ys="92" ; 5.5 ; ys="101" ; 5.75 ; ys="102" ; 6 ; "N/A”)) Let ( ys = u_KidYear & SEM; Case ( ys="71" ; 4.25 ; ys="72" ; 4.5 ; ys="81" ; 4.75 ; ys="82" ; 5 ; ys="91" ; 5.25 ; ys="92" ; 5.5 ; ys="101" ; 5.75 ; ys="102" ; 6 ; "N/A”)) (u_hint_valuesVCE) * (subs::weights/100) If ( subs::year=0; If(u_KidYear<11; u_hint710; u_hintVCE); If(u_SubIsVCE?; u_hintVCE;u_hint710) ) If ( subs::year=0; If(u_KidYear<11; u_hint710; u_hintVCE); If(u_SubIsVCE?; u_hintVCE;u_hint710) ) GetAsNumber(HG)

Calculated fields Note the :: which means “the related field called weights in the subs table” In the previous employee example, the department boss’ name could be fetched with a reference to departments::boss (u_hint_valuesVCE) * (subs::weights/100)

Tips Never save people’s names in a single field – Can’t search or sort by either name Store phone numbers as text, not number – Can’t use spaces, (parentheses), leading zero, dash, PABX codes Store suburbs & postcodes in fields separate to the address – Allows sorting/searching by those fields Choose the most efficient field type – E.g. integer, not floating point, if fractions are not needed

Data formats Not to be confused with data types, which describe the contents of a field Data formats specify how data is displayed – E.g. date format: 10 June 2009 or 10/06/2009 – The number of decimal places to show – Use checkboxes, radio buttons, dropdown menus, pop-up lists or text boxes? Formatting a field in Filemaker…

By Mark Kelly vceit.com These slideshows may be freely used, modified or distributed by teachers and students anywhere on the planet (but not elsewhere). They may NOT be sold. They must NOT be redistributed if you modify them. IT APPLICATIONS SLIDESHOWS