Page 1
Moz: How will you extract the data that you require?
Jy oti: Based on the room occupancy details, w e can find if rooms are av ailable for our dates.
Moz: Yes, this process is called information extraction. It is also called querying the database. A
Database Management System provides the software programs and tools to control the creation,
maintenance and use of a database.
Introduction to Database and DBMS
9
A database is a collection of data that is organized for easy access, retrieval and management
of its contents. A database has one or more related tables of data. The data can be any
format like text, numeric, images, audio, and video.
Concept
Database
Informaton
Aim: In this lesson, you will learn:
- Database, tables, queries.
- Using DBMS tools and softw are.
- Applications of database.
Jy oti: W e are going to Kulu Manali for the holidays. W e are looking at the v arious places that w e can
visit and which hotel has vacant rooms.
T ejas: It is interesting to know that the w ebsite provides room v acancy details along with dates. This
information is also updated regularly!
Moz: Yes. A database is used to store such data and a database management system is used to
retrieve information.
Jy oti: How is the data stored in the database?
Moz: Data is stored in tables. These tables are organized in such a way that information required can
be easily retrieved. For example, consider a hotel in Kulu Manali. You want to stay in this hotel. What
is the information required by you to book a room in this hotel?
T ejas: Room’ s v acancy status for some particular dates.
Moz: What data would be required to find room vacancy information?
Jy oti: W e w ould need data on: (1) Rooms in the hotel and their details, (2) Room occupancy details.
Moz: Right. You have defined two tables for a hotel database, one where room details are stored and
the other where the room occupancy details are stored.
Information
Information about
the rooms available
Page 2
Moz: How will you extract the data that you require?
Jy oti: Based on the room occupancy details, w e can find if rooms are av ailable for our dates.
Moz: Yes, this process is called information extraction. It is also called querying the database. A
Database Management System provides the software programs and tools to control the creation,
maintenance and use of a database.
Introduction to Database and DBMS
9
A database is a collection of data that is organized for easy access, retrieval and management
of its contents. A database has one or more related tables of data. The data can be any
format like text, numeric, images, audio, and video.
Concept
Database
Informaton
Aim: In this lesson, you will learn:
- Database, tables, queries.
- Using DBMS tools and softw are.
- Applications of database.
Jy oti: W e are going to Kulu Manali for the holidays. W e are looking at the v arious places that w e can
visit and which hotel has vacant rooms.
T ejas: It is interesting to know that the w ebsite provides room v acancy details along with dates. This
information is also updated regularly!
Moz: Yes. A database is used to store such data and a database management system is used to
retrieve information.
Jy oti: How is the data stored in the database?
Moz: Data is stored in tables. These tables are organized in such a way that information required can
be easily retrieved. For example, consider a hotel in Kulu Manali. You want to stay in this hotel. What
is the information required by you to book a room in this hotel?
T ejas: Room’ s v acancy status for some particular dates.
Moz: What data would be required to find room vacancy information?
Jy oti: W e w ould need data on: (1) Rooms in the hotel and their details, (2) Room occupancy details.
Moz: Right. You have defined two tables for a hotel database, one where room details are stored and
the other where the room occupancy details are stored.
Information
Information about
the rooms available
T ejas: What does control mean here?
Moz: In the hotel reservation database, room occupancy is entered by the hotel management.
The management does not want anyone to access these tables and modify the data. So, they may
restrict view of these data to selected users. There are inbuilt procedures in DBMS which make sure
that such requirements are met. This is control of a database.
Moz: Where else do you think DBMS are used?
Jy oti: Railw ay and airline ticket booking.
T ejas: In our school to maintain the records of students, library .
Moz: Yes. Databases are used in many online applications.
Database management system (DBMS) is a software package that provides software
programs to control the creation, maintenance and use of a database.
Concept
Database management system (DBMS)
The software programs in a DBMS provide tools and software programs as follows:
Create and maintain users of database and database administrators. •
Define and create the tables. •
Enter, update and maintain data. •
Retrieve information and reporting tools. •
Some popula r DBMS packages are: Oracle, Microsoft Access, MySQL, PostgreSQL, Open
Office database.
Example of applications where database is used are:
Railway and Airline: For schedules and reservation. •
Banking: For customer information, accounts, loans, transactions like deposits and •
withdrawal of money.
Universities and schools: Student and teacher information, issue of books in library, •
office for financial transactions like student fee collection and salary of teachers.
Telecommunication: For keeping track of number of calls made and preparing bills. •
Shops: For displaying prices and preparing bills, keeping track of inventory and fast •
moving goods.
Info Info
DBMS tools and software
Database Applications
Moz: Now look at the following table which belongs to a school database. Note the technical terms
that are used for each part of the table.
class_8_student_info
Student_id Name Date of birth
12 Sweta S 23/01/97
34 T ejas 14/12/96
23 Jy oti 15/08/96
45 Gurmeet 25/03/97
67 Ali 01/01/97
195 Sw eta G 16/11/96
Page 3
Moz: How will you extract the data that you require?
Jy oti: Based on the room occupancy details, w e can find if rooms are av ailable for our dates.
Moz: Yes, this process is called information extraction. It is also called querying the database. A
Database Management System provides the software programs and tools to control the creation,
maintenance and use of a database.
Introduction to Database and DBMS
9
A database is a collection of data that is organized for easy access, retrieval and management
of its contents. A database has one or more related tables of data. The data can be any
format like text, numeric, images, audio, and video.
Concept
Database
Informaton
Aim: In this lesson, you will learn:
- Database, tables, queries.
- Using DBMS tools and softw are.
- Applications of database.
Jy oti: W e are going to Kulu Manali for the holidays. W e are looking at the v arious places that w e can
visit and which hotel has vacant rooms.
T ejas: It is interesting to know that the w ebsite provides room v acancy details along with dates. This
information is also updated regularly!
Moz: Yes. A database is used to store such data and a database management system is used to
retrieve information.
Jy oti: How is the data stored in the database?
Moz: Data is stored in tables. These tables are organized in such a way that information required can
be easily retrieved. For example, consider a hotel in Kulu Manali. You want to stay in this hotel. What
is the information required by you to book a room in this hotel?
T ejas: Room’ s v acancy status for some particular dates.
Moz: What data would be required to find room vacancy information?
Jy oti: W e w ould need data on: (1) Rooms in the hotel and their details, (2) Room occupancy details.
Moz: Right. You have defined two tables for a hotel database, one where room details are stored and
the other where the room occupancy details are stored.
Information
Information about
the rooms available
T ejas: What does control mean here?
Moz: In the hotel reservation database, room occupancy is entered by the hotel management.
The management does not want anyone to access these tables and modify the data. So, they may
restrict view of these data to selected users. There are inbuilt procedures in DBMS which make sure
that such requirements are met. This is control of a database.
Moz: Where else do you think DBMS are used?
Jy oti: Railw ay and airline ticket booking.
T ejas: In our school to maintain the records of students, library .
Moz: Yes. Databases are used in many online applications.
Database management system (DBMS) is a software package that provides software
programs to control the creation, maintenance and use of a database.
Concept
Database management system (DBMS)
The software programs in a DBMS provide tools and software programs as follows:
Create and maintain users of database and database administrators. •
Define and create the tables. •
Enter, update and maintain data. •
Retrieve information and reporting tools. •
Some popula r DBMS packages are: Oracle, Microsoft Access, MySQL, PostgreSQL, Open
Office database.
Example of applications where database is used are:
Railway and Airline: For schedules and reservation. •
Banking: For customer information, accounts, loans, transactions like deposits and •
withdrawal of money.
Universities and schools: Student and teacher information, issue of books in library, •
office for financial transactions like student fee collection and salary of teachers.
Telecommunication: For keeping track of number of calls made and preparing bills. •
Shops: For displaying prices and preparing bills, keeping track of inventory and fast •
moving goods.
Info Info
DBMS tools and software
Database Applications
Moz: Now look at the following table which belongs to a school database. Note the technical terms
that are used for each part of the table.
class_8_student_info
Student_id Name Date of birth
12 Sweta S 23/01/97
34 T ejas 14/12/96
23 Jy oti 15/08/96
45 Gurmeet 25/03/97
67 Ali 01/01/97
195 Sw eta G 16/11/96
Moz: Let us extract information from these two tables we have seen so far. How will you query the
database to find names of students who scored 70 and above marks in English?
Jy oti: First find the roll numbers of students who scored 70 or more marks in English from the
class_8_marks table. Then find their names from class_8_student_info table and display the list of
these names.
Students who scored more than 70 and above marks in English.
Moz: Here is another table showing the class and marks.
class_8_marks
Student_id English Maths Science Social studies Second language (SL) Marks (SL)
34 70 76 63 54 French 89
23 58 92 78 65 Hindi 65
67 80 98 87 76 French 70
195 51 78 56 67 Marathi 73
45 48 52 65 56 French 62
12 73 88 75 77 Hindi 78
T ejas
Ali
Sweta S
Each row of a table is called a record.
Headings of columns in a table are called the field names.
Each cell in a table is called the field and contains one item of data in the record.
The unique column which uniquely identifies a record is called the primary key.
Info
Technical terms used for each component of a table in the database.
Student_id Name Date of birth
12 Sweta S 23/01/97
Student_id Name Date of birth
12 Sweta S 23/01/97
Student_id Name Date of birth
12 Sweta S 23/01/97
Concept
Step 3: Specify Primary key
Primary key
A primary key uniquely identifies a record. •
A primary key does not allow duplicate values. •
Record
Field name
Cell
Primary key
Student_id Name Date of birth
12 Sweta S 23/01/97
Concept
Query
Extraction of information
A “query” is a special view of a table corresponding to some desired information to be
extrated. A query can display chosen records or chosen fields within records. A query can
apply to one table or to multiple tables, if they are linked by common data fields.
Page 4
Moz: How will you extract the data that you require?
Jy oti: Based on the room occupancy details, w e can find if rooms are av ailable for our dates.
Moz: Yes, this process is called information extraction. It is also called querying the database. A
Database Management System provides the software programs and tools to control the creation,
maintenance and use of a database.
Introduction to Database and DBMS
9
A database is a collection of data that is organized for easy access, retrieval and management
of its contents. A database has one or more related tables of data. The data can be any
format like text, numeric, images, audio, and video.
Concept
Database
Informaton
Aim: In this lesson, you will learn:
- Database, tables, queries.
- Using DBMS tools and softw are.
- Applications of database.
Jy oti: W e are going to Kulu Manali for the holidays. W e are looking at the v arious places that w e can
visit and which hotel has vacant rooms.
T ejas: It is interesting to know that the w ebsite provides room v acancy details along with dates. This
information is also updated regularly!
Moz: Yes. A database is used to store such data and a database management system is used to
retrieve information.
Jy oti: How is the data stored in the database?
Moz: Data is stored in tables. These tables are organized in such a way that information required can
be easily retrieved. For example, consider a hotel in Kulu Manali. You want to stay in this hotel. What
is the information required by you to book a room in this hotel?
T ejas: Room’ s v acancy status for some particular dates.
Moz: What data would be required to find room vacancy information?
Jy oti: W e w ould need data on: (1) Rooms in the hotel and their details, (2) Room occupancy details.
Moz: Right. You have defined two tables for a hotel database, one where room details are stored and
the other where the room occupancy details are stored.
Information
Information about
the rooms available
T ejas: What does control mean here?
Moz: In the hotel reservation database, room occupancy is entered by the hotel management.
The management does not want anyone to access these tables and modify the data. So, they may
restrict view of these data to selected users. There are inbuilt procedures in DBMS which make sure
that such requirements are met. This is control of a database.
Moz: Where else do you think DBMS are used?
Jy oti: Railw ay and airline ticket booking.
T ejas: In our school to maintain the records of students, library .
Moz: Yes. Databases are used in many online applications.
Database management system (DBMS) is a software package that provides software
programs to control the creation, maintenance and use of a database.
Concept
Database management system (DBMS)
The software programs in a DBMS provide tools and software programs as follows:
Create and maintain users of database and database administrators. •
Define and create the tables. •
Enter, update and maintain data. •
Retrieve information and reporting tools. •
Some popula r DBMS packages are: Oracle, Microsoft Access, MySQL, PostgreSQL, Open
Office database.
Example of applications where database is used are:
Railway and Airline: For schedules and reservation. •
Banking: For customer information, accounts, loans, transactions like deposits and •
withdrawal of money.
Universities and schools: Student and teacher information, issue of books in library, •
office for financial transactions like student fee collection and salary of teachers.
Telecommunication: For keeping track of number of calls made and preparing bills. •
Shops: For displaying prices and preparing bills, keeping track of inventory and fast •
moving goods.
Info Info
DBMS tools and software
Database Applications
Moz: Now look at the following table which belongs to a school database. Note the technical terms
that are used for each part of the table.
class_8_student_info
Student_id Name Date of birth
12 Sweta S 23/01/97
34 T ejas 14/12/96
23 Jy oti 15/08/96
45 Gurmeet 25/03/97
67 Ali 01/01/97
195 Sw eta G 16/11/96
Moz: Let us extract information from these two tables we have seen so far. How will you query the
database to find names of students who scored 70 and above marks in English?
Jy oti: First find the roll numbers of students who scored 70 or more marks in English from the
class_8_marks table. Then find their names from class_8_student_info table and display the list of
these names.
Students who scored more than 70 and above marks in English.
Moz: Here is another table showing the class and marks.
class_8_marks
Student_id English Maths Science Social studies Second language (SL) Marks (SL)
34 70 76 63 54 French 89
23 58 92 78 65 Hindi 65
67 80 98 87 76 French 70
195 51 78 56 67 Marathi 73
45 48 52 65 56 French 62
12 73 88 75 77 Hindi 78
T ejas
Ali
Sweta S
Each row of a table is called a record.
Headings of columns in a table are called the field names.
Each cell in a table is called the field and contains one item of data in the record.
The unique column which uniquely identifies a record is called the primary key.
Info
Technical terms used for each component of a table in the database.
Student_id Name Date of birth
12 Sweta S 23/01/97
Student_id Name Date of birth
12 Sweta S 23/01/97
Student_id Name Date of birth
12 Sweta S 23/01/97
Concept
Step 3: Specify Primary key
Primary key
A primary key uniquely identifies a record. •
A primary key does not allow duplicate values. •
Record
Field name
Cell
Primary key
Student_id Name Date of birth
12 Sweta S 23/01/97
Concept
Query
Extraction of information
A “query” is a special view of a table corresponding to some desired information to be
extrated. A query can display chosen records or chosen fields within records. A query can
apply to one table or to multiple tables, if they are linked by common data fields.
Moz: Good. How do y ou find the av erage age of students in the class?
T ejas: W e can find the age from the date of birth of students in the student_info table and calculate the
average age. Here we are using only one table.
Moz: Right. This is how database querying works. Let us do this practically using a database application
provided by Openoffice. Let us take the example of your school data to understand database creation
and information extraction.
Start Open office database: Openoffice OpenOffice.org database i.
The Database Wizard helps you to create a database file and to register a new database within ii.
OpenOffice.org.
Creation of a database
Skill
Step 1: Creating a new database.
Select Create a new database and
click on next.
Step 2: Registering a database.
Save and proceed with default settings and
click Finish.
2
Step 3: Naming a database.
Give an appropriate name (ex: cm8_db) to the database and click on Save.
3
1
Creation of a table
Open the database file (cm8.odb). Click the Tables icon. Choose Create Table in Design View to i.
create a new table.
Using this option you can create tables by defining the fields of the table required ii.
by your application.
Page 5
Moz: How will you extract the data that you require?
Jy oti: Based on the room occupancy details, w e can find if rooms are av ailable for our dates.
Moz: Yes, this process is called information extraction. It is also called querying the database. A
Database Management System provides the software programs and tools to control the creation,
maintenance and use of a database.
Introduction to Database and DBMS
9
A database is a collection of data that is organized for easy access, retrieval and management
of its contents. A database has one or more related tables of data. The data can be any
format like text, numeric, images, audio, and video.
Concept
Database
Informaton
Aim: In this lesson, you will learn:
- Database, tables, queries.
- Using DBMS tools and softw are.
- Applications of database.
Jy oti: W e are going to Kulu Manali for the holidays. W e are looking at the v arious places that w e can
visit and which hotel has vacant rooms.
T ejas: It is interesting to know that the w ebsite provides room v acancy details along with dates. This
information is also updated regularly!
Moz: Yes. A database is used to store such data and a database management system is used to
retrieve information.
Jy oti: How is the data stored in the database?
Moz: Data is stored in tables. These tables are organized in such a way that information required can
be easily retrieved. For example, consider a hotel in Kulu Manali. You want to stay in this hotel. What
is the information required by you to book a room in this hotel?
T ejas: Room’ s v acancy status for some particular dates.
Moz: What data would be required to find room vacancy information?
Jy oti: W e w ould need data on: (1) Rooms in the hotel and their details, (2) Room occupancy details.
Moz: Right. You have defined two tables for a hotel database, one where room details are stored and
the other where the room occupancy details are stored.
Information
Information about
the rooms available
T ejas: What does control mean here?
Moz: In the hotel reservation database, room occupancy is entered by the hotel management.
The management does not want anyone to access these tables and modify the data. So, they may
restrict view of these data to selected users. There are inbuilt procedures in DBMS which make sure
that such requirements are met. This is control of a database.
Moz: Where else do you think DBMS are used?
Jy oti: Railw ay and airline ticket booking.
T ejas: In our school to maintain the records of students, library .
Moz: Yes. Databases are used in many online applications.
Database management system (DBMS) is a software package that provides software
programs to control the creation, maintenance and use of a database.
Concept
Database management system (DBMS)
The software programs in a DBMS provide tools and software programs as follows:
Create and maintain users of database and database administrators. •
Define and create the tables. •
Enter, update and maintain data. •
Retrieve information and reporting tools. •
Some popula r DBMS packages are: Oracle, Microsoft Access, MySQL, PostgreSQL, Open
Office database.
Example of applications where database is used are:
Railway and Airline: For schedules and reservation. •
Banking: For customer information, accounts, loans, transactions like deposits and •
withdrawal of money.
Universities and schools: Student and teacher information, issue of books in library, •
office for financial transactions like student fee collection and salary of teachers.
Telecommunication: For keeping track of number of calls made and preparing bills. •
Shops: For displaying prices and preparing bills, keeping track of inventory and fast •
moving goods.
Info Info
DBMS tools and software
Database Applications
Moz: Now look at the following table which belongs to a school database. Note the technical terms
that are used for each part of the table.
class_8_student_info
Student_id Name Date of birth
12 Sweta S 23/01/97
34 T ejas 14/12/96
23 Jy oti 15/08/96
45 Gurmeet 25/03/97
67 Ali 01/01/97
195 Sw eta G 16/11/96
Moz: Let us extract information from these two tables we have seen so far. How will you query the
database to find names of students who scored 70 and above marks in English?
Jy oti: First find the roll numbers of students who scored 70 or more marks in English from the
class_8_marks table. Then find their names from class_8_student_info table and display the list of
these names.
Students who scored more than 70 and above marks in English.
Moz: Here is another table showing the class and marks.
class_8_marks
Student_id English Maths Science Social studies Second language (SL) Marks (SL)
34 70 76 63 54 French 89
23 58 92 78 65 Hindi 65
67 80 98 87 76 French 70
195 51 78 56 67 Marathi 73
45 48 52 65 56 French 62
12 73 88 75 77 Hindi 78
T ejas
Ali
Sweta S
Each row of a table is called a record.
Headings of columns in a table are called the field names.
Each cell in a table is called the field and contains one item of data in the record.
The unique column which uniquely identifies a record is called the primary key.
Info
Technical terms used for each component of a table in the database.
Student_id Name Date of birth
12 Sweta S 23/01/97
Student_id Name Date of birth
12 Sweta S 23/01/97
Student_id Name Date of birth
12 Sweta S 23/01/97
Concept
Step 3: Specify Primary key
Primary key
A primary key uniquely identifies a record. •
A primary key does not allow duplicate values. •
Record
Field name
Cell
Primary key
Student_id Name Date of birth
12 Sweta S 23/01/97
Concept
Query
Extraction of information
A “query” is a special view of a table corresponding to some desired information to be
extrated. A query can display chosen records or chosen fields within records. A query can
apply to one table or to multiple tables, if they are linked by common data fields.
Moz: Good. How do y ou find the av erage age of students in the class?
T ejas: W e can find the age from the date of birth of students in the student_info table and calculate the
average age. Here we are using only one table.
Moz: Right. This is how database querying works. Let us do this practically using a database application
provided by Openoffice. Let us take the example of your school data to understand database creation
and information extraction.
Start Open office database: Openoffice OpenOffice.org database i.
The Database Wizard helps you to create a database file and to register a new database within ii.
OpenOffice.org.
Creation of a database
Skill
Step 1: Creating a new database.
Select Create a new database and
click on next.
Step 2: Registering a database.
Save and proceed with default settings and
click Finish.
2
Step 3: Naming a database.
Give an appropriate name (ex: cm8_db) to the database and click on Save.
3
1
Creation of a table
Open the database file (cm8.odb). Click the Tables icon. Choose Create Table in Design View to i.
create a new table.
Using this option you can create tables by defining the fields of the table required ii.
by your application.
Step 1: Create table using design view.
Step 2: Table field names with datatype
definition:
Enter new fields in rows from top to bottom. •
Click the Field Name cell and enter a field
name for each data field.
In the next cell to the right, define the Field •
Type. When you click in the cell, you can
select a field type in the drop-down menu.
Step 3: Select a primary key:
Step 4: All fields and data types defined
You can enter an optional Description for each field. The text of the description will appear
as a tip on the column headings in the table view.
Step 5: Field properties
Field properties specify the data entry rules.
Help is provided in the right most column.
You can leave as default for now.
Step 6: Give a name to the table and
Save.
Example
Student_id uniquely identifies a student. Right-click the first column, and choose •
Primary Key from the context menu. Note that, to edit the table contents a primary key has
to be specified.
Specify Primary key
Skill
1
2
3
4
1
2
3
5
6
See Example below. •
Read More