0% found this document useful (0 votes)
37 views29 pages

Database X Full 1

The document provides an overview of databases, including definitions of data, databases, and Database Management Systems (DBMS). It outlines the components of databases, advantages and disadvantages of using them, and explains the differences between flat and relational databases. Additionally, it details the features of OpenOffice BASE, including data types, creating tables, entering data, and performing operations on tables using SQL commands.

Uploaded by

mukundseshasayee
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)
37 views29 pages

Database X Full 1

The document provides an overview of databases, including definitions of data, databases, and Database Management Systems (DBMS). It outlines the components of databases, advantages and disadvantages of using them, and explains the differences between flat and relational databases. Additionally, it details the features of OpenOffice BASE, including data types, creating tables, entering data, and performing operations on tables using SQL commands.

Uploaded by

mukundseshasayee
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/ 29

Data is raw, unorganized facts and entities relevant to the user need to be processed

such as a digital representation of text, numbers, graphical images or sound.

Database: A database is a collection of logically related information/data, which is


available for one or more users organised in a way, so that it can be easily accessed,
managed and updated.
e.g. consider the names, telephone numbers and addresses of the relatives etc.

Database Management System: DBMS is a collection of programs or a


software that enables users to create, maintain database and control all the access to the
database. It is basically a computer based record keeping system that manages a
database effectively and efficiently. Eg. MySQL, INGRES, Open Office BASE,MS
Access etc.
Some basic processes that are supported by a DBMS are as follows:
● Specification of data types, structures and constraints to be considered in an application.
● Storing the data itself into persistent storage.
● Manipulation of the database.
● Querying the database to retrieve desired information.
● Updating the content of the database.

A short list of database applications would include:


● Payroll
● Orders
● Reservation
● Accounting
● Catalogues
● Medical records
How Database Works
1. As shown in diagram below, DBMS works as an interface between the user and the
centralized database. First, a request or a query is forwarded to a DBMS which works (i.e.
a searching process is started on the centralized database) on the received query with the
available data and if the result is obtained, it is forwarded to the user.
2. If the output does not completely fulfill the requirements of the user then a rollback (again
search) is done and again search process is performed until the desired output is obtained.
USER -->

DBMS Software
Application Programs
Components of Database
The major components of database are as follows:

1. Data:
It is raw numbers, characters or facts represented by value. The data acts as a bridge
between the hardware and the software.
2. Software:
It is a set of programs that lies between the stored data and the users of database. It is
used to control and manage the overall computerized database. It uses different types
of software such as MySQL, Oracle etc.
3. Hardware:
It is the physical aspect of computer, which consists of the secondary storage devices
such as magnetic disks, optical discs etc., on which data is stored.
4. Users:
It is the person, who needs information from the database to carry out its primary business
responsibilities.
The various types of users which can access the database system are as follows:

i.) Database Administrator (DBA)


A person, who is responsible for managing or establishing policies for the maintenance and
handling the overall database management system is called DBA.

ii.) Application Programmers


The people, who write application programs in programming languages to interact and
manipulate the database are called application programmers.

iii.) End-user
A person, who interacts with the database system to perform different operations on the
database like inserting, deleting etc., through menus or forms.
Advantages of DataBases
1. Reduce data redundancy Redundancy means ‘duplication of data’.
2. Enforcing data integrity It means that the data contained in the database is
accurate and consistent.
3. Data sharing The data stored in the database can be shared among multiple
users or application programs.
4. Data security The DBMS ensures that the access of database is done only
through an authorized user.
5. Backup and recovery The DBMS provides backup and recovery sub-system that is
responsible to recover data from hardware and software failure
Disadvantages of a Database/DBMS
1. Complexity A database system creates additional complexity and requirements.
2. Database failures If database is corrupted due to power failure or it is corrupted
on the storage media, then our valuable data may be lost or the system will stop
working.

Flat V/S Relational DB- Models of DB


FLAT Database: When all the data is stored in one file/table then such a database is called
Flat Database. Eg. Spreadsheet.

Relational Database: When the data is stored in multiple tables that are linked via common
fields, then such a database is called Relational Database. Eg. MS Access,
BASE,Oracle,MySQL etc.
Open Office BASE
1. Base is a popular RDBMS system that manages data in terms of special tables called
relations.
2. Base is also known as OpenOffice.org BASE or simply OOo BASE.
3. The database file of BASE is stored with extension .odb.
4. Base offers following features to manage the data:
Tables, Queries, Forms, Reports.
Fields/Attributes

R S.No. Name Class Relation


