0% found this document useful (0 votes)
68 views6 pages

DBMS Notes

DBMS is a software package that manages a collection of related data and programs. The primary goal of a DBMS is to store and retrieve data efficiently. It provides advantages like controlling redundancy, enforcing data integrity, avoiding inconsistency, and allowing data sharing. Some disadvantages include complexity, size, performance impacts, higher failure impact, and additional hardware costs. RDBMS stores data in tabular form using tables with primary keys, supports normalization, and defines integrity constraints. It supports features like relationships between tables and distributed databases. Oracle provides various datatypes for storing different types of data like character, number, date/time, large objects, row IDs. The CHAR datatype stores fixed-length alphanumeric strings.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
68 views6 pages

DBMS Notes

DBMS is a software package that manages a collection of related data and programs. The primary goal of a DBMS is to store and retrieve data efficiently. It provides advantages like controlling redundancy, enforcing data integrity, avoiding inconsistency, and allowing data sharing. Some disadvantages include complexity, size, performance impacts, higher failure impact, and additional hardware costs. RDBMS stores data in tabular form using tables with primary keys, supports normalization, and defines integrity constraints. It supports features like relationships between tables and distributed databases. Oracle provides various datatypes for storing different types of data like character, number, date/time, large objects, row IDs. The CHAR datatype stores fixed-length alphanumeric strings.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 6

What is DBMS?

Database-management system (DBMS) is a collection of well organized data. In order to


carryout operations like insertion deletion and retrieval the database needs to managed by
a software package. interrelated data and a set of programs to access those data. This is a
collection of related data with an implicit meaning and hence is a database. The collection of
data, usually referred to as the database, contains information relevant to an enterprise.
The primary goal of a DBMS is to provide a way to store and retrieve database information
that is both convenient and efficient. By data, we mean known facts that can be recorded
and that have implicit meaning. For example, consider the names, telephone numbers, and
addresses of the people you know. You may have recorded this data in an indexed address
book, or you may have stored it on a diskette, using a personal computer and software such
as DBASE IV or V, Microsoft ACCESS, or EXCEL.

Advantage and Disadvantage of DBMS?


The database management system has promising potential advantages, which are explained
below:
 
1. Controlling Redundancy: In file system, each application has its own private files, which
cannot be shared between multiple applications. It his can often lead to considerable
redundancy in the stored data, which results in wastage of storage space. By having
centralized database most of this can be avoided. It is not possible that all redundancy should
be eliminated. Sometimes there are sound business and technical reasons for· maintaining
multiple copies of the same data. In a database system, however this redundancy can be
controlled.
2. Integrity can be enforced: Integrity of data means that data in database is always
accurate, such that incorrect information cannot be stored in database. In order to maintain
the integrity of data, some integrity constraints are enforced on the database. A DBMS should
provide capabilities for defining and enforcing the constraints.
3. Inconsistency can be avoided: When the same data is duplicated and changes are made at
one site, which is not propagated to the other site, it gives rise to inconsistency and the two
entries regarding the same data will not agree. At such times the data is said to be
inconsistent. So, if the redundancy is removed chances of having inconsistent data is also
removed.
4. Data can be shared: As explained earlier, the data about Name, Class, Father __name etc.
of General_Office is shared by multiple applications in centralized DBMS as compared to
file system so now applications can be developed to operate against the same stored data. The
applications may be developed without having to create any new stored files.
 
5. Standards can be enforced: Since DBMS is a central system, so standard can be enforced
easily may be at Company level, Department level, National level or International level. The
standardized data is very helpful during migration or interchanging of data. The file system is
an independent system so standard cannot be easily enforced on multiple independent
applications.
6. Restricting unauthorized access: When multiple users share a database, it is likely that
some users will not be authorized to access all information in the database.
7. Solving Enterprise Requirement than Individual Requirement: Since many types of
users with varying level of technical knowledge use a database, a DBMS should provide a
variety of user interface. The overall requirements of the enterprise are more important than
the individual user requirements. So, the DBA can structure the database system to provide
an overall service that is "best for the enterprise".
8. Providing Backup and Recovery: A DBMS must provide facilities for recovering from
hardware or software failures. The backup and recovery subsystem of the DBMS is
responsible for recovery.
9. Cost of developing and maintaining system is lower: It is much easier to respond to
unanticipated requests when data is centralized in a database than when it is stored in a
conventional file system. Although the initial cost of setting up of a database can be large, but
the cost of developing and maintaining application programs to be far lower than for similar
service using conventional systems. The productivity of programmers can be higher in using
non-procedural languages that have been developed with DBMS than using procedural
languages.
10. Data Model can be developed: The centralized system is able to represent the complex
data and interfile relationships, which results better data modeling properties. The data
madding properties of relational model is based on Entity and their Relationship, which is
discussed in detail in chapter 4 of the book.
11. Concurrency Control: DBMS systems provide mechanisms to provide concurrent
access of data to multiple users.

