Dbms Theory Notes 2
Dbms Theory Notes 2
DATATYPES IN DBMS:
Data types in OpenOffice Base are broadly classified into five categories listed
below.
• Numeric Types
• Alphanumeric Types
• Binary Types
• Date time
• Other Variable types
Numeric Types:
Date: Stores year/month/day
Binary: These data types in a database can be using for storing photos, music files,
etc. BINARY, VARBINARY, LONGVARBINARY
Other Data Types:
Other/Object - stores serialized Java Objects
There are different ways to create a table in Base:
1. Create table in Design View
2. Use Wizard to Create Table
3. Create table in Create View
Referential Integrity: 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.
Data Redundancy: If there are multiple copies of the same file in different
locations, which lead to data redundancy. It is the duplication of data.
Advantages of Database
1) Reduces Data Redundancy: Database reduces the duplication of data,
called Data Redundancy.
2) Sharing of Data : In a database, the users of the database can share the
data among themselves.
3) Data Integrity and Data Consistency : Data integrity means that the
data is accurate and consistent in the database. Data Consistency means
multiple copies of the same data should be matching.
4) Data Security : Database provides data security as only authorized users
are allowed to access the database and their identity are authenticated
by using a username and password.
5) Privacy : The privacy rule in a database states that only the authorized
users can access a database according to its privacy constraints.
6) Backup and Recovery : Database Management System automatically
takes care of backup and recovery.
Constraints: Constraints are tools to enforce limits to the data that can
be inserted/updated/deleted from a table. The whole purpose of
constraints is to maintain the data integrity. Eg: Primary Key, Foreign
Key
Different types of keys:
1) Primary Key : A primary key is a unique value that identifies a row in a
table. It helps the database to search for a record.
2) Composite Primary Key : When 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
table that refers to a column or set of columns in another table. (When the
Primary key of a table is given in another table, in the second table it is
known as the Foreign Key)