0% found this document useful (0 votes)
10 views41 pages

DBMS Notes

The document provides an overview of Database Management Systems (DBMS) and their functionalities, including data organization, advantages, and features. It explains the structure of databases, types of data, and how to create and manage tables using OpenOffice Base. Additionally, it covers key concepts such as primary and foreign keys, data integrity, and operations like inserting, editing, and deleting records.

Uploaded by

yashmaurya2067
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)
10 views41 pages

DBMS Notes

The document provides an overview of Database Management Systems (DBMS) and their functionalities, including data organization, advantages, and features. It explains the structure of databases, types of data, and how to create and manage tables using OpenOffice Base. Additionally, it covers key concepts such as primary and foreign keys, data integrity, and operations like inserting, editing, and deleting records.

Uploaded by

yashmaurya2067
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

Session – 1

Appreciate the
Concept of Database
Management System
Base
103

➜ It is a DBMS software provided by apache


openoffice.
➜ It is used for creating and managing databases.
➜ Its file extension is .odb
104
Database
➜ 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).
105
DBMS
➜ 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.
➜ Examples- Oracle, IBM DB2, Microsoft SQL Server,
Microsoft Access, PostgreSQL, MySQL, FoxPro, and
SQLite
106

Organisation of Data
➜ 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.
107
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
108

of
Database
109

Reduces Data Redundancy


» There are 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.
110

Sharing of Data
» In a database, the users of the database
can share the data among themselves.
There are various levels of authorization
to access the data, and consequently
the data can only be shared based with
the authorized users.
111

Data Integrity
» Data integrity means that the data is
accurate and consistent in the database.
112

Data Security
» Only authorized users are allowed to
access the database and their identity is
authenticated using a username and
password.
113

Backup & 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.
114

Data Consistency
» 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.
115

Features of Database
› A database can have one or many tables.
› Each table in a database contains information about
one type of item.
› When we put in information, we may have people
with the same name or the same address. But when
creating a database an important feature is record
uniqueness in every table.
› 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.
116
Keys
➜ Primary Key
➜ A primary key is a unique value that identifies a row
in a table. Primary Keys are also indexed in the
database, making it faster for the database to search
for a record.
➜ Composite Primary Key
➜ When primary key constraint is applied on one or
more columns then it is known as Composite Primary
Key.
117
Keys
➜ 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. 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.
Session – 2
Create and Edit
tables using Wizard
and SQL Commands
RDBMS
119

➜ 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 searchability, 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.
120

Database
Objects
121

Tables
» A table is a set of data elements
(values) that is organized using a model
of vertical columns and horizontal rows.
A table has a defined no. of columns,
but can have any no. of rows.
122

Columns / Fields / 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.
123

Rows / Records / 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.
124
Creating Database
➜ Click Start > Programs > [Link] 4 >
[Link] Base.
➜ 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.
➜ Click Finish. The Save As dialog box appears. Specify a
name for the database and click Save.
➜ Database has been created.
125
Creating Table in Design View
➜ Click on Create Table in Design View… option available
under Tasks and a Table Design window appears.
➜ Specify the field name and data type of the field to be
created by selecting the appropriate type available
under Field type dropdown list.
➜ Go to File > Save
126
Creating Table using Wizard
➜ Click on Click on Tables > Use wizard to create table
➜ Select the fields, set datatypes, set primary key, click on
Finish
127

Datatypes
» 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:
» Numeric Types
» Alphanumeric Types
» Binary Types
» Date time
» Other Variable types
128

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.
Name Data Type Description
BOOLEAN Yes/No Values as 0 or 1 Example – Yes or No
TINYINT Tiny Integer Store Integer Range between 0 to 255
129

Alphanumeric Types
» LONGVARCHAR, VARCHAR, CHAR,
VARCHAR_IGNORECASE
130

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.
» Binary Types are - LONGBINARY, BINARY,
VARBINARY
131

Date Time Datatypes


» Binary 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.
132

Date Time Datatypes


» Binary 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.
Name Description Format
Date Stores month, day and year 1/1/99 to 1/1/9999
information
Time Stores hour, minute and second Seconds since 1/1/1970
information
Timestamp Stores date and time information
133

Other Datatypes
Name Description
Other/Object Stores serialized java objects
134

Table Data View Dialog Box


➜ Start typing the records in the table and
select File > Save Current record to save
data in the table.
Session – 3
Perform operations
on Table
136

Inserting Data in Table


» 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
137

Editing Records in 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.
138

Deleting Records in Table


» Select the data > right click on selected
data > select the Delete option
139

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

» 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.
» 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 DD-MM-YYYY.
141
Main Table / Primary Key Table Related Table / Associated Table

RollNo Name Address SrNo RNo Book


1 Akash Mathura 214
2 Anuj Aligarh 215
3 Manish Delhi 216
4 Prashant Gurugram 217
5 Tarun Agra 218
6 Yash Jewar 219

General Details Library Record


Referential Integrity
142

➜ 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.
➜ Deleting records from a primary key table if there are any
matching related records available in associated table.

You might also like