0% found this document useful (0 votes)
24 views37 pages

10 It Database Managementsystem Notes01-Combined

Uploaded by

sshinde8447
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)
24 views37 pages

10 It Database Managementsystem Notes01-Combined

Uploaded by

sshinde8447
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/ 37

myCBSEguide

CBSE Class–10 Information Technology


Revision Notes
Database Management System
Concept Of Database Management System

Relevant Knowledge
A database is an organized collection of data. You can visualize it as a container of information.
The data is typically organized to model relevant aspects of reality (for example, the availability of rooms in
hotels), in a way that supports processes requiring this information (for example, finding a hotel with facilities
such as Laundry, GYM etc…).
Suppose if you own a stationary shop, you need to keep detailed records of the materials available in your shop.
You also need to store information about pricing, stock levels for reordering, old stocks, etc. While in the
manual system, you would maintain several files with different bits of information; in the computerized system
you would use database programs such as Microsoft Access, OpenOffice.org Base, and MySQL, to organize the
data as per your business need. The database concept has evolved since the 1960s to ease increasing difficulties
in designing, building, and maintaining complex information systems (typically with many concurrent end-
users, and with a large amount of diverse data). In this lesson, you will learn database concepts and to work
with a Database Management System (DBMS).
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

Database Management System


A database management system is a software package with computer programs that controls the creation,
maintenance, and use of a database. It allows organizations to conveniently develop databases for various
applications. A database is an integrated collection of data records, files, and other objects. A DBMS allows
different user application programs to concurrently access the same database. Well known DBMSs include
Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL, FoxPro, and SQLite.
Data can be organized into two types:

Flat File: Data is stored in a single table. Usually suitable for less amount of data.
Relational: Data is stored in multiple tables and the tables are linked using a common field. Relational
is suitable for medium to large amount of data.

Database Servers
Database servers are dedicated computers that hold the actual databases and run only the DBMS and related
software. Typically databases available on the database servers are accessed through command line or graphic
user interface tools referred to as Frontends; database servers are referred to as Back-ends. Such type of data
access is referred to as a client-server model.

Advantages of Database

Reduces Data Redundancy


The database management systems contain multiple files that are to be stored in many different
locations in a system or even across multiple systems. Because of this, there were sometimes multiple
copies of the same file which lead to data redundancy.
This is prevented in a database as there is a single database and any change in it is reflected
immediately. Because of this, there is no chance of encountering duplicate data.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/4


myCBSEguide

Sharing of Data
In a database, the users of the database can share the data among themselves. There are various levels
of authorisation to access the data, and consequently the data can only be shared based with the
authorized users.
Many remote users can also access the database simultaneously and share the data between
themselves.
Data Integrity
Data integrity means that the data is accurate and consistent in the database. Data Integrity is very
important as there are multiple databases in a DBMS. All of these databases contain data that is visible
to multiple users. So it is necessary to ensure that the data is correct and consistent in all the databases
and for all the users.
Data Security
Data Security is an important concept in a database. Only authorised users should be allowed to access
the database and their identity should be authenticated using a username and password. Unauthorised
users should not be allowed to access the database under any circumstances as it violates the integrity
constraints.
Privacy
The privacy rule in a database states that only the authorized users can access a database according to
its privacy constraints. To secure data levels are set in the database and a user can only view the data
which is allowed to be seen. For example - In social networking sites, access constraints are different
for different accounts a user may want to access.
Backup and Recovery
Database Management System automatically takes care of backup and recovery. The users don't need
to backup data periodically because this is taken care of by the DBMS. Moreover, it also restores the
database after a crash or system failure to its previous condition.
Data Consistency
Data consistency is ensured in a database because there is no data redundancy. Data Consistency
means there should be multiple mismatching copies of the same data. All data appears consistently
across the database and must be same for all the users viewing the database. Moreover, any changes
made to the database are immediately reflected to all the users and there is no data inconsistency.

