Download presentation
Presentation is loading. Please wait.
1
1 Review SQL Exercise: UPDATE StudentTable SET LetterScore = ’A’ WHERE Score >= ‘90’. Original Table: StudentTable StudentNumberStudentNameScoreLetterScore 1000Justin Frank89-- 2000Dennis Wilson60-- 3000Sheldon Benson92-- 4000Gordon Black87-- 5000Jimmy Foxx96-- A A UPDATE StudentTable SET LetterScore = ’B’ WHERE Score >= ‘80’. B B B B The second command undermines the result of the first command
2
2 Database Development Process E-R Modeling: High level blueprint defining how data are stored structurally in the system Define users’ need through interview What to look for in the interview? How many entities? How the entities are related? (relationships)
3
3 Class 2: E-R Modeling and Database Lab E-R Data Model The most popular technique for creating a data model. E: entity (things) R: relationship (among the entities) + business rules restricting the flow of the data Data Model: Read Problem Solving Guide: (p89a) Immanuel Kant, Data Modeler Attempts to model the “real world” Simply a model of what the data modeler perceives
4
4 5 minutes free write Social Implications of DB: Relate any of Kant’s ideas to what you learned from reading “For Some, Online Persona Undermines Resume” PRINT your name on Free Write and hand it in
5
5 More exercise Book 23 a) Create a E-R Diagram to relate all the information in the form
6
6 Translating E-R diagram into Tables How to translate the three basic types of relationships into data tables and establish relationships? One to Many (1:N) Many to Many (N:M) One to One (1:1)
7
7 Translating E-R diagram into Tables (1:N) Step 1: Create one table for each entity Key
8
8 Translating E-R diagram into Tables (1:N) Step 2: Add Foreign Key Column to the “many entity” to represent relationship
9
9 Step 3: edit relationship Go to Tools Relationships Add two entities Drag the “advisor name” of advisor table to the “advisor name” of student table. Close relationships
10
10 Many-to-Many Relationship Now the rule changed One advisor can supervise many students One student can have many adviser
11
11 Foreign Key doesn’t work for N:M relationship
12
12 Solution
13
13 Exercise: Revise the relationship of previous exercise in Access and input the above records
14
14 1:1 Relationship How to convert into tables?
15
15 Exercise Based on your E-R diagram in 23(a), construct tables and relationships in Access. Add at least three records for each table.
16
16 Importance of User Review Users are the final judges of what data the database should contain and how records relate to one another Easiest time to change database structure is during data modeling stage Once database has been constructed, loaded with data, and application forms, reports, queries, and application programs created, changing a relationship means weeks of work!
17
17 How should you review as a user? (Cont) When database developed for your use, you must carefully review data model If you don’t understand any aspect of it, ask for clarification until you do Data model must accurately reflect your view of business Do not proceed unless you are 100% comfortable with the model
18
18 Key Terms and Concepts Access DBMS one-to-many relationship Attribute E-R data model one-to-one relationship Byte Field Personal DBMS Column File (Table) Query Crow’s foot Foreign key Record Database Form Relationship Database application system Identifier Report DB2 Key Row DBMS Meta Data SQL E-R data model many-to-many relationship SQL Server Enterprise DBMS Oracle
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.