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

DATABASE X

Uploaded by

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

DATABASE X

Uploaded by

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

A S E E M

A B Y S T
T
DA ENT S
G E M
N A
M A
Session 1: APPRECIATE THE CONCEPT OF
DATABASE MANAGEMENT SYSTEM.
Database: A Database is an organized collection of data, it
can be visualized as a container of information.

Database Management System: DBMS is a software


package with computer programs that control the
creation, maintenance, and use of a database. A database
is a collection of data and DBMS allows different user
application programs to concurrently access the same
database. Examples of DBMS – Oracle, MySQL, FoxPro,
IBM DB2, Microsoft SQL Server, OpenOffice.org Base, and
Microsoft Access.
Organization of Data:
Data can be organized in two ways –
Flat File: Data is stored in a single table.
This is usually suitable for less amount of
data.
Relational: Data is stored in multiples
tables which are linked by a common field.
This is suitable for medium to large
amount of data.
Database Servers:
These are dedicated computer systems
that hold the databases and run only
the DBMS and related software.
Databases are available on database
servers and are usually accessed
through a command line or Graphic
User Interface tools [called Frontend].
Advantages of Database:
1) Reduces Data Redundancy: Database reduces data
redundancy. Database reduces Duplication of data, in
fact, there is no chance to encounter duplicate data in
a database.
2) Sharing of Data: The users of the database can share
the data among themselves.

3) Data Security: Database provides data security as only


authorized users are allowed to access the database
and their identities are authenticated by using a
username and password.

4) Data Integrity: Data integrity means that the data in


the database is accurate and consistent.
5) Privacy: Only authorized users can access a database
according to the database privacy constraints.

6) Backup and Recovery: DBMS automatically takes care of


backup and recovery. In case of a crash or system failure, it
gets restored to its previous condition.
Features of Database:
The database has one or more tables.
Each table has information about one type of item.
Every table in a database has a key field that makes
sure that there are unique values throughout the
database.
Keys in a Database:
1) Primary Key: A primary key is a unique
value that identifies a row in a table. Primary
Key helps the database to quickly search for a
record.
2) Composite Primary Key: When a primary
key constraint is applied on one or more
columns then it is known as Composite
Primary Key.
3) Foreign key: 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.
SESSION-2 : CREATE AND EDIT TABLES USING
WIZARD & SQL COMMANDS
Database Objects:
1) Table: It is a collection of data elements (values).
It consists of vertical columns and horizontal rows
where we put the required information.

2) Columns or Fields or Attributes: It is a set of


data values of a particularly simple type, one for each
row of the table.

3) Rows or Records or Tuples: It represents a


