Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. 2. 3. 4.
You may have sub-categories and have to break them down and
create more tables.
Potential Relationships:
2 and 3
1. Employee could be a customer
2. Incentive program based on how many customers (new?) you
get to rent videos
Video Rental Store
Before you start any database design there are a couple of rules – things
to know.
3. Determine what the fields will be for every table - Try to determine what
some of the fields are for the tables, such as, the Inventory Table.
Data entry – after creating the tables you then can enter your data.
Data is automatically saved to the DB as you enter it and move to the next
field box.
Why save automatically?
DB is usually used by multiple people across a network.
DB records save as you go so others can immediately
access the record.
As long as you are in entry mode (little pencil) no one else
can use that
record and see the updated table
Also prevents loss of data if system crashes.
Adjust the field width to accommodate your entries (You can double-click to
resize just like in Excel).
Video Rental Store
Field Name Field Length Field Type
Title 30 (default is 50) Text
*Category 11 (Documentary is longest) Text
Actors (first two only full names) 30 Text
Director 25 Text
*MPAA Rating 5 Text
Running Time (minutes) (don’t need to specify with numbers) Number
Year (don’t need to specify with numbers) Number
**Format (DVD) 1 Yes/No
**BW/Color (BW) 1 Yes/No
ID Number (Auto number) Auto number
*categories have a limited number of characters for the field or you can tell the
length to use, such as, G, PG, PG-13, R, NR, which are predefined lengths or
limit the number of choices you can make.
**Formats: DVD or VHS
Only two choices, one or the other. Make the format one of the two and then a
check means Yes and a null (no entry) means No.
DVD checked VHS not checked
BW checked Color not checked
Go with the choice that is less common so less often will you have to enter a data
(check) mark.
Video Rental Store
Queries and Reports
Queries:
Based on tables, but they can be based on other queries.
Allows us to ask a question of the database.
For example, sort alphabetically by title or list movies over 2
hours long.
Queries are live data, if you change the table, the change
affects the query and vice versa. Don’t delete data in a query
as it will affect the table as well. Queries are very powerful.
Queries are dynamic.
Don’t use the wizard to create, use design view – at first it can
be confusing, but easier as you learn it.
Create in design view then run it to see if you got the desired
results.
RUN the query using the run button on the design view toolbar
– this is the best way to run the query – it avoids confusion.
Video Rental Store
Queries (cont.):
Ways to add fields to query:
Double click on a field and it will jump to the next available
field position.
Drag and drop – if drag on top of a field that is already there,
the field will move over for the new one.
* means use all fields
STOP!