Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 38

DATABASE

SESSION - 1
APPRECIATE THE CONCEPT
OF
DATABASE MANAGEMENT SYSTEM
SESSION - 1
 Data and Information
 Database and its advantage
 Relational Database
 Field , Record , Table
 Primary key , foreign key , Composite Primary
key
 Relational Database Management System
 RDBMS SOFTWAREs
DATA AND INFORMATION
Whenever we are working with computers, we are working with data and information. So first
understand about data and information.
Data
Data refers to raw facts, figures and text.
Suppose, you have something like this: 1, Maharshi, 2500, 9898123456
This can be considered as data. Some facts are given in form of numbers and text.
Information
Information refers to the meaningful data.
Suppose, you have something like this table:

No Name Fees ContactNo


1 Maharshi 2500 9898123456
DATABASE
A database is an organized collection of inter related data.

 For example:-
In a stationary shop, detailed records of the materials
available in the shop is database.

 Similarly in a computerized system, we need to maintain


several files, we would used database programs such as
Microsoft Access, OpenOffice.org Base, and MySQL.

 These database programs are used to organize the data


as per our needs in the computer system.
DATABASE MANAGEMENT
 A database management system is a software package with
computer programs that controls the creation, maintenance and
use of a database.

 A DBMS allows different user application programs to


concurrently access the same database.

 Some of the DBMSs are Oracle, IBM DB2, Microsoft


SQL server, Microsoft Access, PostgreSQL, MySQL, FoxPro and
SQLite.
Advantages of Database:
Reduces Data Redundancy : no chance of encountering duplicate
data

Sharing of Data : the users of the database can share the data
among themselves

Data Integrity : Data integrity means that the data is accurate and
consistent in the database

Data Security : Only authorised users are allowed to access the


database and their identity is authenticated using a username and
password
Advantages of Database:
Privacy : The privacy rule in a database states that only the
authorized users can access a database according to its privacy
constraints

Backup and Recovery : Database Management System


automatically takes care of backup and recovery.

Data Consistency : Data Consistency means there should be


multiple mismatching copies of the same data.
DATABASE
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 SERVER
Database servers are dedicated computers that
hold the actual databases and run only the DBMS and
related software. Databases 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 Client-server model.
RDBMS
A relational database management system (RDBMS)
is a database management system that is based on the
relational model. In the relational model of a
database, all data is represented in terms of tuples
(rows), grouped into relations (tables). A database
organized in terms the relational model is a relational
database.
Basic Terminologies:-
Database contains objects that are used for
storing and managing information.
1. Item : - Item is about which information is stored in the
database.
2. Field:- Each question that we ask about our item is a
Field.
3. Record:- Record is about which information is stored in
the database.
Basic Terminologies:-
4. Value:- Value is the actual text or numerical
amount or date that you put in while
adding information to your database.
5. Key Field :- Key Field is a value in a Field that
uniquely identifies the record. Eg. E001 which is
unique to every employee.
Database Concepts:-
Concept of the primary key, foreign key, and
composite key
 Referential integrity can be generated by using the
primary key.
 The database table can have at least one primary key.
This primary key ensures the record’s uniqueness.
 A primary key helps to improve the speed of database
retrieval.
 A primary key is a column of a table that identifies the
unique records.
Concept of the primary key, foreign key, and composite
key
Features of Primary key
• It identifies the rows uniquely
• It cannot be null
• It cannot have a duplicate value
Foreign Key:
This primary key can be used as foreign key in another table that
provides a reference to the table.
The table which is referenced is known as parent table generally
having primary key where as the table which is taking reference is
known as child table having a foreign key.
Difference between Primary and Foreign Key
Composite Primary Key

A composite key is also a primary key, but the


difference is that it is made by the combination of
more than one column to identify the particular row in
the table is called as Composite Key
SESSION-2
CREATE AND EDIT TABLES
USING
WIZARD AND SQL COMMANDS
SESSION - 2
 Introduction to RDBMS
 Creating a Database
 Steps to create a table using wizard
 Datatypes in Base
 Option to set Primary key
 Table Data View dialog box
RDBMS
• RDBMS stands for Relational Database Management
System.
• In Relational Data model ,the data is organized into
Tables( ie.Rows and Columns)
• A relational database uses Structured Query Language
(SQL),which is a standard user application that
provides an easy programming interface for database
interaction.
DATABASE OBJECT

TABLES QUERIES

FORMS REPORTS
Create and Edit tables
Step 1: Click on Start Menu.

