Upload
erik-carter
View
217
Download
0
Embed Size (px)
Citation preview
Database Management System
Conducted ByProvincial Computer Resource
CentreGurudeniyaJayaratna Alahakoon
6/13/2005 PCRC Central Province 2
What is a Database
• Database is a collection of Information related to a particular subject.
Ex. • School Database• Employee Database• Telephone Directory
6/13/2005 PCRC Central Province 3
What is a Table
• Table is a collection of records specific to the topic
• Teacher table• Student table• Class table
6/13/2005 PCRC Central Province 4
What is a record
• Record contained information about a single item in your table( Collection of fields)• EX.
Name Age Se No.
• A M G Nishantha 27 No.1222• B I Perera 28 NO.1133
6/13/2005 PCRC Central Province 5
What is a field
• Field is a piece of data within a record.
ExNameAddressAge
6/13/2005 PCRC Central Province 6
What is primary key
• The field or combination of fields which can be used to identify a record from a table uniquely is called as a primary key
6/13/2005 PCRC Central Province 7
What are the Database Software
• Dbase 3+• FoxPro• Oracle• Access
6/13/2005 PCRC Central Province 8
What is MS Access
• Database Management Software introduced by Microsoft company
6/13/2005 PCRC Central Province 9
What are the different type of Objects available in MS Access• Tables• Queries• Forms• Reports• Pages• Macros• Modules
6/13/2005 PCRC Central Province 10
What is a Tables
• It is the most important object in the database.
• Tables are used to enter data .
• Single database may contain one or more tables.
• Table contain rows and columns.
• Row represent Record and column represent Field.
class ClassNo Location Teacher size
10 D T006 890
11 D T005 450
1A C T002 500
1B C T003 350
1C C T012 450
2 B T012 350
3 B T013 700
4 B T015 350
5 B T017 600
5A D T026 450
6 C T016 450
6A D T026 500
7 C T019 450
8 C T020 670
9 C T004 540
6/13/2005 PCRC Central Province 11
Queries
• Quarry can be used to select specific records, or filter records, fields using a criteria
6/13/2005 PCRC Central Province 12
Forms
• Forms can be used to enter data or view data of a table or a query in more user friendly manner
6/13/2005 PCRC Central Province 13
Reports
• Reports are used to produce printed output of Data of table (Tables) or Query (Queries)
6/13/2005 PCRC Central Province 14
Macros
• Macros can be used to automate functions
6/13/2005 PCRC Central Province 15
Modules
• Allows us to write functions that can be used in queries.
6/13/2005 PCRC Central Province 16
Type of data in MS Access
1. Text2. Number3. Date/Time4. Currency5. Memo6. OLE7. AutoNumber8. Hyperlink9. YES/NO (Logical)10. Lookup Wizard
6/13/2005 PCRC Central Province 17
Setting Type of data Size
Text
(Default) Text or combinations of text and numbers, as well as numbers that don't require calculations, such as phone numbers.
Up to 255 characters or the length set by the FieldSize property, whichever is less. Microsoft Access does not reserve space for unused portions of a text field.
MemoLengthy text or combinations
of text and numbers.
Up to 65,535 characters. (If the Memo field is manipulated through DAO and only text and numbers [not binary data] will be stored in it, then the size of the Memo field is limited by the size of the database.)
Number
Numeric data used in mathematical calculations. For more information on how to set the specific Number type, see the FieldSize property topic.
1, 2, 4, or 8 bytes (16 bytes if the FieldSize property is set to Replication ID).
6/13/2005 PCRC Central Province 18
Setting Type of data Size
Date/TimeDate and time values for the years 100
through 9999.8 bytes.
Currency
Currency values and numeric data used in mathematical calculations involving data with one to four decimal places. Accurate to 15 digits on the left side of the decimal separator and to 4 digits on the right side.
8 bytes.
AutoNumber
A unique sequential (incremented by 1) number or random number assigned by Microsoft Access whenever a new record is added to a table. AutoNumber fields can't be updated. For more information, see the NewValues property topic.
4 bytes (16 bytes if the FieldSize property is set to Replication ID).
Yes/NoYes and No values and fields that
contain only one of two values (Yes/No, True/False, or On/Off).
1 bit.
6/13/2005 PCRC Central Province 19
Setting Type of data Size
OLE Object
An object (such as a Microsoft Excel spreadsheet, a Microsoft Word document, graphics, sounds, or other binary data) linked to or embedded in a Microsoft Access table.
Up to 1 gigabyte (limited by available disk space)
Hyperlink
Text or combinations of text and numbers stored as text and used as a hyperlink address. A hyperlink address can have up to three parts:
text to display— the text that appears in a field or control.
address— the path to a file (UNC path) or page (URL).subaddress— a location within the file or page.screentip— the text displayed as a tooltip.The easiest way to insert a hyperlink address in a field
or control is to click Hyperlink on the Insert menu.
Each part of the three parts of a Hyperlink data type can contain up to 2048 characters.
Lookup Wizard
Creates a field that allows you to choose a value from another table or from a list of values by using a list box or combo box. Clicking this option starts the Lookup Wizard, which creates a Lookup field. After you complete the wizard, Microsoft Access sets the data type based on the values selected in the wizard.
The same size as the primary key field used to perform the lookup, typically 4 bytes.
6/13/2005 PCRC Central Province 20
Normalization
• First Normal Form (1NF)• Second Normal Form (2NF)• Third Normal Form (3NF)
6/13/2005 PCRC Central Province 21
First Normal Form (1NF)
• If every attribute of R (Table) is atomic then R is in 1NF
( None of the attribute is composite or multi valued)
EX.
Employee (Emp_No, Name, Add, Salary)
Name may have two or more parts but it is considered as one string
6/13/2005 PCRC Central Province 22
Second Normal Form (2NF)• A relation R is in 2NF if every non_prime
attributes of R is fully functionally dependant on the primary key of R
EX.Emp_Proj( NIC, PNO, Hours, Ename, Pname, Plocation)
NIC,PNO Hours (Full dependent)
NIC,PNO Ename (partial dependent)
Not in 2NF
Employee( NIC, Ename)Project ( PNO, Pname, Plocation)Hours cannot be placed in any of the above hence create another relationEmp_Proj (NIC, PNO, Hours)
6/13/2005 PCRC Central Province 23
Third Normal Form (3NF)• 3NF is based on transitive dependancy
A relation is in 3NF , if it satisfy 2NF and no none prime attribute of R is transitive dependant on the primary key
Salesman(E_No, E_Name, Sale_amount, Salary, Discount)
E_No Sale_amount E_No DiscountSale_amount Discount
This is transitive dependant hence not in 3NF