Found 338 Articles for DBMS

Functions in Oracle DBMS

Amit Diwan
Updated on 20-Jun-2020 09:50:11

6K+ Views

The different types of functions in Oracle are −Oracle String FunctionsOracle Numeric FunctionsOracle Date FunctionsMore details about these functions are given as follows −Oracle String FunctionsThe following are the Oracle String Functions −ASCII(str)This function returns the ASCII or numeric value of the first word in the string str provided. If it is an empty string, it returns 0. For example:SQL> SELECT ASCII('Apple'); +---------------------------------------------------------+ | ASCII('Apple') | +---------------------------------------------------------+ | 65 | +---------------------------------------------------------+ 1 row in set (0.00 sec)This returns the ASCII value of A i.e. 65 as it is the first character in the string.CONCAT(str1, str2…..strn)This function returns the string that ... Read More

Cursors in Oracle DBMS

Amit Diwan
Updated on 20-Jun-2020 08:53:39

4K+ Views

When a SQL statement is executed in Oracle, the temporary context area is created. This area contains all the relevant information relating to the statement and its execution. The cursor is a pointer to this context area and allows the PL/SQL program to control this area.There are two types of Cursors.Implicit CursorsExplicit CursorsLet us begin with Implicit Cursors −Implicit CursorsWhenever an SQL statement is executed, the implicit cursors are automatically created. This happens if there is no explicit cursor for the particular statement. Implicit cursors cannot be controlled by the programmers.There are many different attributes for Implicit Cursors. Some of ... Read More

Block of PL/SQL in Oracle DBMS

Ricky Barnes
Updated on 20-Jun-2020 08:55:16

3K+ Views

PL/SQL is a block structured language i.e the code of PL./SQL is written in the form of blocks. PL/SQL also contains the robustness, security and portability of the Oracle database.Each block of PL/SQL contains the following subparts −Declarations -  This section contains all the items that needs to be declared before the program such as variables, subprograms etc. This section contains the keyword DECLARE at its start. In general, Declarations is an optional subpart of the PL/SQL program.Executable Commands -  This section of the PL/SQL code contains the executable statements. It contains BEGIN and END at its starting and ending. ... Read More

DDBMS Components

Ricky Barnes
Updated on 20-Jun-2020 08:48:53

4K+ Views

The contents of a distributed database are spread across multiple locations. That means the contents may be stored in different systems that are located in the same place or geographically far away. However, the database still appears uniform to the users i.e the fact that the database is stored at multiple locations is transparent to the users.The different components of a distributed database are −Let us now discuss them one by one −UsersThere are many users who use the distributed database. For them, the fact that the database is spread across multiple locations is transparent and they perceive the database ... Read More

DDBMS Advantages and Disadvantages

David Meador
Updated on 20-Jun-2020 08:18:55

15K+ Views

The distributed database management system contains the data in multiple locations. That can be in different systems in the same place or across different geographical locations.As shown in the below example −The database is divided into multiple locations and stores the data in Site1, Site2, Site3 and Site4.The advantages and disadvantages of Distributed database management systems are as follows −Advantages of DDBMSThe database is easier to expand as it is already spread across multiple systems and it is not too complicated to add a system.The distributed database can have the data arranged according to different levels of transparency i.e data ... Read More

Unary or Recursive Relationship

Amit Diwan
Updated on 20-Jun-2020 08:19:28

5K+ Views

When there is a relationship between two entities of the same type, it is known as a recursive relationship. This means that the relationship is between different instances of the same entity type.Some examples of recursive relationship can be shown as follows −An employee can supervise multiple employees. Hence, this is a recursive relationship of entity employee with itself. This is a 1 to many recursive relationship as one employee supervises many employees.A person can have many children who are also persons. Hence, this is a recursive relationship of entity person with itself. This is a 1 to many recursive ... Read More

Data and structural independence

Alex Onsman
Updated on 15-Jun-2020 13:47:58

2K+ Views

Structural IndependenceStructural independence exists when changes in the database structure do not affect DBMS ability to access data.Structural dependence exists when changes in the database structure do not affect DBMS ability to access data.Data IndependenceThe changes done in the lower level will not affect the upper layers. The two types are −Physical Data IndependenceLogical Data IndependenceLet us begin with Physical Data Independence −Physical Data IndependenceModify physical schema without affecting the schema or logical data. It is easier to achieve.It is achieved by the internal level of the database and mapping from the logical level to the internal level. The Conceptual Schema ... Read More

Fourth Normal Form (4NF)

Alex Onsman
Updated on 15-Jun-2020 13:41:50

4K+ Views

What is 4NF?The 4NF comes after 1NF, 2NF, 3NF, and Boyce-Codd Normal Form. It was introduced by Ronald Fagin in 1977.To be in 4NF, a relation should be in Bouce-Codd Normal Form and may not contain more than one multi-valued attribute.ExampleLet us see an example −Movie_NameShooting_LocationListingMovieOneUKComedyMovieOneUKThrillerMovieTwoAustraliaActionMovieTwoAustraliaCrimeMovieThreeIndiaDramaThe above is not in 4NF, sinceMore than one movie can have the same listingMany shooting locations can have the same movieLet us convert the above table in 4NF −Movie_NameShooting_LocationMovieOneUKMovieOneUKMovieTwoAustraliaMovieTwoAustraliaMovieThreeIndiaMovie_NameListingMovieOneComedyMovieOneThrillerMovieTwoActionMovieTwoCrimeMovieThreeDramaNow the violation is removed and the tables are in 4NF.

Domain-Key Normal Form

Amit Diwan
Updated on 15-Jun-2020 13:36:08

4K+ Views

A relation is in DKNF when insertion or delete anomalies are not present in the database. Domain-Key Normal Form is the highest form of Normalization. The reason is that the insertion and updation anomalies are removed. The constraints are verified by the domain and key constraints.A table is in Domain-Key normal form only if it is in 4NF, 3NF and other normal forms. It is based on constraints −Domain ConstraintValues of an attribute had some set of values, for example, EmployeeID should be four digits long −EmpIDEmpNameEmpAge0921Tom330922Jack31Key ConstraintAn attribute or its combination is a candidate keyGeneral ConstraintPredicate on the set ... Read More

Transitive dependency in DBMS

Alex Onsman
Updated on 15-Jun-2020 13:26:27

21K+ Views

What is Transitive DependencyWhen an indirect relationship causes functional dependency it is called Transitive Dependency.If  P -> Q and Q -> R is true, then P-> R is a transitive dependency.To achieve 3NF, eliminate the Transitive Dependency.ExampleMovie_IDListing_IDListing_TypeDVD_Price ($)M08L09Crime180M03L05Drama250M05L09Crime180The above table is not in 3NF because it has a transitive functional dependency −Movie_ID -> Listing_IDListing_ID -> Listing_TypeTherefore, the following has transitive functional dependency.Movie_ID -> Listing_TypeThe above states the relation violates the 3rd Normal Form (3NF).To remove the violation, you need to split the tables and remove the transitive functional dependency.Movie_IDListing_IDDVD_Price ($)M08L09180M03L05250M05L09180Listing_IDListing_TypeL09CrimeL05DramaL09CrimeNow the above relation is in Third Normal Form (3NF) ... Read More

Advertisements