Disadvantages of DBMS
The disadvantages of the database approach are summarized as follows:
1. Complexity: The provision of the functionality that is expected of a good DBMS makes
the DBMS an extremely complex piece of software. Database designers, developers, database
administrators and end-users must understand this functionality to take full advantage of it.
Failure to understand the system can lead to bad design decisions, which can have serious
consequences for an organization.
2. Size: The complexity and breadth of functionality makes the DBMS an extremely large
piece of software, occupying many megabytes of disk space and requiring substantial
amounts of memory to run efficiently.
3. Performance: Typically, a File Based system is written for a specific application, such as
invoicing. As result, performance is generally very good. However, the DBMS is written to
be more general, to cater for many applications rather than just one. The effect is that some
applications may not run as fast as they used to.
4. Higher impact of a failure: The centralization of resources increases the vulnerability of
the system. Since all users and applications rely on the ~vailabi1ity of the DBMS, the failure
of any component can bring operations to a halt.
5. Cost of DBMS: The cost of DBMS varies significantly, depending on the environment and
functionality provided. There is also the recurrent annual maintenance cost.
6. Additional Hardware costs: The disk storage requirements for the DBMS and the
database may necessitate the purchase of additional storage space. Furthermore, to achieve
the required performance it may be necessary to purchase a larger machine, perhaps even a
machine dedicated to running the DBMS. The procurement of additional hardware results in
further expenditure.
7. Cost of Conversion: In some situations, the cost of the DBMS and extra hardware may be
insignificant compared with the cost of converting existing applications to run on the new
DBMS and hardware. This cost also includes the cost of training staff to use these new
systems and possibly the employment of specialist staff to help with conversion and running
of the system. This cost is one of the main reasons why some organizations feel tied to their
current systems and cannot switch to modern database technology.

Difference between DBMS and RDBMS

The main differences between DBMS and RDBMS are given below:
No. DBMS RDBMS

1 DBMS applications store data as RDBMS applications store data in a tabular form.


) file.

2 In DBMS, data is generally stored In RDBMS, the tables have an identifier called
) in either a hierarchical form or a primary key and the data values are stored in the
navigational form. form of tables.

3 Normalization is not present in Normalization is present in RDBMS.


) DBMS.

4 DBMS does not apply any RDBMS defines the integrity constraint for the


) security with regards to data purpose of ACID (Atomocity, Consistency, Isolation
manipulation. and Durability) property.

5 DBMS uses file system to store in RDBMS, data values are stored in the form of
) data, so there will be no relation tables, so a relationship between these data values
between the tables. will be stored in the form of a table as well.

6 DBMS has to provide some RDBMS system supports a tabular structure of the
) uniform methods to access the data and a relationship between them to access the
stored information. stored information.

7 DBMS does not support distributed RDBMS supports distributed database.


) database.

8 DBMS is meant to be for small RDBMS is designed to handle large amount of data.
) organization and deal with small it supports multiple users.
data. it supports single user.

9 Examples of DBMS are file Example of RDBMS are mysql, postgre, sql


) systems, xml etc. server, oracle etc.

Oracle Datatypes

Create a table to store data in the database, you need to specify a datatype for all the columns
you define in the table. Oracle has many datatypes to suit application requirements.

Category Datatypes

Character CHAR, NCHAR,VARCHAR2,NVARCHAR2

Number NUMBER

Long and raw LONG, LONG RAW, RAW

Date and Time DATE, TIMESTAMP,TIMESTAMP WITH TIME ZONE

Large Object CLOB, NCLOB, BCLOB,BFILE

Row ID ROWID,UROWID

CHAR<Size>
The CHAR datatype is a fixed-length alphanumeric strings, which has a maximum length in
bytes. Data stored in CHAR columns is space padded to fill the maximum length. Its size can
range from minimum of 1 bytes to a maximum of 2000 bytes. The default size is 1.

