Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5 Relational Databases and going multiuser.

Similar presentations


Presentation on theme: "Lecture 5 Relational Databases and going multiuser."— Presentation transcript:

1 Lecture 5 Relational Databases and going multiuser

2 Administrative For last lecture: For last lecture: –Explore new technology (web enabled technology) –Discuss existing technology (How Delta’s databases are currently set up) Finally, got demo copy of FMPRO5 – try to point out differences where I find them. Finally, got demo copy of FMPRO5 – try to point out differences where I find them. Optional test and certification? Optional test and certification?

3 Review What are scripts used for What are scripts used for Designing scripts (before coding) Designing scripts (before coding) How to define scripts How to define scripts Most useful script steps Most useful script steps Templates Templates

4 Questions? Any Questions from last lecture? Any Questions from last lecture?

5 Topics What’s a relational database good for? What’s a relational database good for? Breaking it up. Breaking it up. Implementing relational db’s in FileMaker Implementing relational db’s in FileMaker Basic Multi-user and Security issues Basic Multi-user and Security issues Tips for working in groups Tips for working in groups

6 Relational DB Intro What is a relationship, and why is it necessary What is a relationship, and why is it necessary Metaphor: Think of yourself vs. a day in your life Metaphor: Think of yourself vs. a day in your life –You yourself have attributes (DOB, Height, etc) –A day has certain attributes (traffic jam on I-80, Sunny day, etc) It contains some similarities between your day and other days, and some individual experiences –The relational part happens at the intersection between you and your day. –This can be seen as a “contains a” relationship, since a day contains people, one of which is you. –This relationship actually goes both ways, because in your “memory field” it will contain many of your days. But you access is limited to what happened to you

7 Relational DB Intro Real world example Real world example Think of a furniture store database system: Think of a furniture store database system: –Shipping information in one Db(address etc) –Transaction information in another (e.g. print receipts) –Furniture information in another(price, number etc) –Possibly even employee information to link to receipts. Relational DB are called tables in some other DB systems Relational DB are called tables in some other DB systems –In Microsoft Access you would use tables for many of these things

8 Deciding when to break Deciding when to break up Deciding when to break up –First figure out if you have any “contains a” relationships –These are your candidates –If you’re database is extremely simple or you are using your db for only one function (e.g. printing receipts) –Otherwise you should strongly consider breaking it up.

9 Deciding when to break Once you’ve decided to break it up you have two options regarding the way to do lookups: Once you’ve decided to break it up you have two options regarding the way to do lookups: –By Value, which means to copy the information from one database to the other (if you do this changes in one db will not effect the other) –By Reference, which essentially means to put the fields from one database directly into the other.

10 Value or Reference? Examples: Examples: Value: Value: –This is good if for example you are storing receipts (or forms), the majority of the information should be copied in from your other sources, because you would not want your price info changing Reference: Reference: –If you have a real-time inventory you would want to do that with references so you could update the information as it changed.

11 Key Field Usually we’ll use what’s known as a key field to connect two databases, this will uniquely identify records, and could be for example a social security number. Usually we’ll use what’s known as a key field to connect two databases, this will uniquely identify records, and could be for example a social security number. You will always want a unique field so if you don’t have one make it, either use a caluculation and combine two fields, or use the serial number function under autoentry You will always want a unique field so if you don’t have one make it, either use a caluculation and combine two fields, or use the serial number function under autoentry

12 Implementation First we need to define the relationships First we need to define the relationships –Go to File…Define Relationships(FMPRO5) or File…Define…Define Relationships(FMPRO4) –The following Screen will appear

13 Implementation Click the New button, you will be presented with a database, select the file you want to relate to this one. Click the New button, you will be presented with a database, select the file you want to relate to this one. Now you will be presented with this screen: Now you will be presented with this screen: Relate the key field from DB2 with the lookup field from DB1 Relate the key field from DB2 with the lookup field from DB1

14 Implementation Click the New button, you will be presented with a database, select the file you want to relate to this one. Click the New button, you will be presented with a database, select the file you want to relate to this one. Now you will be presented with this screen: Now you will be presented with this screen: Relate the key field from DB2 with the lookup field from DB1 Relate the key field from DB2 with the lookup field from DB1

15 Implementation Don’t worry too much about the options on this screen (I.e. create related record) the only one you may want to look at at this stage is the sort related records, this sorts the output from a relationship Don’t worry too much about the options on this screen (I.e. create related record) the only one you may want to look at at this stage is the sort related records, this sorts the output from a relationship Now that you’ve made a relationship we can use it for Value or reference lookups, let’s try by Value first Now that you’ve made a relationship we can use it for Value or reference lookups, let’s try by Value first –Under the auto-entry screen you may have seen a checkbox that says looked-up value, simply click on that box and then select the name of your relationship from the screen that pop’s up