Features of Database
Let’s look at the example of your address book. What do you store in an address book? You may have people’s
name, address, phone number and maybe even their birthdays. There is a common element here – people. In
this example, each person is considered an “ITEM”.
So, database will store information about that person. When you were recording information in your address
book, what did you ask the people? What is your address? What is your phone number? etc. Each question that
we ask about our ITEM is a “field”. Now, say you make new friends and want to add their information to your
address book. You will ask questions, get the answers and create a new “record”. So, a record is a set of
information (made up of fields) stored in your database about one of the items. A “value” is the actual text or
numerical amount or date that you put in while adding information to your database. When you put all the
information together in a grid (like you do in a spreadsheet), a collection of similar records creates a table.
There are some key features of a database:

1. A database can have one or many tables. An address book example is a very simple one, in real world there
are many more details involved. A big company would have in its database, one table for its products, one
table for its suppliers, one table for its customer details, one for orders received and maybe many others.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/4


myCBSEguide

2. Each table in a database contains information about one type of item. So, a database is a container that
holds tables and other objects and manages how they can be used.
3. Another very important thing to remember is that when we put in information, we may have people with
the same name (there can be more than one Charu Arora) or the same address (members of a family). But
when creating a database an important feature is record uniqueness in every table. it is important to be
able to distinguish between different items having duplicate values.
Uniqueness helps to avoid accidental duplication of records caused by user or computer error. This can be
achieved by using some number or value that uniquely identifies a record. If such a unique value does not
exist in your fields, as the database designer, you can create a special additional field in a table where
unique numbers or values can be assigned for each new entry. Therefore, every table has a key field which
ensures that there are 100% unique values throughout the database.
4. Every database table should have one or more fields designated as key. You can assign a unique value to
this key for differentiating records that may have similar names or addresses.

Look at the following example of student database:

Name Standard Section

Ram X A

Ravi X A

Ravi X A

Sanjay X B

In this table, it will be extremely difficult to differentiate between student records as they have names that are
similar. To differentiate, you can add additional field - roll number - that will be unique for each record
(example below).

Roll no Name Standard Section

19 Ram X A

20 Ravi X A

21 Ravi X A

22 Sanjay X B

EXAMPLE OF RDBMS
You had used the example of an address book in the previous section. An address book uses only one table. But
look at a different situation. If you are a dealer selling a single type of item and want to record details of your
sales in the past month and also want the details of the client who purchased the item (name, address, phone,
date purchased, number of items bought etc), what would you do?
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.
You create a table Sales with all the details:

OrderID Customer Name Customer Address Phone Sale Date #ItemsBought

000789 Sheela Arora xxxxxNoida 2444490 01/11/12 3

000790 Vaibhav Mittal xxxxGhaziabad 2443358 01/11/12 4

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/4


myCBSEguide

000791 Saurabh Tayal xxxxNew Delhi 2678945 01/11/12 12

000792 Vaibhav Mittal xxxxGhaziabad 2443258 02/11/12 23

000793 Prashant Singh xxxxRohtak 6784534 02/11/12 4

000794 Shila Arora xxxxxNoida 2444490 03/11/12 18

000795 Vaibhav Mittal xxxxGhaziabad 2443258 03/11/12 45

Do you see a problem here? Every time you sell an item to Sheela or Vaibhav or any other customer (client) you
need to store the details again. So, what is the solution? Create one table for client details and another for sale
details. Since each record has to be unique, you can insert a ClientID field to uniquely identify each client in the
client table. In the Sales table, you would give a point of reference which “points” to a particular record in the
Client table.
In the example here, the field ClientID occurs once in the Client table, but since one client can place many
orders, it occurs a number of times in the Sales table. Since we cannot have an order without a customer, we
call Client the parent and Sales the child table. Related tables like these share a common field. You store data
about people once, but refer to those people many times in the database.
When data is to be stored, maintained, and retrieved from multiple tables then special database software are
required known as Relational Database Management System. In the RDBMS data can be integrated using keys.
These are Primary Key, Composite Primary Key, and Foreign Key.
This unique field is called the Primary Key (PK). A primary key is a unique value that identifies a row in a
table. In our example, ClientID is the primary key in the Client table. Primary Keys are also indexed in the
database, making it faster for the database to search for a record. When primary key constraint is applied on
one or more columns then it is known as Composite Primary Key.
The referred field ClientID which occurs in the Sales table is called the Foreign key (FK). Hence, the foreign key
identifies a column or set of columns in one (referencing) table that refers to a column or set of columns in
another (referenced) table. The “one” side of a relation is always the parent, and provides the PK attributes to
be copied. The “many” side of a relation is always the child, into which the FK attributes are copied. Memorize
it: one, parent, PK; many, child, FK.

