Foreign key (FK) is defined as follows:

Slides:



Advertisements
Similar presentations
The Ribbon Standard to all Office 2007 applications Organized by feature and functionality Navigation Pane Access to all objects in the current database.
Advertisements

Validation Checks that the data entered is sensible.
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Exam 2 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
Chapter 3 Relational Model Chapter 4 in Textbook.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
INTEGRITY. Integrity constraint Integrity constraints are specified on a database schema and are expected to hold on every valid database state of the.
Review: Application of Database Systems
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
Analyzing Data For Effective Decision Making Chapter 3.
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
Designing a Database (Part I) -Identify all fields needed to produce the required information -Group related fields into tables -Determine Each Table’s.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
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.
XP Chapter 2 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Building The Database Chapter 2 “It is only the farmer.
1 Chapter 17 Methodology - Local Logical Database Design.
Introduction to Database using Microsoft Access 2013 Part 6.1 November 18, 2014.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
1 11 Exploring Microsoft Office Access 2007 Chapter 6 Data Protection.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
Microsoft Access Prepared by the Academic Faculty Members of IT.
MS Access: Defining Data Entry Rules Instructor: Vicki Weidler Assistant: Joaquin Obieta.
INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014.
MICROSFTACCESS tables. DATA TYPES Field TypeWhat It Holds Short Text Text up to 255 characters long (including spaces and punctuation). Use a Text field,
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
To play, start slide show and click on circle Access 1 Access 2 Access 3 Access 4 Access Access
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints تنبيه.
Comp 1100 Entity-Relationship (ER) Model
Translating ER Schema to Relational Model
CSIS 115 Database Design and Applications for Business
Logical Database Design and the Rational Model
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
Microsoft Office Illustrated Introductory, Windows Vista Edition
Objectives Query for top values Create a parameter query
Entity-Relationship Model
Tables and Their Characteristics
Chapter -3- Data Modeling Using the Entity-Relationship Model
Database Design – Lecture 4
CSIS 115 Database Design and Applications for Business
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Introduction to Database Systems
Lecture # 13 (After 1st Exam)
Building and Using Queries
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Chapter 4+17 The Relational Model Pearson Education © 2014.
Foreign key (FK) is defined as follows:
Entity-Relationship Model
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relation Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Access Lesson 2 Creating a Database
Microsoft Office Access 2003
Review: ACCESS Database Systems
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Answer:  Select queries Parameter queries Cross Tab queries
Review: Application of Database Systems
MS ACCESS.
1.(5) Describe the working process with a database system.
Mapping an ERD to a Relational Database
Microsoft Access Validation Rules, Table Relationships And
Microsoft Office Illustrated Introductory, Windows XP Edition
Chapter (7) ER-to-Relational Mapping, and other Relational Languages
Mapping an ERD to a Relational Database
Presentation transcript:

Foreign key (FK) is defined as follows: 1. What is a foreign key? What conditions must be satisfied for the values of a foreign key?   Foreign key (FK) is defined as follows: i) Consider two relation schemas R1 and R2; ii) The attributes in FK in R1 have the same domain(s) as the primary key attributes PK in R2; the attributes FK are said to reference or refer to the relation R2; iii) A value of FK in a tuple t1 of the current state r(R1) either occurs as a value of PK for some tuple t2 in the current state r(R2) or is null. In the former case, we have t1[FK] = t2[PK], and we say that the tuple t1 references or refers to the tuple t2. Example: FK Order(OrderId, …, CustId) Customer(CustId, … ) May 2018 ACS-3902 Yangjun Chen

2. Specify the following concepts. Cardinality Constraints   Cardinality Constraints Participation constraints Weak entity Identifying relationship Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. Three kinds of cardinality constraints: 1:N, 1:1, M:N May 2018 ACS-3902 Yangjun Chen

The participation constraint specifies whether the existence of an entity depends on its being related to another entity via the relationship type. Two kinds of participation relationships: total (mandatory) and partial (optional)   A weak entity type is an entity type, for which the primary key cannot be recognized. That is, it exists in a relationship to some other entity type. An identifying relationship exists between a weak entity type and its owner. May 2018 ACS-3902 Yangjun Chen

Department: [DeptNo, Manager_fName, Manager_lName] 3. Consider the following ERD. Map the ERD to a relational database showing the relation(s) that will be created (show relation names, attributes, and primary keys). office DeptNo phone fName lName Department Manager Department: [DeptNo, Manager_fName, Manager_lName]   Phone: [DeptNo, phone] Office: [DeptNo, office] May 2018 ACS-3902 Yangjun Chen

