Databases
-
Upload
channing-snow -
Category
Documents
-
view
18 -
download
0
description
Transcript of Databases
![Page 1: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/1.jpg)
Databases
![Page 2: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/2.jpg)
Database
• A database is an organized collection of related data.
![Page 3: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/3.jpg)
Types of Databases
• There are manual databases and computerized databases.
![Page 4: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/4.jpg)
Manual Database
• In a school, a filing cabinet in which student paper based files are placed within manila folders which are filed away in a particular order within the filing cabinet, is a common example of a Manual Database.
![Page 5: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/5.jpg)
Manual Database
• If you draw up a table in your book to keep track of your monthly expenses this is an example of a simple paper based (manual database).
![Page 6: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/6.jpg)
Manual Database
• Table of monthly expenses
Item Expenditure
Food $500
Clothes $400
Liming $200
![Page 7: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/7.jpg)
Computerized Databases
• A Computerized database is created and managed on a computer system using a software called a Database Management System (DBMS).
![Page 8: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/8.jpg)
DBMS
• A set of programs that allows the creation of data files and the alteration, extractioin and deletion of data within these files.
• Eg. Access., Oracle, MySQL, Ms FoxPro, Dbase, SQL Server.
![Page 9: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/9.jpg)
Types of DBMSs
• The most common types of DBMSs are Relational DBMSs and Object Oriented DBMSs.
![Page 10: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/10.jpg)
Relational Database
• Relational DBMSs are the most common type and are used to create Relational databases.
• A relational database is one in which the data is stored in the form of a table/s with rows and columns. Each table should contain data about one particular subject alone.
• All the above named DBMSs are examples of Relational DBMSs.
![Page 11: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/11.jpg)
Object Oriented Database
• An Object Oriented DBMS is one in which the data is stored in the form of a set of interacting objects, this type of DBMS is not very common at this time.
![Page 12: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/12.jpg)
Student Table
First Name Last Name Address Telephone
Frank Williams Arima 667-3429
Frank Williams(jr) Arima 667-3429
Field
Records
![Page 13: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/13.jpg)
Field
• A column in a database table that contains data on ONE specific data item only.
![Page 14: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/14.jpg)
Record / Tuple
• A row in a database table that consists of a group of related fields.
![Page 15: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/15.jpg)
Primary Key
• Each table must contain a field that uniquely identifies each record in a database.
• In normal life persons are also assigned unique identifiers e.g. birth certificate number, id card number, credit card number, car license plate etc.
![Page 16: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/16.jpg)
Student Table Redone
Student Number
First Name
Last Name Address Telephone
01 Frank Williams Arima 667-3429
02 Frank Williams(jr) Arima 667-3429
![Page 17: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/17.jpg)
Data type
• The data type is the type of data that can be permitted for a particular field.
![Page 18: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/18.jpg)
Field Size
• The amount of data can be entered into a particular field.
![Page 19: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/19.jpg)
Class Exercise
• You own a video club. Create a database to store data on movies and customers.
![Page 20: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/20.jpg)
Foreign Key
• This is the primary key of a table placed into another table, so as to create a link between the two tables.
![Page 21: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/21.jpg)
Import
• When data is imported into a database, the data from one file is inserted into the database.
• Data can be inserted from several formats: excel, access, comma delimited text files, tab delimited text files.
![Page 22: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/22.jpg)
Question
• Import the files ExcelData and CommaData, into the database table Customers
![Page 23: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/23.jpg)
Export
• When data is exported into a database, the data from a database table is sent to another file format.
![Page 24: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/24.jpg)
Question
• Export the Movie table as a Rich Text format into My Documents.
![Page 25: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/25.jpg)
Query
• A query allows the user to ask the database questions about the data within the tables or allows changes to be made to the tables and the data within the tables.
![Page 26: Databases](https://reader036.fdocuments.us/reader036/viewer/2022062719/56813123550346895d97959c/html5/thumbnails/26.jpg)
Query types
• Select Query: This is used to ask the database questions about the stored data within the tables.
• Update Query: Makes changes to records in the tables.
• Adds groups of records from one table to another.
• Deletes records from a table.