When you create a column using the CHAR datatype, the database will ensure that all data
placed in this column has the defined length. If the data is shorter than the defined length, it is
space padded on the right to the specified length. If the data is longer, an error is raised.

VARCHAR2 <Size>

The VARCHAR2 datatype stores variable-length character strings. When you create a table with
a VARCHAR2 column, you specify a maximum string length (in bytes or characters) between 1
and 4000 bytes for the VARCHAR2 column. For each row, Oracle Database stores each value in
the column as a variable-length field unless a value exceeds the column's maximum length, in
which case Oracle Database returns an error. Using VARCHAR2 and VARCHAR saves on space
used by the tabl+e.

For example, assume you declare a column VARCHAR2 with a maximum size of 50 characters. In


a single-byte character set, if only 10 characters are given for the VARCHAR2 column value in a
particular row, the column in the row's row piece stores only the 10 characters (10 bytes), not
50.

VARCHAR Datatype

The VARCHAR datatype is synonymous with the VARCHAR2 datatype. To avoid possible


changes in behavior, always use the VARCHAR2 datatype to store variable-length character
strings.

NUMBER Datatype
The NUMBER datatype stores fixed and floating-point numbers. Numbers of virtually any
magnitude can be stored and are guaranteed portable among different systems operating Oracle
Database, up to 38 digits of precision.

What is an Operator in SQL?


An operator is a reserved word or a character used primarily in an SQL statement's WHERE
clause to perform operation(s), such as comparisons and arithmetic operations. These
Operators are used to specify conditions in an SQL statement and to serve as conjunctions for
multiple conditions in a statement.

 Arithmetic operators
 Comparison operators
 Logical operators
 Operators used to negate conditions
SQL Arithmetic Operators
Assume 'variable a' holds 10 and 'variable b' holds 20, then −
Show Examples

Operator Description Example

+ (Addition) Adds values on either side of the operator. a + b will give 30

- (Subtraction) Subtracts right hand operand from left hand operand. a - b will give -10

* (Multiplication) Multiplies values on either side of the operator. a * b will give 200

/ (Division) Divides left hand operand by right hand operand. b / a will give 2

Divides left hand operand by right hand operand and returns


% (Modulus) b % a will give 0
remainder.

SQL Comparison Operators


Assume 'variable a' holds 10 and 'variable b' holds 20, then −

Show Examples

Operator Description Example

Checks if the values of two operands are equal or not, if yes then condition (a = b) is not
=
becomes true. true.

Checks if the values of two operands are equal or not, if values are not equal
!= (a != b) is true.
then condition becomes true.

Checks if the values of two operands are equal or not, if values are not equal
<> (a <> b) is true.
then condition becomes true.

Checks if the value of left operand is greater than the value of right operand, (a > b) is not
>
if yes then condition becomes true. true.

Checks if the value of left operand is less than the value of right operand, if
< (a < b) is true.
yes then condition becomes true.

Checks if the value of left operand is greater than or equal to the value of (a >= b) is not
>=
right operand, if yes then condition becomes true. true.

Checks if the value of left operand is less than or equal to the value of right
<= (a <= b) is true.
operand, if yes then condition becomes true.

!< Checks if the value of left operand is not less than the value of right (a !< b) is false.
operand, if yes then condition becomes true.

Checks if the value of left operand is not greater than the value of right
!> (a !> b) is true.
operand, if yes then condition becomes true.

SQL Logical Operators


Here is a list of all the logical operators available in SQL.

Sr.No. Operator & Description

1 ALL -The ALL operator is used to compare a value to all values in another value set.

AND
2
The AND operator allows the existence of multiple conditions in an SQL statement's WHERE clause.

ANY
3
The ANY operator is used to compare a value to any applicable value in the list as per the condition.

BETWEEN

4 The BETWEEN operator is used to search for values that are within a set of values, given the minimum
value and the maximum value.

EXISTS

5 The EXISTS operator is used to search for the presence of a row in a specified table that meets a certain
criterion.

6 IN -The IN operator is used to compare a value to a list of literal values that have been specified.

7 LIKE -The LIKE operator is used to compare a value to similar values using wildcard operators.

NOT

8 The NOT operator reverses the meaning of the logical operator with which it is used. Eg: NOT EXISTS,
NOT BETWEEN, NOT IN, etc. This is a negate operator.

9 OR - The OR operator is used to combine multiple conditions in an SQL statement's WHERE clause.

10 IS NULL -The NULL operator is used to compare a value with a NULL value.

11 UNIQUE -The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates).

You might also like