DDL used to define integrity constraints - Database

Q.  Which of the following language is used to define the integrity constraints?
- Published on 28 Aug 15

a. DCL
b. DML
c. DDL
d. All of the above

ANSWER: DDL
 

    Discussion

  • Nirja Shah   -Posted on 30 Oct 15
    DDL
    - Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:

    - CREATE - Is is used to create objects in the database
    - ALTER - It alters the structure of the database
    - DROP - It deletes object from the database
    - TRUNCATE - It removes all the records from a table, including all spaces allocated for the records are removed
    - COMMENT - It adds comment to the data dictionary
    - RENAME - It renames an object

    DML
    - Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:

    - SELECT - It retrieves data from the a database
    - INSERT - It inserts data into a table
    - UPDATE - It updates existing data within a table
    - DELETE - It deletes all records from a table, the space for the records remain
    - MERGE - The UPSERT operation (insert or update)
    - CALL - It calls a PL/SQL or Java subprogram
    - EXPLAIN PLAN - It explains the access path to data
    - LOCK TABLE - It controls concurrency

    DCL
    - Data Control Language (DCL) statements. Some examples:

    - GRANT - It gives user's access privileges to database
    - REVOKE - It withdraw access privileges given with the GRANT command

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)