DBMS Notes
DBMS Notes
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.
The main differences between DBMS and RDBMS are given below:
No. DBMS RDBMS
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.
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.
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.
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
Number NUMBER
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.
VARCHAR Datatype
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.
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
- (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
Show Examples
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.
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).