What are the difference between DDL, DML and DCL commands?
Filed under: MySQL Interview Questions, Oracle Certification Exams Interview Questions, Oracle Interview Questions, Relational Database Interview Questions
DDL
Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
* CREATE – to create objects in the database
* ALTER – alters the structure of the database
* DROP – delete objects from the database
* TRUNCATE – remove all records from a table, including all spaces allocated for the records are removed
* COMMENT – add comments to the data dictionary
* RENAME – rename an object
DML
Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
* SELECT – retrieve data from the a database
* INSERT – insert data into a table
* UPDATE – updates existing data within a table
* DELETE – deletes all records from a table, the space for the records remain
* MERGE – UPSERT operation (insert or update)
* CALL – call a PL/SQL or Java subprogram
* EXPLAIN PLAN – explain access path to data
* LOCK TABLE – control concurrency
DCL
Data Control Language (DCL) statements. Some examples:
* GRANT – gives user’s access privileges to database
* REVOKE – withdraw access privileges given with the GRANT command
What is First Normal Form (1NF)
Filed under: Oracle Interview Questions, Relational Database Interview Questions
First normal form (1NF) is the first basic steps for normalization for relational database:
- Eliminate duplicative columns from the same table t0 avoid redundancy .
- There should be separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).
What is Normalization ?
Filed under: Oracle Interview Questions, Relational Database Interview Questions
Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process: eliminating redundant data (for example, storing the same data in more than one table) and ensuring data dependencies make sense (only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.