T
e
u
c 1 Nisha 10
p
o
2 l Priti 9
r
e
d Item
s
s
value
Features of BASE RDBMS:
Tables(Relation)
A table is a set of data elements (values) that is organised using a model of vertical columns, which are
identified by their name and horizontal rows.

Field (Data item)/Attributes/column


A Field is a set of data values of a particular type, one for each row of the table.

Record/Row/Tuples
It represents single of data item in a table. Record of a table is also known as row, entity or tuple.

Queries
It allows you to extract information from the database based on the conditions that you define in query.

Forms
In a database, a form is a window or a screen that contains numerous fields or spaces to enter data.

Reports
When you want to print those records which are fetched from your database, design a report.
Key Field
The key is defined as the column or the set of columns of the database table which is used to identify
each record uniquely in a relation, e.g. if a table has id, name and address as the column names then
each one is known as the key for that table. Types of Key Fields:

1. Primary Key
A field or a set of fields that uniquely identify each record in a table is known as a primary key.
Properties:
Primary key must contain unique values. A primary key column cannot have NULL values.

2. Candidate Key
The set of all attributes which can uniquely identify each tuple of a relation are known as candidate
keys. Each table may have one or more candidate keys and one of them will become the primary key

3. Alternate Key
From the set of candidate keys after selecting one of the key as a primary key, all other remaining keys
are known as alternate keys.
Foreign key
A field of a table (relation) that references the primary key of another table is referred to as foreign key and it
is use to link two tables.

Foreign key
RDBMS
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. A Relational database use Structured Query Language (SQL).

Data Types in Open Office

Divided in 5 categories: used for the whole


i. Integer numbers. Like
1,2,3,4,....etc.
1. Numeric Type: Contains
numeric type of value used for decimal
type values like
ii. Decimal/float
1.2,4.345,56.76
etc.
.
used for fixed length
i. Char column.

2. Alphanumeric Type: used for


describing values with used for variable length
alphabets,numbers and special ii. Varchar column.
character.

Stores up to
iii. Long Varchar maximum length
(same as varchar)
i. Date

3. Date time Type: Used for


ii. Time
storing information such date
of birth etc.

iii.Timestamp
To start Base database
i.) Click on start button → All Programs → OpenOffice → OpenOffice Base → Database wizard
window will open → Click on Create a new database → It will open a Base window.

ii.) Click twice on open Office icon → select openoffice base from the window → Database wizard
window will open → Click on Create a new database → It will open a Base window.

Components of a BASE window


● Title Bar: The top most bar that displays the title.
● Menu Bar: Just below the title bar, containing menu options of BASE.
● Toolbar: This is the bar below menu bar. This bar offers various tools to perform standard
functions.
● Database Window: All components of BASE are displayed in a separte sub-window of BASE
window is called DB window.
● Object BUttons: Various buttons to navigate through db objects like Tables,Queries etc.
● Status Bar: This present at the lower left corner of BASE window and reports all the progress of
db processing.
To Create a new Base Database
Two ways to create a new database:
i.) Creating database through table wizard
ii.) Creating database from scratch.
Here, select i.) option. ii) option not in syllabus.

i.) Creating database through table wizard


1. After opening a Base window. → select option Create database through table wizard
and click at finish button → Choose the option create a new database (in case of a
new database creation). Save and continue.
2. Choose the location and name for the database and click at save button.

To open an existing database


After opening a Base window. → Choose the option open an existing database or use
shortcut key Ctrl+O or Click Open icon on the database toolbar → Select the desired
database name from the recently used list and click at finish.
Two ways to create a Table:
i.) Creating tables through table wizard *Removed from Syllabus 2020-21
ii.) Creating tables in design view.

Create table in Design View

1. Select Tables from the left-most pane.


2. Select option Create table in design view.
3. Set the column name in field category, Select relevant data-type and its length/size
using field properties.
4. Set one of the column as primary key.
●For this first select the box, present in front of row(to which we want to make primary
key).
●Right click and select option primary key.
5. Save the table by clicking on save button or using short-cut key Ctrl+S.
6. A dialogue box will open, assign a name to table.
Create table through table wizard and SQL
(*Removed from Syllabus 2020-21)

To create table in table wizard, we’ll use SQL and DDL commands
SQL-Structured Query Language
DDL-Data Definition Language

1. To create table or database “CREATE command will be used”