Another point to remember is that the end users will/may never have direct access to the database. They can
only see what you permit them to and can select only from the options you give them.

RDBMS
A relational database is a type of database. It uses a structure that allows us to identify and access data in
relation to another piece of data in the database. Often, data in a relational database is organized into tables.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/4


myCBSEguide

CBSE Class–10 Information Technology


Revision Notes
Database Management System
Tables Using Wizard & SQL Commands

Relevant Knowledge
Data in a relational database management system (RDBMS) is organized in the form of tables.
You will now quickly recap what you learnt in the last session and assimilate more concepts.

RDBMS
A relational database is a collective set of multiple data sets organized by tables, records and columns.
Relational database establish a well-defined relationship between database tables. Tables communicate and
share information, which facilitates data searcheability, organization and reporting. A Relational database use
Structured Query Language (SQL), which is a standard user application that provides an easy programming
interface for database interaction.
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

DATABASE OBJECTS
Tables: A table is a set of data elements (values) that is organized using a model of vertical columns(which are
identified by their name) and horizontal rows. A table has a defined number of columns, but can have any
number of rows. Each row is identified by the values appearing in a particular column identified as a unique
key index or the key field.

Columns or Fields or Attributes: A column is a set of data values of a particular simple type, one for each row
of the table. The columns provide the structure according to which the rows are composed. For example,
cFirstName, or cLastName are fields in a row.

Rows or Records or Tuples: A row also called a Record or Tuple represents a single, data item in a table. In
simple terms, a database table can be visualized as consisting of rows and columns or fields. Each row in a table
represents a set of related data, and every row in the table has the same structure.

CREATING DATABASE USING OPENOFFICE


There are a variety of DBMS/RDBMS available; in this exercise, you will learn about OpenOffice Base an Open
Source RDBMS.

To open OpenOffice, click Start > Programs > OpenOffice.org 4 > OpenOffice.org.
Alternatively, you can also double-click on the OpenOffice.org 4 shortcut on the desktop if available.
You should see a Window similar to the one displayed below

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1 / 11


myCBSEguide

Select the option database to open the base application. You can also directly open the OpenOffice Base
Application by doing the following:
Click Start>Programs>OpenOffice.org 4>OpenOffice.org Base.
You should be guided through the Database Wizard for creating a database.
You will see a dialog box similar to the one displayed below.

You can create a new database by selecting the option Create a new database. You can also
open an existing database file that you have already created by selecting the option Open an
existing database file. Click Next.
A dialog box similar to the one displayed below appears.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2 / 11


myCBSEguide

Click Finish. The Save As dialog box appears as shown below. Specify a name for the database
in the File name: field and click Save. A window similar to the one displayed below.
Click Finish. The Save As dialog box appears as shown below.

Specify a name for the database in the File name: field and click Save. A window similar to the
one displayed below.

Now that you have created a database, you can work with the database as outlined in the next
few sessions.

Steps To Create A Table Using Table Wizard


Tables are the basic building blocks of a database. You store the data in the database in the form of tables. In

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3 / 11


myCBSEguide

the previous exercise you have learnt how to create database objects in OpenOffice.
In this exercise you will learn how to create a table in a database.
After creating the database, you see a window as shown below.
There are different ways to create a table:

1. Create table in Design View


2. Use Wizard to Create Table

Use Wizard To Create Table:


A table can be created using the predefined steps and table structure(s) in Base. The following are the steps to
create a table:
Click on Tables > Use Wizard to Create Table, the window shown below will open

Click the Select Fields > Choose Category > Select the table (in the picture shown below “Business” category and
“Customer” table has been chosen) > Click on Next Button.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4 / 11


myCBSEguide

Select the fields as per the requirements and select on buttons to add the predefined columns or select

to remove the fields from the Selected Fields Box. After selecting the fields click on Next Button.

Once the fields will be selected the window to set the data types will open, By default all the fields will have
Text[VARCHAR] data type which can be and other properties with default values but all of them can be selected
as per the requirement.
Click on Next Button

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5 / 11


myCBSEguide