4. Consider the following ERD. Person Fname Lname PerBirthDate PerNo Now, consider the recursive relationship “a person is the child of another person”. a) Modify the ERD to accommodate this relationship. b) Show the relations (show the relation name, attributes, and primary key) that exist when you map your ERD in part a) above to a relational database. . May 2018 ACS-3902 Yangjun Chen

Person: [PerNo, Lname, Fname, PerBirthDate] ChildOf: [child, parent]   ChildOf: [child, parent] May 2018 ACS-3902 Yangjun Chen

Person: 1 John … … 2 Jane 3 Sam 4 Silvia ChildOf: 3 1 2 4 May 2018 ACS-3902 Yangjun Chen

5. List all the different types of attributes. Atomic Attributes   Atomic Attributes Composite Attributes Single-valued Attributes Multi-valued Attributes Key Attributes Partial Keys Surrogate Key Non-key Attributes Derived Attributes May 2018 ACS-3902 Yangjun Chen

6. Given the query below, show the corresponding Query Design View. Use an attached sheet for your answer. Assume that Dealer and Auto are two tables. Dealer has attributes: DealerId, and name; and Auto has attributes: AutoId, Make, Model, Year, Price, and Did, where Did is a foreign key referring to DealerId. For each dealer, find the number of the autos with price > 10000, sold by it. field DealerId AutoId Price table Dealer Auto sort   Total Group by Count show √ criteria >10,000 May 2018 ACS-3902 Yangjun Chen

Select lname, Location, Balance From Customer, Branch, Accounts 7. Assume that in a database, we have three tables: Accounts[AID, CountID, BranchID, Balance], Branch[BranchID, manager, Location, Startdate], and Customers[CusID, CountID, fname, lname, Street, City, State]. Use Query Grid to create a query corresponding to the following SQL statement: Select lname, Location, Balance From Customer, Branch, Accounts Where branch.Location = “Campus”. . field lname Location Balance table Customer Branch Accounts sort   show √ criteria  ”Campus” May 2018 ACS-3902 Yangjun Chen

8. (5) List all the different ways to create tables by MS Access. Answer: - Using Table Wizard - Using data sheet view - Using design view - Creating tables with queries - Creating tables by importing external data sources May 2018 ACS-3902 Yangjun Chen

- Field size- Adjusts the size of the text field 9. Explain the meaning of the following properties for attributes.   - Field size property - Format property - Input Mask property - Default Value property - Validation Rule property - Caption Answer: - Field size- Adjusts the size of the text field - Format- changes the way field is displayed. Does not effect the value. - Input Mask- facilitates data entry by displaying literals - Default Value- the automatically entered value - Validation Rule- Rejects records that do not conform to rules entered. - Alternate name to be displayed other than the field name. Alternate names appear in datasheets, forms, and reports May 2018 ACS-3902 Yangjun Chen

Examples for Format property Format property for Number data type: #,###.##;(#,###.##)[Red];0,000.00;“Undefined” format for positive number format for 0 format for null-value format for negative number 6,789.77 May 2018 ACS-3902 Yangjun Chen

Examples for Input Mask property Input mask forText data type: !\(999") "000\-0000;0;_ - (204) 888-1234 >!“FJ”\-AA\-00000 – FJ-EA-12048 Input mask for Time data type 99:00:00\ >LL;0;_ - 05:56:00 PM May 2018 ACS-3902 Yangjun Chen

Characters that define input masks explanation User must enter a digit (0 to 9). 9 User can enter a digit (0 to 9). # User can enter a digit, space, plus or minus sign. If skipped, Access enters a blank space. L User must enter a letter. ? User can enter a letter. A User must enter a letter or a digit. a User can enter a letter or a digit. User must enter either a character or a space. & C User can enter characters or spaces. May 2018 ACS-3902 Yangjun Chen

Characters that define input masks explanation . , : ; - / Decimal and thousands placeholders, date and time separators. The character you select depends on your Microsoft Windows regional settings. > Coverts all characters that follow to uppercase. < Converts all characters that follow to lowercase. ! Causes the input mask to fill from left to right instead of from right to left. \ Characters immediately following will be displayed literally. "" Characters enclosed in double quotation marks will be displayed literally. May 2018 ACS-3902 Yangjun Chen

10. Consider the following design. Mid Name N wife 1 Marriage Person N husband 1 Pid MDate Map this ERD to a relational database (show relation names, attributes, and primary keys) Person: [Pid, Name] Marriage: [Mid, Mdate, husband, wife] May 2018 ACS-3902 Yangjun Chen