0% found this document useful (0 votes)
4 views

Databases

Uploaded by

satvikhase200
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Databases

Uploaded by

satvikhase200
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Data Manipulation

Chapter 18
What is a Database?
• A Database is an organized collection of data.
• A Database program is a software which stores and retrieves data
in a structured way.
• Databases store data using a system of files, records and fields.
• A field is a single item of data, such as firstname or date of birth.
• Each field could have a particular type of data for example
firstname would be text, Candidate number could have numbers
and date of birth could be date.
• A record is a collection of fields, for example all information for a
person. It may contain different data types.
What is a Database?
• A file is an organised collection of records, where all records are
oraganised together. A file could have more than one tables.
• There are two types of Databases: Flat-file databases & Relational
databases.
• A Flat-file database stores its data in one table which is organised by
rows and columns(fields). Each field has a data type.
What is a Relational Database?
• A Relational databases stores data in more than one linked
tables in a file.
• Relational databases are designed so as to avoid storing of
data many times.
• Most tables will have a primary key field that holds unique
data (no two records are the same in this field) and is the
field used to identify that record.
• A foreign key in one table will point to a primary key in
another table. Some tables will have one or more foreign key
fields.
• A foreign key is generally created to form relations(links)
between tables.
Flat file database
Relational file database
Why use a Relational Database?
• Storage space is saved by not storing data more than once.

• Because data is not repeated in a relational database, each change to an


item of data or to a record has to be made only once.

• It is also much easier for users to produce reports from a relational database.
where data is held in two or more tables, than from two or more flat-file databases

• Complex queries can be carried out


Data types
• When you create a new database you will set a data type for each field. The data type
tells Access how to store and manipulate the data for each field. You will usually decide
what data type should be used for each field.
• There are a number of data types that you can use and different packages may have
different names for them. The list below shows the generic names for these data types
but, depending on the package used, you may have different names. For example, in
Access an alphanumeric field is called a text field.
• The three main types of field are alphanumeric, numeric and Boolean
• Alphanumeric data can store alpha characters (text) or numeric data (numbers) that will
not be used for calculations. In Access this is called a text field.
• A numeric data type (as the name suggests) is used to store numeric values that may be
used for calculations. In Access this is called a number field.
• There are different types of numeric field including: Integer sub-type, which store whole
numbers.
• In Access you can select an integer field or a long integer field. It is wise to
use a long integer field if it is going to contain three or more digits.
Data types
• Decimal sub-type, which will allow a large number of decimal places, or a specified
restricted number, if this is set in the field properties when the database is created
Example 23.34

• Currency sub-type, which allow currency formatting to be added to the


display. This includes currency symbols and regional symbols. The database
does not store these symbols as this would use up valuable storage space.
• Date and time sub-type, which store a date and/or time as a number.
• A Boolean (or logical) data type stores data in a Yes/No (or True/False, 0/-1)
format.
• There are other data types, such as autonumber (which generates unique
numbers)
• Commercial databases, for example placeholders for media such as images,
sound bites and video clips.

You might also like