Rdbms - One Shot
Rdbms - One Shot
Management System
in
Notes & Imp. Ques.
Session – 1
Appreciate the
Concept of Database
Management System
Base
3
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.
7
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
8
of
Database
9
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.
11
Data Integrity
» Data integrity means that the data is
accurate and consistent in the database.
12
Data Security
» Only authorized users are allowed to
access the database and their identity is
authenticated using a username and
password.
13
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.
15
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.
16
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.
17
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
19
Database
Objects
21
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.
22
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
28
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
29
Alphanumeric Types
» LONGVARCHAR, VARCHAR, CHAR,
VARCHAR_IGNORECASE
30
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
31
Other Datatypes
Name Description
Other/Object Stores serialized java objects
34
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
40
» 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.
Referential Integrity
41
➜ Steps:-
➜ Tools > Relationships…
➜ Add the tables in amongst which you want to create
the relationship. Select the tables and click on Add
button.
➜ Drag the primary key of one table and drop it on the
foreign key of the another table.
➜ Types of Relationships
1. ONE to ONE
2. ONE to MANY or MANY to ONE
3. MANY to MANY
Types of Relationships
44
from forms
➜ You can add new records to the table using the
form by clicking the symbol located at the
bottom.
➜ Once you click the symbol, you will be
displayed with a window for creating records.
➜ You can add records using the form.
Report
57