After setting the properties of the fields such as field name, type etc. The window to set the primary will open.
Base automatically adds the column to be set as Primary Key which will help the user to enter the unique
values and helps in creating the relationship with the other table to extract the data from multiple tables.
After setting the Primary Key click on Next Button.

When the Primary Key will be set then window to rename the table will open. A user can either go ahead with
the same table name or can change it.
In the same window options to work with the table will be given as:

The option to insert the data immediately will be selected by default . Click on Finish to insert the data in the
table.

To insert the data the following window open:

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6 / 11


myCBSEguide

Creating table using Design View

1. Click on Create Table in Design View… option available under Tasks and a Table Design window appears as
shown below.

Specify the field name and data type of the field to be created by selecting the appropriate type available
under Field type dropdown list.
Now create a table with the following fields displayed below:
Specify the field name and the data type for each field name. For example, the table contains the Name
field and the data type of the Name is TEXT [VARCHAR]. You can specify the length of the field value.
Field Name Data type Length

Name VARCHAR 50

Rollno TINYINT 3

DOB Date DD/MM/YY

Class Char 1

Phone INTEGER 10

Email VARCHAR 75

Colour VARCHAR 15

Location VARCHAR 30

After specifying the field name and data type for the field variables, save the table by clicking on File>Save
shown below.
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 7 / 11


myCBSEguide

Specify the table name. The default name is Table1. Click OK

A dialog box appears, similar to the one displayed below.

Options to set Primary Key


You are asked to set a primary key for the table you just created. You can select the appropriate option to
set the primary key or leave the table without a primary key. If you click Yes, the application will set the
primary key for the first field created automatically. If you click No, you should see a window similar to the
one displayed below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 8 / 11


myCBSEguide

Notice the table by the name SDetails created and visible under Tables section.

Data Types:
Datatypes are used to identify which type of data (value) we are going to store in the database.
Fields themselves can be of different types depending on the data they contain. Data types in OpenOffice base
are broadly classified into five categories listed below.

Numeric Types
Alphanumeric Types
Binary Types
Date time
Other Variable types

Numeric Types:
Numeric data types are used for describing numeric values for the field used in the table of a database.
Numeric data types in a database can be used for storing information such as mobile number, roll number,
door number, year of school admission, true or false statements, statistical values, etc. The different types of
numeric data types available are listed here.

Name Data type Description

BOOLEAN Yes/No Values as 0 to 1. Example: True or False, Yes or No.

TINYINT Tiny Integer Store integer range between 0 to 255

SMALLINT Small Integer Store integer range between -215 to +215 - 1

INTEGER Integer Store integer range between -231 to +231 - 1

BIGINT Big Integer Range between range between -263 to +263 - 1

NUMERIC Number Maximum precision of e(+/-)231

DECIMAL Decimal Maximum precision of e(+/-)231

REAL Real 2-1074 to (2-2-52)* 21023

FLOAT Float 2-1074 to (2-2-52)* 21023

DOUBLE Double 2-1074 to (2-2-52)* 21023

Alphanumeric Types:

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 9 / 11


myCBSEguide

Data
Name Description
type

Stores up to the max length or number indicated by user. It accepts any UTF 8
LONGVARCHAR Memo
Character.

Stores exactly the length specified by user. Pads with trailing spaces for
CHAR Text(fix)
shorter strings. Accepts any UTF 8 Character.

VARCHAR Text Stores up to the specified length. No padding (Same as long var char)

VARCHAR_IGNORE Stores up the specified length. Comparisons are not case sensitive but stores
Text
CASE capitals as you type them.

Binary Types: Binary data types are used for storing data in binary formats. Binary data types in a database
can be using for storing photos, music files, etc. In general, files of any format can be stored using the binary
data type. The different types of binary data types available are listed here.

Name Data type Description

LONGVARBINARY Image Stores any array of bytes (images, sounds, etc.). No validation required.

BINARY Binary (fix) Stores any array of bytes. No validation required.

VARBINARY Binary Stores any array of bytes. No validation required.

DATE TIME:
Date time data types are used for describing date and time values for the field used in the table of a database.
Date time data types in a database can be used for storing information such as date of birth, date of admission,
date of product sale, etc.
The different types of date time data types available are listed here.

Name Description Format

Date Stores month, day and year information 1/1/99 to 1/1/9999

Time Stores hour, minute and second information Seconds since 1/1/1970

Timestamp Stores date and time information

Other Data Types:

Name Description

Other/Object Stores serialized Java objects â " user application must supply serialization routines

Create the following records:

Name Roll no DOB Class Phone Email Color Location

Ravi Kaul 23 13/08/99 X 123456 [email protected] Blue Delhi

13 15/01/99 X 567889 [email protected] Green Mumbai


Bijendar Dalal

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 10 / 11


myCBSEguide

Radha swami 7 01/02/00 X 234353 [email protected] Orange Gujarat

Vikas Maheswari 32 17/11/98 X 233445 [email protected] Blue Maharashtra

Vimla Rani 14 23/09/99 X 242526 [email protected] Yellow Orissa

Sandhya Reddy 26 19/12/98 X 213141 [email protected] Blue Delhi

To insert values into the table, just double-click the table name, you should see a window similar to the one
displayed below.

Table Data View Dialog Box

Start typing the records in the table with the data provided in the excel sheet and select File > Save Current
record to save data in the table.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 11 / 11


myCBSEguide

CBSE Class–10 Information Technology


Revision Notes
Database Management System
Operations On Table

Relevant Knowledge
In Base, data is stored in tables which can be inserted, modified and removed using appropriate options.
You will now quickly recap what you learnt in the last session and assimilate more concepts.
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

Inserting Data In The Table


To insert the data in the table, follow the steps:
Select the table > Double click on it.

The table will open in Datasheet View in which data new data can be inserted and existing data can be updated
or removed.

Editing Records In The Table

To edit the data either click on edit icon or double on the data in the cell of a table and modifications

can be done.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/7


myCBSEguide

Deleting Records From The Table


To remove the data from the table, follow the steps:
Select the data > right click on selected data > select the Delete option

Field Properties
To change the field properties table structure in design view has to be changed. To set the field properties, steps
will be followed as:
Select the table > Right click > Select the option Edit > the table Design View window will open

In design view there are different properties of fields according to the data type set for each field.
The properties of numeric type data is shown below in the figure.
Like AutoValue – if set to yes then field will get the auto numeric values.
Length – By default length of the field is 10 but the size of the field can be set to maximum length.
Default Value – A default value can be set for a field if user don’t provide any value while entering the values
in the table.
Format example – This property helps to set the format of the data entered in the field such as 91-222-333.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/7


myCBSEguide

The properties of character type data is shown below in the figure.


Entry Required – if set to yes then it will be must to insert the value in the field which means that field cannot
be left blank.
Length – By default length of the field is 10 but the size of the field can be set to maximum length.
Default Value – A default value can be set for a field if user don’t provide any value while entering the values
in the table.
Format example – This property helps to set the format of the data entered in the field such as 91-222-333.

Sorting Data
Sorting means to arrange the data in either ascending order of descending order. Select the column(s) then click
on sort buttons. The data will be displayed accordingly.

Referential Integrity

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/7


myCBSEguide

Referential integrity is used to maintain accuracy and consistency of data in a relationship.


In Base, data can be linked between two or more tables with the help of primary key and foreign key
constraints.

Referential integrity helps to avoid:

Adding records to a related table if there is no associated record available in the primary key table.
Changing values in a primary if any dependent records are present in associated table(s).
Deleting records from a primary key table if there are any matching related records available in
associated table(s).

Creating and Editing Relationships between Tables


A relationship refers to an association or connection between two or more tables. When you relate two tables,
you don't need to enter the same data in separate tables.

Relationships between tables helps to:

Save time as there is no need to enter the same data in separate tables.
Reduce data-entry errors
Summarize data from related tables.

You can create a relationship between any two tables by selecting Relationships… option from the Tools menu.

Add the tables in amongst which you want to create the relationship. Select the tables and click on Add button.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/7


myCBSEguide

There are three types of relationships which can be created in tables:

1. ONE to ONE
2. ONE to MANY OR MANY to ONE
3. MANY to MANY
There are two ways to create the relationships between the tables:
a. Click on Insert option and select New Relation… option in Relation Design window.

Select the options as required:

b. Drag the primary key column from one table and drop it on the key column of another table.

One to One Relationship


In this relationship, both the tables must have primary key columns. Example: In the given tables EMP and
DEPT, EMP_ID in EMP table and DEPT_ID in DEPT table are the primary keys.
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5/7


myCBSEguide

One to Many Relationship


In this relationship, one of the table must have primary key column.
It signifies that one column of primary key table is associated with all the columns of associated table.
Example: In the given tables EMP and DEPT, EMP_ID in EMP table is the primary key.

Many to Many Relationship


In this relationship, no table has the primary key column.
It signifies that all the columns of primary key table are associated with all the columns of associated table.
Example: In the given tables EMP and DEPT, there is no primary key.

Remove the Relationships


The relationships applied on the tables can be removed also with the help of Delete option. Right Click on the
relationship thread and select Delete option.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6/7


myCBSEguide

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 7/7


myCBSEguide

CBSE Class–10 Information Technology


Revision Notes
Database Management System
Data Using Query

Relevant Knowledge
Having created the tables and entering data into them, now you want to extract some information.
That’s when you query the database. As the name suggests, query is to collect specific information from the pool
of data. A query helps us join information from different tables and filter that information. Filtering means
that the query uses criteria you provide to hide some data and present only what you want to see.
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

Query Creation Using Wizard

Click on Finish

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/6


myCBSEguide

Creation Of Query Using Design View


Some RDBMS provide a graphical means to create queries, but most RDBMS do not do so. That’s where you use
SQL (pronounced as “sequel”) or Structured Query Language. Query languages are computer languages used to
make queries into databases and information systems. Queries are commands that are used to define the data
structure and also to manipulate the data in the database.
A SELECT statement retrieves zero or more rows from one or more database tables or database views. In most
applications, SELECT is the most commonly used Data Manipulation Language(DML) command.
The SELECT statement has many optional clauses:

WHERE specifies which rows to retrieve.


ORDER BY specifies an order in which to return the rows.

To retrieve all the columns in a table the syntax is:


SELECT * FROM <TABLENAME>;
In order to execute queries click on the Queries option available on the left side under database section, click
Create Query in SQL View as shown below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/6


myCBSEguide

A window appears similar to the one displayed below.

You can type the query in the above window and execute it by using the F5 function key or by clicking the

icon in the window.

To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.
For example, if you want to display all the data in the table that you created in the early session, then the select
statement will be:
Select * from SDetails;
After executing the select query the output will be shown similar to the one displayed below.

Performing calculations
In Base, simple calculations can be done on the data using arithmetic operators.
Example: To display the salary of all the employees after incrementing by 1000 then the following SQL
command will be executed in Base SQL Design
Select “EmployeeID”, “FirstName”, “Salary” + 1000 from “Employee”

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/6


myCBSEguide

To display the salary of all the employees after decreasing by 10000 then the following SQL command will be
executed in Base SQL Design
Select “EmployeeID”, “FirstName”, “Salary” - 10000 from “Employee”

To display the salary of all the employees after incrementing it as twice the amount of present salary, then the
following SQL command will be executed in Base SQL Design.
Select “EmployeeID”, “FirstName”, “Salary” * 2 from “Employee”

To display half of the salary amount paid to the employees, then the following SQL command will be executed
in Base SQL Design.
Select “EmployeeID”, “FirstName”, “Salary”/2 from “Employee”

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/6


myCBSEguide

Grouping of Data
To display the records containing the same type of values “WHERE” clause can be used with the Select SQL
Command.
To get details about the list of students whose favorite color is blue, you can use:
select * from SDetails where Color=’Blue’;
After executing the select query the output will be shown similar to the one displayed below.

To view records in ascending order of RollNo, from the table the select statement will be: select * from SDetails
order by “Rollno” ASC;

You can add, modify or delete records using the Insert, Update and Delete commands.
To type and execute SQL commands, click on Tools > SQL. A window similar to the one below will be displayed.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5/6


myCBSEguide

You can type the SQL Commands in the Command to execute space and click on Execute.