Step 2: Find Open Office 4.1.7 and click on it.

Step 3: Now select Open Office Base.

Step 4: The database wizard will open to select or create a database.

If you are opening it first time select create a new database option and
then follow the wizard instructions.
Create and Edit tables
Create and Edit tables
OO Base will open, the interface of OO Base is something like below-given
screenshot:
Create and Edit tables
As the main parts of OO Base window are
highlighted with numbers. They are as following:
1. Database Objects selection window
2. Tasks Window
3. Description Window
4. Database Object window
5. Properties window of selected Database
objects
Create and Edit tables
Database Objects Selection window
This windows allows to select the database objects and you can do work upon.
There are four basic icons available in this window:
Tables Queries Forms Reports
Tasks Window
This window allows selecting the specific tasks as per the selected object from the
database object selection window. Here you will observe different tasks are available for
different objects. But the common task is to create and use wizard.
Create and Edit tables
Description Window
This windows shows the description of the selected task.
Database Object Window
It shows the different database objects created by user.
Properties window
It displays the information of selected object from database
object window.
Create a table
There are 3 ways to create a table in OO Base.
 Create Table in Design view
 Use wizard to create table
 Using SQL command
Prepare a table structure on paper before creating a table in OO Base, Because it
will asks to select a primary key other constraints, so define a primary key and
assign the column otherwise OO base will add one column named ID when you
save the table with your confirmation.

If primary key is not there, OO base won’t allow to insert records in the table.
DATATYPES
Datatypes are used to identify the type of data we are going
to store in the database.
Data types can be broadly classified into five categories:-
1. Numeric Types
2. Alphanumeric Types
3. Binary Types
4. Date Time
5. Other variable Types
DATATYPES
The different types of numeric data types available are-
1. Boolean (Yes / No) 6. Numeric
2. TinyInt (Tiny Integer) 7. Decimal
3. SmallInt (Small Integer) 8. Real
4. Integer 9. Float
5. BigInt (Big Integer) 10. Double

ALPHANUMERIC TYPES:-
The list of different datatypes available in alphanumeric types are :-
1. Long VarChar (Memo) (Long Text)
2. Char (Text-fix) (Small Text)
3. VarChar (Text) (Text of specified Length)
4. VarChar_IgnoreCase (Text) (Comparison's are not case sensitive)
DATATYPES
BINARY TYPES:-
Binary types are used for storing data in binary formats. It can be used for storing photos, music files or (in
general file of any format) etc.
The list of different datatypes available in Binary types are :-
1. LongVarBinary (Image)
2. Binary (Binary (fix) )
3. VarBinary (Binary)
DATE TIME:-
Date time data types are used for describing date and time values for the field used in the
table of a database. It can be used for storing information such as date of birth, date of
admission etc.
The list of different data types available in Date Time type are :-
1. Date (Stores month, day and year information)
2. Time (Store hour , minute and second information)
3. Timestamp (Stores date and time information)
Create table in Design View:
Follow these steps to create a table in design view:
1. Click on Tables –> Create Table in Design View option from the tasks
window.
2. It will open a design to view and allows you to write you table field names
and data types as well as other properties of the field.
3. Type appropriate field names, choose desired field types and type the
description if necessary.
4. Save the table and close the window.
Now once table is created, it will appear in the objects window. Double click to
open it and add records you want by typing them.
Step 1: Step 2:
Step 3: Step 4:
Step 5: Step 6:
Use wizard to create table
The wizard allows to create a table from predefined sample tables with predefined fields. It is just like
drag and drop type work where you have to choose the fields and other important things for your table.
Follow these steps to create a table through wizard:
Click on Table –> Use wizard to create table option from the tasks window.
A wizard appears with the 4 basic steps:
Select fields:
 This option displays two categories business & Personal. Choose the sample table from
the Sample Tables dropdown.
 Now select the required fields from the list of Available Fields.
 Now click on Add button available with > sign or Add to all button with >> to select the all
the available fields. You can remove the unwanted fields by clicking on remove < or
remove all << button.
 Click on Finish.
.
. Use wizard to create table
Set types and formats:
 Select the field name to set types and formats.
 Select appropriate types and formats for your fields and click on next.
Set primary key:
• Select a field for a primary key to the table.
• Select various options for the primary key.
• Click on next.
Create Table:
• This allows renaming the table and provides three options to work with the
table. These options are – insert data immediately, Modify the table
design, and create a form based on this table.
• Click on Finish and start your work accordingly!!

You might also like