Syntax:
CREATE TABLE <TABLENAME>(
[COLUMN1 DEFINITIONS,
[COLUMN2 DEFINITIONS,
[COLUMN3 DEFINITIONS]
);
Steps are:
1. Goto Tools Tab → Select SQL → Select create new query
2. A dialogue box will open.
3. Write the create command (as specified in syntax)
Ex. Create table “student10”(
“S.No.” tinyint,
“Name” varchar (20),
“Email” varchar (75),
“Roll no.” tinyint(3) primary key,
“DOB” Date
);
4. A message of successfully command executed will be shown.
5. Ctrl + S to save all changes.
6. Double click on tables in left-most pane and select the created table.
Entering data into a table
1. Click the Tables tab in Database window.
2. To open a table, double click its table name.
3. Click the Insert→ Record command to add a new record or directly double
click on space under each column where we want to enter data.
4. Enter the data in the first field and then press Tab to move to the next field to
enter data.
5. The record saved automatically or we can also press save icon on the toolbar to
save the record.
Perform Operations on Table
To define the structure of the data we use DDL (data definition language) and to manipulate
the data using some commands, we use DML (data manipulation language).

1. Select Command: To retrieve information from database.


2. Insert command: Insertion of new information
3. Delete: To delete an information
4. Update: To modify the existing information in the database.

To edit data in a table, two ways


I. Using Queries
Ii. In design view
Editing data In Design view

1. To insert new data:


i.) After opening the table, click any field in the table to position an insertion point in
the field or Insert→ Record
ii.) Make changes in data or type new data.
iii.) Save the changes.

2. To Delete a record:
i.) Open the table in Datasheet view.
ii.) Select the record by clicking on it or by clicking gray button, present at extreme left
of the record.
iii.) Click Edit → Delete command and record will be deleted. To delete multiple
records, select the records needs to be deleted by holding shift key.
Table: Student10

S.No. Name Email Roll no. DOB

1 varun ds@gmail.com 101 2008-04-04

2 pranjal th@gmail.com 102 2008-05-12

3 Love nh@gmail.com 103 2008-09-03


Editing data using Queries
Goto Tools Tab → Select SQL → Select create new query

1. To insert new Record:“student10” is a table mentioned above on which we


are performing all the operations.
Syntax:
Insert into <”tablename”>(<column name1>, <column name2>,...)values(<value 1>,
<value 2>..);
Or
Insert into <”tablename”> values (“<value 1>, <value 2>..);
Example:
Insert into ”student10” (“Sno.”, “name”, “email”, “Roll
no”,”DOB”)values(“1”,”pooja”,”pooj@gmail.com”, “2”, “1991-10-24”);
Or
Insert into “student10” values (“1”,”pooja”,”pooj@gmail.com”, “2”, “1991-10-24”);
2. To Delete a record:
Syntax:
Delete from <tablename> where <condition>;
Example:
Delete from “student10” where “name”=’varun’;

3. To Update a record:
Syntax:
Update table <tablename>
set<columnnname1>[columnname2,columnname3….]=<newvalue>[newvalue2,newvalu
e3...]
Where <condition>;
Example:
Update table “student10”
Set class = x
Where name=adtitya;
4. To retrieve a record from database:
i. Syntax:
Select * from <tablename>
Example:
Select * from “student10”
Note: Here * represents all columns are selected. We can specify column
name as well which we want to retrieve.

ii. Select command have two clauses with it which are completely optional.
a. Where clause: use to specify a condition to retrieve data from database.
b. Order by clause: use to arrange the records in ascending or descending
order.
Example: Select “name” from “student10” where “class” = ‘x’
Forms
Forms are the objects that are used to get data from user in interactive manner.
Forms provides user friendly interface to enter data and the entered data is stored in the tables of the
database.
Use Wizard to Create Forms

1. Open the database → Select Forms button from the left pane → Click Use wizard to create
Forms.
2. Query Wizard window will open
3. Select the concerned table and Fields to be included in the Form. Click Next.
4. Now it will ask for adding subforms, since we creating simple forms so, will directly select next
button.
5. Choose the arrangement or layout for the form.
6. Next, select if you want to use form for data entry or display purposes.
7. In the next step, select the appearance/look by adopting different styles like color, border
etc.-->click next.
8. Specify name for the form and Click finish.
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. It is a very useful tool for decision-making and analysis.

Use Wizard to Create Report


1. Open the database → Select Reports button from the left pane → Click Use wizard to create
Reports.
2. Query Wizard window will open
3. Select the concerned table and Fields to be included in the report. Click Next.
4. Now set labels for the fields that you are displaying in the report.
5. Specify to group the data on the basis of any field.
6. Next, select sort option, either ascending or descending.
7. In the next step, select the layout for the report → click next.
8. Finally Specify name for the Report and Click finish.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy