0% found this document useful (0 votes)
21 views2 pages

Database CH 9

A database is a structured collection of data organized in tables, consisting of records and fields, which can store various types of information. Each table has a fixed name and includes validation checks to ensure data integrity, with specific data types assigned to each field. A primary key, such as TicketNo in a TICKETS table, is used to uniquely identify each record without repetition.

Uploaded by

naimulshadhin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Database CH 9

A database is a structured collection of data organized in tables, consisting of records and fields, which can store various types of information. Each table has a fixed name and includes validation checks to ensure data integrity, with specific data types assigned to each field. A primary key, such as TicketNo in a TICKETS table, is used to uniquely identify each record without repetition.

Uploaded by

naimulshadhin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

‭Unit 9: Databases‬

‭Databases:‬
‭➜‬‭A database is a structured collection of data that‬‭allows people to extract information‬
i‭n a way that meets their needs.‬
‭➜‬‭Data can include text, images, numbers.‬
‭➜‬‭Single-table database contains only one table‬

‭➜‬‭Can store information about people, products, events,‬‭timings and more‬


‭ ‬‭Data is stored in tables, which further consists‬‭of records.‬
‭➜‬‭Records further consist of fields. Number of records‬‭can vary as data is entered or‬
‭deleted.‬
‭➜‬‭Number of fields is fixed‬
‭➜‬‭Records are rows‬
‭➜‬‭Fields are columns‬
‭TABLE‬

‭Record 1‬ ‭Field 1‬ ‭Field 2‬ ‭Field 3‬ ‭Field 4‬ ‭Field 5‬

‭Record 2‬ ‭Field 1‬ ‭Field 2‬ ‭Field 3‬ ‭Field 4‬ ‭Field 5‬

‭Row‬ ‭Record 3‬ ‭Field 1‬ ‭Field 2‬ ‭Field 3‬ ‭Field 4‬ ‭Field 5‬

‭Record 4‬ ‭Field 1‬ ‭Field 2‬ ‭Field 3‬ ‭Field 4‬ ‭Field 5‬

‭Record 5‬ ‭Field 1‬ ‭Field 2‬ ‭Field 3‬ ‭Field 4‬ ‭Field 5‬

‭Column‬


‭ ‬‭The table has a fixed name, such as TICKETS (this‬‭table is for bus tickets)‬
‭➜‬‭Each record will be different with fields‬
‭➜‬‭Each field will have different data such as FirstName,‬‭LastName, TicketNo, BusNo,‬
‭and more. There will be‬‭no spaces‬‭in between‬

‭26‬
‭MOJZA‬
‭➜‬‭Example of a table:‬
‭TICKETS‬

‭TicketNo‬ ‭FirstName‬ ‭LastName‬ ‭BusNo‬ ‭Price‬ ‭Destination‬

‭TicketNo #1‬ ‭FirstName #1‬ ‭LastName #1‬ ‭BusNo #1‬ ‭Price#1‬ ‭Destination #1‬

‭TicketNo #2‬ ‭FirstName #2‬ ‭LastName #2‬ ‭BusNo #2‬ ‭Price#2‬ ‭Destination #2‬

‭TicketNo #3‬ ‭FirstName #3‬ ‭LastName #3‬ ‭BusNo #3‬ ‭Price#3‬ ‭Destination #3‬

‭TicketNo #4‬ ‭FirstName #4‬ ‭LastName #4‬ ‭BusNo #4‬ ‭Price#4‬ ‭Destination #4‬

‭TicketNo #5‬ ‭FirstName #5‬ ‭LastName #5‬ ‭BusNo #5‬ ‭Price#5‬ ‭Destination #5‬


‭ ‬‭Databases will also use validation checks when data‬‭is being entered‬
‭➜‬‭Validation checks of presence check, range check,‬‭type check, length check can be‬
‭done‬


‭ ‬‭Each field will have a specific data type and will‬‭only accept the data given in that‬
‭specific data type‬
‭➜‬‭There are 6 basic data types used in databases:‬
‭Data type‬ ‭Used for‬

‭Alphanumeric / text‬ ‭A number of characters/a mix of alphabets and numbers‬

‭Character‬ ‭A single character‬

‭Boolean‬ ‭TRUE or FALSE / 1 or 0 / YES or NO (for two options)‬

‭Integer‬ ‭A whole number‬

‭Real‬ ‭A decimal number‬

‭Date/time‬ ‭Date and/or time‬


‭ ‬‭To identify a specific item, person or etc., a unique‬‭field is required‬
‭➜‬‭Unique here means no repetition of data‬
‭➜‬‭The field that is unique is called a Primary Key‬
‭➜‬‭In the database table, TICKETS, the primary key‬‭can be the TicketNo field, as it has‬
‭no repetition of data and will be unique‬

You might also like