Download presentation
Presentation is loading. Please wait.
Published byWillis Elliott Modified over 9 years ago
1
Task #1 Create a relational database on computers in computer classroom 308, using MySQL server and any client. Create the same database, using MS Access 2013. Three tables, which can be logically connected Queries for typical selection and combined listing of it Forms for entering new data, modifying data (to do the database functions, depending on application) Example of report with use of grouping Task #2 Task #3 Draw the E-R diagram for your database
2
Create new database, choose a suitable name.
5
Create at least three tables, then insert some testing data.
7
Define type of each of fields. General text should be the Varchar2 type. Many other properties can be set. Use help if you are not sure. Column description can be set; it is used, when a form is created.
9
Query can be used for selecting only some of rows by use filtering, or when working with data, presented in more tables, if they are logically connected. Queries is typically used as sources of data for forms.
11
Connect tables by drag-and-drop a field from one table to the respective field in the other table. Connection line will be added to the scheme. Can be selected by mouse and erased by the "Delete" key on keyboard, or by local menu (use right mouse button)
13
Now, you can select items from both tables; query will return only connected data (rows) from the tables.
15
Form can be created using the Create ribbon. You can select "Form design" to create form in the design view. In the next example, the "Form Wizard" is used. Prepared form can be easily adapted (or adjusted), if needed, by "Open in design view" from the list of objects.
22
Last example is the "Report Wizard". Reports are used when printing data, or exporting to a pdf format.
24
Skipped: data source selection (query with combination of users and cars, who them rented). Next slide: Grouping options:
31
… open the prepared report in the design view:
33
Query can be opened in the same style, as table. You can even add new data to original table. If the query doesn't contain some of fields, the default value will be set. If no default value has been defined while designing the table, null will be used. If the null value is not acceptable, an error will be reported.
36
The next features, as use of the Visual Basic, is not obligatory, but will be counted as some extra points. On the next slide, only cars, for where no client is defined, will be listed. Result = list of available cars.
38
Lists only cars, where the user id is bigger then zero – zero means “no user”: (for use this convention, the link to user table cannot be fixed as table relation [primary to public key], because of there is no user with id of zero; alternatively specific user, for example with id=1, can be created)
40
To create the main menu, create a new Form in the design view, place buttons and by the right mouse button, look for their properties. For assigning a function, the "On Click" event should be filled. The possibility of "Open Form..." is the most often. Another easy to create is a closing of the application (a Quit button).
42
One of possibilities is to set a Visual Basic procedure. For beginners, creating of an macro could be easier.
46
... screens from defining a macro... "Control name" is the name of an object on the active Form. Active record is bind with the line in the table, by using "SaveRecord" can be written back to the table. Before this, values can be changed by the macro. On the end, the active Form is closed.
49
... create a new button while design view of a form...
51
If the Visual Basic macro should be used, it has to be defined (written) before.
53
For setting a link value to another table, you can select the value from a combo box. Combo box should be prefilled with a corresponding data. On the next slide, common situation (just link to a query data) is shown. On the second slide, combo box for an another table link is prefilled with an SQL command.
56
Text of this request is: SELECT Zákazník.ID_zakaznika, Zákazník.Příjmení, Zákazník.Jméno FROM Zákazník; Resulting behavior after executing: (the SELECT command returns three columns)
58
All for now.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.