Showing posts with label DML. Show all posts
Showing posts with label DML. Show all posts

Tuesday, 6 January 2015

Data Manipulation Language (DML)

What is DML? / List of operations that can be performed by Data Manipulation Language / DML examples / Types of DML / Procedural and Declarative DML




Data Manipulation Language (DML)


Data Manipulation is about handling the data stored in a database differently. The following operations would be considered as data manipulation in a database;

  • Retrieving the data stored in the database – the way to view the data stored in the database

  • Insertion of new data into the database – the way to insert and store the data in the database

  • Deletion of stored data – the way to delete old or unwanted data from the database

  • Modification of the stored data – the way to modify when required or when false data stored

The above said operations can be executed in Oracle using the following SQL statements respectively, for example;

Assume a table Teacher with attributes TID, Name, and Phone number. 

RetrievalSELECT * FROM Teacher;
InsertionINSERT INTO Teacher VALUES (100, ‘Ramesh’, 9900887771);
DeletionDELETE FROM Teacher WHERE TID = 100;
ModificationUPDATE Teacher SET phone = 9900887766;



There are basically two types of DML languages;
1. Procedural DMLs – in procedural DMLs the user has to specify

  • how to get the required data along with

  • what data are required.

2. Declarative DMLs (Non-procedural) – it requires the user to specify

  • What data are required only. (Note:- The DML component of Structured Query Language (SQL) is declarative, ie., non-procedural)
 

Find candidate key and normalize the relation into 2nf and 3nf

Find candidate key and normalize the relation into 2nf and 3nf Question: A relation R is defined as follows. R = (name, stre...