single data item in a table. Every row in the table has
the same structure.
Data Types: These are used to identify which
type of data we are going to store in the
database. Data types in the OpenOffice base
are broadly classified into five categories.
Numeric Types
Alphanumeric Types
Binary Types
Date time
Other Variable types
number, door number, etc.
Alphanumeric Types: Used to store
information that has alphabets as well
as numbers for example address, book
summary field, etc.
Binary Types: Used for storing data in
binary formats. This can be used for
storing photos, music files, etc.
DATE TIME: Used for storing
information such as date of birth, date
of admission, date of product sale, etc.
SESSION 3: PERFORM OPERATIONS ON TABLE
In the OpenOffice Base, we store data in tables that can be
inserted, modified, and removed using suitable options.
Inserting Data In The Table:
Steps to insert data in a table –
1) Select the table, Double click on it.
2) The table will open in Datasheet View.
3) Insert the required number of records in Datasheet
View.
Editing Records In The Table:
Steps to Edit Records in the table –
1) Select the table, Double click on it.
2) The table will open in Datasheet View.
3) Edit the required record in Datasheet View.
Deleting Records From The Table
Steps to remove data from the table –
1) Select the table, Double click on it.
2) The table will open in Datasheet View.
3) Select the data > right click on selected data >
select the Delete option
Field Properties :
Steps to set field properties –
Select the table > Right-click > Select the option Edit > the table will
open in Design View.
There are various properties of fields according to the data type set
for each field in the design view.
The properties of numeric type data are given below :
1) AutoValue – if set to yes then the field will get the auto numeric
values.
2) AutoValue – if set to no then the field will not get the auto numeric
values.
3) Length – By default length of the field is 10 but the size of the field
can be set to maximum length.
4) Default Value – A default value can be set for a field if the user
doesn’t provide any value while entering the values in the table.
5) Format – This property helps to set the format of the data entered
in the field such as 91-222-333
The properties of character type data are shown below :
1) Entry Required – if set to yes then it will be a must to
insert the value in the field.
2) Length – By default length of the field is 10 but the size
of the field can be set to maximum length.
3) Default Value – A default value can be set for a field if
the user doesn’t provide any value while entering the
values in the table.
4) Format – This property helps to set the format of the
data entered in the field such as 91-222-333.
Sorting Data :
Sorting means arranging the data in either ascending order
or descending order.
Referential Integrity :
Referential integrity is used to maintain the accuracy
and consistency of data in a relationship. In
OpenOffice Base, data can be linked between two or
more tables with the help of primary key and foreign
key
Referential integrity helps to avoid:
1) Adding records to a related table if there is no
associated record available in the primary key table.
2) Changing values in a primary if any dependent
records are present in the associated table(s).
3) Deleting records from a primary key table if there
are any matching related records available in the
associated table(s).
Creating and Editing Relationships between Tables :
A relationship refers to an association or connection
between two or more tables. Relationships between tables
help 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 the Relationships option from the Tools menu.
There are three types of relationships that can be
created in tables:
1) ONE to ONE Relationship: In this relationship,
both the tables must have primary key columns.
2) One to Many Relationship: In this relationship,
one of the tables must have a primary key column.
3) Many to Many Relationship: In this relationship,
no tables have the primary key column.
Remove the Relationships
The relationships applied on the tables can be
removed also with the help of the Delete option.
Right, Click on the relationship thread and select
the Delete option.
SESSION 4: RETRIEVE DATA USING QUER
Queries are commands that are used to
define the data structure and also to
manipulate the data in the database. A query
helps us join information from different tables
and filter that information
There are two types of languages:-
DDL (Data Definition Language)
DML (Data Manipulation Language)
Common DDL Statements are:-
Create :- This statement is used to create database or
tables.
Alter :- This statement is used to modify structure of table.
Drop :- This statement is used to delete database objects.
Common DML Statements are:-
SELECT :- This statement is used to retrieves information
from the database.
INSERT :- This statement is used to insert new record into
the database.
DELETE :- This statement is used for deletion of information
in the database.
UPDATE :- This statement is used for modification of
information in the database
Select Statement :
A SELECT statement retrieves zero or more rows from one or
more tables. SELECT is the most commonly used Data
Manipulation Language(DML) command. To retrieve all the
columns in a table the syntax is SELECT * FROM <Table Name>;
For example, if you want to display all the data from table emp
(short form of employee), the command is
Select * from emp;
The SELECT statement has many optional clauses:
WHERE specifies which rows to retrieve.
ORDER BY specifies an order in which to return the rows.
for example Select * from emp where name = “Neha”;
The above query will show the result of a particular employee named
“Neha”.
Select * from emp order by Salary;
The above query will show all the records of table emp according to
ascending order of column Salary.
Performing calculations :
In Base, simple calculations can be done on the data using
arithmetic operators. Example:
1) To display the salary of all the employees after incrementing by
1000 then the following SQL command will be executed in
Base. (Fields of table Employee are EmployeeID, FirstName, Salary)
Select “EmployeeID”, “FirstName”, “Salary” +1000 from
“Employee”;
2) To display the salary of all the employees after decreasing
by 10000 then the SQL command will be:
Select “EmployeeID”, “FirstName”, “Salary” – 10000 from
“Employee”;
3) To display the salary of all the employees after
incrementing it as twice the amount of present salary, then
the SQL command will be.
Select “EmployeeID”, “FirstName”, “Salary” * 2 from
“Employee”
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 [WHERE <Condition>];
for example :
1) To increase(update) the salary of employee
“Neha” by Rs 2000 (in table Employee)then the
SQL command will be:
Update Employee set Salary = Salary + 2000
Where FirstName = “Neha”;
SESSION 5: CREATE FORMS AND REPORTS USING WIZARD
FORM: A form provides the user with a systematic way of storing
information in the database. It is an interface in a user-specified
layout that lets users view, enter, and change data directly in database
objects such as tables.
Creating Form Using Wizard: Steps To Create Form Using Wizard
are :
1) Click Use Wizard to Create Form option under Tasks group. The
Form Wizard dialog box appears.
2) Select selective fields to be sent onto the form by selecting the
field name and clicking the > button and clicking Next.
3) Select the option Add Subform if you need to insert the contents in
the table in a separate form and click Next.
4) Arrange selected fields in a form and click Next.
5) Select the data entry mode and click Next.
6) Specify the styles to be used in the form and click Next.
7) Specify the name of the form. Click Finish.
REPORT: A report helps to display the data in a summarized
manner. It is used to generate the overall work outcome in a
clear format.
Creating Reports using the wizard: Steps To Create Report
Using Wizard are :
1) Click on Use Wizard to Create Report… option available
under Tasks.
2) Select all the table fields by selecting the >> button.
3) Redefine the label of the fields in the reports or else you
can set the default name and click Next.
4) Define grouping for the fields of the table if required and
click Next
5) Sort the field in the report by selecting the appropriate
field name and sorting method(if required) and click Next.
6) Select the layout of the report and click Next.
7) Define a name for the report and click Finish.
OU
K Y
A N
TH

You might also like