Skip to content
GK24
Computer AwarenessMedium

The SQL commands GRANT and REVOKE belong to which category?

  1. A.DDL
  2. B.DML
  3. C.DCL
  4. D.TCL

Correct answer

C. DCL

Explanation

The correct answer is C, DCL. The Data Control Language governs who may do what inside the database: GRANT gives a user a privilege such as the right to read or to update a table, and REVOKE withdraws a privilege already given. Option A is wrong because the Data Definition Language changes the structure of database objects through CREATE, ALTER, DROP and TRUNCATE. Option B is wrong because the Data Manipulation Language works on the rows themselves through INSERT, UPDATE, DELETE and SELECT. Option D is wrong because the Transaction Control Language manages a transaction as a unit with COMMIT to make changes permanent, ROLLBACK to undo them and SAVEPOINT to mark a place to roll back to. Fix the four groups by their purpose: structure, data, rights and transactions.

Read the full article: Databases and DBMS: Models, Keys, SQL and Normalisation

View all
Q1.Computer AwarenessAsked in: Delhi · 7 Aug 2021, Shift 2Easy

Which of the following is the oldest database model?

  1. A.Hierarchical
  2. B.Object oriented
  3. C.Deductive
  4. D.Relational
Show answer
Correct answer: A. Hierarchical

The hierarchical model is the first data model used in commercial database software; IBM built its Information Management System on it in the 1960s for the Apollo programme.

Q2.Computer AwarenessMedium

Who proposed the relational model of databases?

  1. A.Charles Babbage
  2. B.Edgar Frank Codd
  3. C.Dennis Ritchie
  4. D.James Gosling
Show answer
Correct answer: B. Edgar Frank Codd

Codd, a British computer scientist working at IBM, set out the relational model in a paper published in 1970, proposing that all data be held in simple two-dimensional tables and joined by matching values rather than by fixed pointers.

Q5.Computer AwarenessMedium

Which SQL command removes all the rows of a table but keeps the table structure, and is classified as a DDL command?

  1. A.DELETE
  2. B.DROP
  3. C.TRUNCATE
  4. D.ERASE
Show answer
Correct answer: C. TRUNCATE

TRUNCATE empties a table in one operation, leaving the columns, data types and constraints in place so that the table can be filled again at once; because it changes the object rather than selected rows it is grouped with the Data Definition Language and it is much faster than deleting…