16 Implementation –Select the same field for both (I.e. both Name) –DON’T do this for the field that you used in the relationship, this must remain as a normal field so that when you type in the (I.e. SS#) the lookup will appear on the related fields(name etc) –Now we can finally see where repeating fields become handy. –Click on repetitions on the bottom of the autoenter screen(FMPRO4) or in the storage tab(FMPRO5) –Now click on the field on the layout go to Format…Field Format type in the number of repetitions of the field you want to display

17 Implementation –What you’ve just done is perfect for an invoice or receipt because you could type in a part number and have the price come up from the related database, but that would not be changed if the price goes down. Now let’s look at references Now let’s look at references –A good example of this wanted to display how many of an inventory item were in stock or maybe for displaying a students contact info on an invoice

18 Implementation –You can put referential fields directly in your layout, simply use the field tool like usual, except when it prompts you for the field, pull down the top menu to find your relationship, then choose the related field –This works fine for things that are unique(I.e. lookup the address from the student DB) –If instead you are looking for something with more than one repetition (I.e. all the classes the student has taken, you will need to do something else

19 Implementation –You need to use a portal to display more than one record on the same screen –The portal tool looks like this: and is next to the button tool –Simply drag it out to display an area, than drag in the fields you defined above –The portal looks like this –Make sure and drag into the top white section

20 Multi User Because it may be helpful for the project I’ll discuss what you will need to do to set up your database so it can be worked upon in multiple locations at once Because it may be helpful for the project I’ll discuss what you will need to do to set up your database so it can be worked upon in multiple locations at once –One caveat you can not define fields once your db is set up for multi-user, so define these first. –First go to Edit…Preferences…Application then make sure under network protocol it says TCP/IP if not select it

21 Multi User –Now go to file…sharing and select multi-user –Now would be a good time to set up a password, go to File…Access Privileges…Password –The following screen will appear: –Type in a password and hit create to password protect your file. Don’t worry about everything else for now

22 Multi User –In order for both users to use it it has to be open on one computer, then to log in the other user just clicks on File…open and then clicks on the hosts button, somewhere in the list that appears should be the name of the file click open and type in the password. Now both users can change the layout, modify scripts etc (except for fields of course)

23 Groups Working in groups allows for complicated databases to be designed in the minimal amount of time Working in groups allows for complicated databases to be designed in the minimal amount of time Group work is also good for learning because it allows students to learn from each other Group work is also good for learning because it allows students to learn from each other There are many different approaches to working in groups I will present two and the method I would prefer for you to take on this project There are many different approaches to working in groups I will present two and the method I would prefer for you to take on this project –The expert approach: in this approach each person either is or becomes an expert in a specific area (e.g. layouts, scripts etc) this approach has several advantages

24 Groups –The advantages of the expert approach: minimal amount of time learning with maximal overall knowledge, great for getting a project done quickly, but does have some disadvantages this technique is often used in industry (and even here in our computer services department because of those advantages) –First and most important for this class is that you don’t learn everything about the database system which leads to the next problem, you can have concurrency problems, if one person is not doing there job it could hold up another person from doing their job.

25 Groups –The technique I would like you to use is what I call the 80/20 group distribution –If one person is or wants to be an expert in one area (e.g. scripts) they should do 80% of the work in this area, the other 20% should be done by the other member(s) –This allows for the project to be completed relatively quickly while everyone gets a chance to learn

26 Groups –Finally, I would recommend starting work the following way, before you start working with FileMaker at all write out everything you want to do on paper –Start out by writing a Sentence or two describing what the goal of the project is –Then together work on figuring out what fields will be necessary if there are any what information is required to be in the field if any(validations) and whether a calculation is necessary –You may find it helpful to draw out rough sketches of what the layouts are going to look like –Don’t forget to write out in English what your scripts will do.

27 Advice –Utilize the message board, if you’re having a problem figuring something out check the message board, if there is nothing relevant there then post. –If you have completed a problem and see a question related to it feel free to give the user a hint or explain a concept, just don’t post your solution =) –I will jump in where necessary. –Good luck. –There is no firm due date on this project (probably the last day of class), I reserve the right to add to the definition it as we learn more material.


Download ppt "Lecture 5 Relational Databases and going multiuser."

Similar presentations


Ads by Google