What are the differences between DDL, DML and DCL commands?

  • DDL: Data Definition Language (DDL) statements are used to define the database structure or schema.
    • 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.
    • 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
    • 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.
    • GRANT – Gives user’s access privileges to database
    • REVOKE – Withdraw access privileges given with the GRANT command
  • TCL: Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
    • COMMIT – Save work done
    • SAVEPOINT – Identify a point in a transaction to which you can later roll back
    • ROLLBACK – Restore database to original since the last COMMIT
    • SET TRANSACTION – Change transaction options like isolation level and what rollback segment to use

Difference between JDK, JRE and JVM in Java

Java Development Kit (JDK): Java Development Kit is the core component of Java Environment and provides all the tools and binaries required to compile, debug and execute a Java Program. JDK is platform specific software and that’s why we have separate installers for Windows, Mac and Unix systems. We can say that JDK is superset of JRE since it contains JRE with Java compiler, debugger and core classes.

Java Virtual Machine(JVM): JVM is the heart of java programming language. When we run a program, JVM is responsible to converting Byte code to the machine specific code. JVM is also platform dependent and provides core java functions like memory management, garbage collection, security etc. JVM is customizable and we can use java options to customize it, for example allocating minimum and maximum memory to JVM. JVM is called virtual because it provides an interface that does not depend on the underlying operating system and machine hardware. This independence from hardware and operating system is what makes java program write-once run-anywhere.

Java Runtime Environment (JRE): JRE is the implementation of JVM, it provides platform to execute java programs. JRE consists of JVM and java binaries and other classes to execute any program successfully. JRE doesn’t contain any development tools like java compiler, debugger etc. If you want to execute any java program, you should have JRE installed but we don’t need JDK for running any java program.