The good ER checklist The checklist Entity names










- Slides: 10
The good E-R checklist The checklist: • Entity names • Attribute names • Primary keys • Foreign keys Eh? • Relationship cardinalities and optionality • Relationship labels If needed, annotation As in this schema: Teacher Number Name teaches Module. Teacher Module Teacher number* Module number* taught by Subject Time_period NB: the time period attribute is used to store when a teacher takes a given module. 1
What’s optionality? • Answer: you don’t need it. We will look at it in greater detail later. If you want to know anyway: Compulsory: modules must be taught by someone. Teacher Number teaches Name Module. Teacher Module Teacher number* Module number* taught by Subject Time_period Optional: teachers don’t have to teach modules 2
In what order should we do it? • Answer: the order given in the task list would work. Work out ERD But. . . Build GUI The tasks inter-relate; doing one will help with others. Try queries Create tables Insert data 3
What should we do when data import doesn’t work? Answer: it depends. 4
Why doesn’t data import work? Answer: a better question. It still depends. 5
Why doesn’t data import work? What does the report say? Is it all rows? Is it just some rows? Are they What’s different duplicates? about them? Did you map the right columns? Is there a special format (date, £. . . )? Is the problem in a related table? Answer: It depends. 6
The problem with related tables • These two tables are related. • Teacher data can be inserted in with no regard for existing data. Module. Teacher data must refer • But if constraints are set: to a teacher Parent table Child table Module. Teacher Number Name teaches Teacher number* Module number* Time_period Is the problem in a child table due to something missing 7 in the parent table?
How can we work together? Distance and Christmas are a problem. . . Answers – two solutions: • Privileges control – using Oracle’s permissions system to allow your colleagues to change or use your data • Account sharing – dedicate one of your accounts to the shared work; share the login (to Oracle, not SHU!!). 8
The account is not working! • If your account becomes unavailable. . . • Password reset may not work Looks good. . . But account reset is incomplete This link: https: //dbutils. shu. ac. uk/oracleutility Was created by SHU IT colleagues. It does a proper reset. Use that. 9
Do point-and-click queries work? • Some of them work, some don’t. • But you can’t save or edit point and click operations. As you finish the wizard, there is an “SQL” button Your query, as SQL! Edit before you run, or save for later. 10