Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Design Week 12.

Similar presentations


Presentation on theme: "Database Design Week 12."— Presentation transcript:

1 Database Design Week 12

2 myITLab EXAM NEXT WEEK IN CASE OF “TECHNICAL issues:
Be prepared to also do the PRACTICAL exam next week To ENSURE that your laptop is setup properly, please go to: BLACKBOARD > MyITLab resources  > myITLab SETTINGS, and setup your laptop with ALL these settings.   If there are ANY TECHNICAL  issues, go to BLACKBOARD > MyITLab resources  > MyITLab Technical Support

3 Forms

4 Table Vs. Form Table Many records at a time
Some fields do not fit on one screen Column and row formatting only Can be confusing to new users Form 1 record at a time All fields can fit on 1 screen Any formatting options you set-up “User-friendly” and less-intimidating than tables

5 WHAT IS A FORM? • “electronic equivalent” to a paper form • allows you to create a custom layout for your data • more “visually appealing” for “data entry” • when you need to control which data is displayed or entered

6 Why Use Forms? Provide a “User-Oriented” interface to the data
Can focus on only 1 record at a time Can create drop-down boxes & buttons for saving, deleting, printing or navigating etc. Can create SUB-forms which access info from a RELATED TABLE Only asks for specific information Ability to use “non technical” terms Should be designed around individual tasks

7 Fields in a Form -The field LABELS in a form are like the labels on an application. -The field TEXT BOXES are where you supply the data, like the blank lines on an application. -If you need to DELETE a LABEL, you also need to DELETE its ASSOCIATED TEXT BOX

8 FORMS cont. Forms are made up of CONTROLS, such as text boxes, buttons, document tabs, and drop-down lists, grouped in a way that makes them easy to use The controls in the form are usually “bound”, or “linked” to the tables or queries in your database — but not always. For example, a control that displays “Customer data” is probably bound to either the “Customer” table, or to a query that retrieves Customer data. BUT: a form control that displays your corporate logo is NOT bound to a table field; it just points to the image it displays.

9 FORMS: 2 VIDEOS WORKING WITH FORMS CREATING FORMS
Part 2:

10 Watch video on FORMATTING forms: click on: the PLAY button
NOTE: Formatting FORMS is similar as Formatting REPORTS (except for “Design” view, where there are some additional options) NOTE: If you create a “THEME” (DESIGN tab), it applies to the ENTIRE “Database”. If you want to apply it to the FORM, ONLY, go to the FORMAT tab Watch video on FORMATTING forms: click on: the PLAY button

11 REPORTS Ways of generating printed output
Can create reports that show totals & grand totals of a value in a particular field Reports give you the ability to present components of your database in an “easy-to-read”, printable format. Access lets you create reports from both tables and queries. NOTE: As with FORMS, if you create a “THEME” (DESIGN tab), it applies to the ENTIRE “Database”. If you want to apply it to the REPORT, ONLY, go to the FORMAT tab

12 REPORTS: 2 VIDEOS “CREATING REPORTS” FORMATTING REPORTS
click on: the PLAY button FORMATTING REPORTS

13 Entities and Their Attributes
“Entities” represent something of importance “Entities” are made up of several “Attributes” (the columns), which describe the tables: ARTISTS ArtistName Gender SONGS SongTitle Length

14 Review Tables / Entities
Tables (aka Entities) in the relational model are used to represent “things” in the real world. Entities are made up of attributes Attributes (columns/fields) are pieces of data that describe the entity Rows are called records

15 What is a Primary Key? The PRIMARY KEY of a table is the column whose values are different in every row Should be 1st field A field in the database that guarantees UNIQUENESS Speeds “data retrieval” RULE: Each record in a table must have a “PRIMARY KEY”. In MS ACCESS a “Primary Key Field” is represented by a tiny gold key to the left of the Field Name

16 Primary Keys Some entities have “ready-made” primary keys, for example: Catalog codes If an entity lacks a reliably unique field Use a “system-assigned”: “AUTONUMBER”

17 What is a Foreign Key? A field in a table that is the Primary Key of another TABLE. A foreign key is used to indicate a relationship between 2 or more tables. NOT every table has to have a Foreign key Always a “NUMBER” type, linked to an “AUTONUMBER” type in another TABLE Whenever you see: “MANY”—this will be the FOREIGN KEY

18 Three Basic Types of Relationships
CARDINALITY: One to One (1:1) One to Many (1:M) Many to Many (M:M) The 1 is the “PARENT”, and the M is the “CHILD” Called the CARDINALITY of the relationship The cardinality indicates the MAXIMUM number of RELATIONSHIPS between the entities, Whenever you see: “MANY”—this will be the FOREIGN KEY

19 One to One Relationships
1:1 relationships exists when a single record in one table has 1 and only 1 corresponding record in another table, and vice versa VERY RARE When you created a table for something, when it really should only have been a “field” The 1 should really have been an “attribute” of the other (table/entity) an attribute IMPROPERLY DEFINED as an entity i.e. 1 customer, 1 address “Address” should have been the attribute of the “Customer” table EXAMPLE ON NEXT PAGE

20 One to One Example A voter can cast only one vote in an election.
A ballot paper can belong to only one voter. So there will be a 1:1 relationship between a Voter and a Ballot Paper. Voter Ballot

21 One to Many Relationships
MOST COMMON 1:M or M:1 Relationship exists when a record can relate to 1 OR MORE records in a 2nd table but.. A record in the 2nd table can ONLY relate to 1 record in the 1st table Example next page

22 One to Many Example A person can own more than one car. A car can only have one owner. Owner Vehicle

23 Many to Many Example A student can have more than one professor; the same professor can have many students Student Professor

24 Resolving Many to Many Professor Stud_Prof Student M:M is not allowed, as an attribute could have more than 1 value: A “Multi-Valued Attribute” Difficult to generate reports, or do searches Would have to repeat attributes multiple times Instead, we create a “JUNCTION” or “JOINER ENTITY” The name of the joiner entity is often a COMBINATION of the 2 entities

25 Hybrid / Homework View “14 Week Schedule” > Week 12 > 3rd Column


Download ppt "Database Design Week 12."

Similar presentations


Ads by Google