UPDATE statement
Update statement is used for modifying records in a database. The general syntax of the update statement is as
follows:
UPDATE < table_name>
SET <column_name> = value[,column_name = value ...]
[WHERE <condition>];
To update a record using an update statement, type the following and click Execute.
Update SDetails set Location = ‘Bhubaneswar’ where Rollno = 14;
Execute select query to view the updated table. After execution you should see a window similar to the one
displayed below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6/6


myCBSEguide

CBSE Class–10 Information Technology


Revision Notes
Database Management System
Forms And Reports Using Wizard

Relevant Knowledge
A form provides the user a systematic way of storing information into the database. It is an interface in a user
specified layout that lets users to view, enter, and change data directly in database objects such as tables.
In this session, you will learn to create a form.
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

Creating Form Using Wizard


To create a form, Click on Forms option located under Database section (Figure below).

Steps To Create Form Using Wizard


Click Use Wizard to Create Form… option under Tasks group. The Form Wizard dialog box appears as shown
below.

You can select selective fields to be sent onto the form by selecting the field name and clicking > button. You can

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/9


myCBSEguide

select individual fields in a database or all fields in a database.


To use all the fields in the table in a form, click the >> button.
Notice the fields displayed under Fields in the forms section (Figure below).

Click Next >. You see the Set up a sub form step dialog box of the wizard as shown below

You can select the option Add Subform if you need to insert the contents in the table in a separate form. Click
Next>.
Now you need to arrange selected fields in a form. You can use different styles from the list displayed below:

Once you have selected a style, click Next >


A dialog box appears wherein you can select the data entry model.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/9


myCBSEguide

Click Next >. You should see a dialog box wherein you can specify the styles to be used in the form.
To practice questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams.

Click Next >. You see a dialog box where you can specify the name of the form. Click Finish.

A form window appears. Notice that the records in the table are displayed automatically within the form that
you just created.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/9


myCBSEguide

Options To Enter Data From Forms

You can add new records to the table using the form by clicking the symbol located at the bottom as

shown below.

Once you click the symbol, you will be displayed with a window for creating records (Figure below).

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/9


myCBSEguide

You have learnt to create records using design view in the earlier sessions. You can add records using the form
as displayed below. Type the following data in the textbox provided in the box as shown below:

Name Gautam

Rollno 43

DOB 10/12/99

Class X

Phone 325476

Color Pink

Email [email protected]

Location Assam

To view the saved records, Double-click SDetails (Table name) under Tables section. A window similar to the

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5/9


myCBSEguide

one below will be displayed; notice the record that you created using a form is also displayed along with other
records (Figure below).

Now enter three more records using the form and view them using the above mentioned procedure.

Reports
A report helps to display the data in a summarized manner. It is used to generate the overall work outcome in a
clear format. You can create reports in the database.

Concept Of Reports In Base


The reports can be created using Openoffice Base.

Creating Reports using wizard


Reports helps to get the summarized data. To create reports in Base, the table must be selected from using
which data can be displayed in a format as required.

The steps to create followed are:

Click on Reports section under Database in the OpenOffice base application.


Once you select the option, you should see a window similar to the one displayed below.

Now we can generate the report for the table created earlier.
Click on Use Wizard to Create Report… option available under Tasks.
Once you select the Use Wizard to Create Report… option.
You should see a window similar to one displayed below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6/9


myCBSEguide

You have to select all the table fields by selecting the >> button, once you click the button >> you should see a
dialog box similar to the one displayed below.

Once you click Next>.you should see a dialog box similar to the one displayed below.

You can redefine the label of the fields in the reports or else you can set the default name. Once you click Next
>, you should see a dialog box similar to the one displayed below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 7/9


myCBSEguide

You can define grouping for the fields of the table.


Once you click Next >, you should see a dialog box similar to the one displayed below.

You can sort the field variables in the report by selecting the appropriate field and sorting method.
Once you click Next >, you should see a dialog box similar to the one displayed below.

You can select the layout of the report by selecting the appropriate option available under the Layout of data
down list and you can also select the orientation of the report.
Once you click Next >, you should see a dialog box similar to the one displayed below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 8/9


myCBSEguide

You can define a name for the report or you can use the name of the table itself for the report also.
Click Finish.
Once you click Finish you should see a window similar to the one displayed below with the report.

Now create a report containing only Name, RollNo and Phone details. Use different layouts for the report
design.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 9/9

You might also like