26 Lecture

CS403

Midterm & Final Term Short Notes

Categories of SQL Commands

SQL commands can be broadly categorized into four categories: data definition language (DDL), data manipulation language (DML), data control language (DCL), and transaction control language (TCL). DDL commands are used to define and modify datab


Important Mcq's
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. Which category of SQL commands is used to define and modify database objects such as tables and indexes? A. Data Manipulation Language (DML) B. Data Definition Language (DDL) C. Data Control Language (DCL) D. Transaction Control Language (TCL) Answer: B Which category of SQL commands is used to manipulate data in database objects? A. Data Manipulation Language (DML) B. Data Definition Language (DDL) C. Data Control Language (DCL) D. Transaction Control Language (TCL) Answer: A Which category of SQL commands is used to control access to the database? A. Data Manipulation Language (DML) B. Data Definition Language (DDL) C. Data Control Language (DCL) D. Transaction Control Language (TCL) Answer: C Which category of SQL commands is used to manage transactions and ensure data consistency? A. Data Manipulation Language (DML) B. Data Definition Language (DDL) C. Data Control Language (DCL) D. Transaction Control Language (TCL) Answer: D Which SQL command falls under the DDL category? A. SELECT B. UPDATE C. INSERT D. CREATE Answer: D Which SQL command falls under the DML category? A. ALTER B. DELETE C. DROP D. GRANT Answer: B Which SQL command falls under the DCL category? A. UPDATE B. REVOKE C. INSERT D. DELETE Answer: B Which SQL command falls under the TCL category? A. COMMIT B. SELECT C. WHERE D. FROM Answer: A Which SQL command is used to create a new table in a database? A. INSERT B. UPDATE C. DELETE D. CREATE Answer: D Which SQL command is used to add a new row of data to an existing table? A. DELETE B. INSERT C. UPDATE D. ALTER Answer: B



Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is the purpose of Data Definition Language (DDL) commands in SQL? Answer: DDL commands are used to define and modify database objects such as tables and indexes. Give an example of a DDL command in SQL. Answer: CREATE TABLE is an example of a DDL command in SQL. What is the purpose of Data Manipulation Language (DML) commands in SQL? Answer: DML commands are used to manipulate data in database objects such as tables. Give an example of a DML command in SQL. Answer: SELECT is an example of a DML command in SQL. What is the purpose of Data Control Language (DCL) commands in SQL? Answer: DCL commands are used to control access to the database. Give an example of a DCL command in SQL. Answer: GRANT is an example of a DCL command in SQL. What is the purpose of Transaction Control Language (TCL) commands in SQL? Answer: TCL commands are used to manage transactions and ensure data consistency. Give an example of a TCL command in SQL. Answer: COMMIT is an example of a TCL command in SQL. What is the difference between a DDL and a DML command in SQL? Answer: DDL commands are used to define and modify database objects, while DML commands are used to manipulate data in those objects. What is the difference between a DCL and a TCL command in SQL? Answer: DCL commands are used to control access to the database, while TCL commands are used to manage transactions and ensure data consistency.

SQL (Structured Query Language) is a standard language used to manage relational databases. SQL commands can be broadly categorized into four categories: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL). DDL commands are used to create and modify the structure of database objects such as tables, views, and indexes. Some common DDL commands include CREATE, ALTER, and DROP. These commands are used to create new objects, modify existing ones, and delete objects from the database. DML commands are used to manipulate data within the database objects. The most commonly used DML commands are SELECT, INSERT, UPDATE, and DELETE. These commands are used to retrieve data from tables, add new data to tables, modify existing data in tables, and delete data from tables. DCL commands are used to manage user access to the database. Some common DCL commands include GRANT, REVOKE, and DENY. These commands are used to give users permissions to perform certain operations on database objects or revoke those permissions. TCL commands are used to manage transactions in the database. Transactions are a set of related operations that must be completed together, either all succeeding or all failing. Some common TCL commands include COMMIT, ROLLBACK, and SAVEPOINT. These commands are used to ensure data consistency and maintain the integrity of the database. In summary, SQL commands can be categorized into four categories: DDL, DML, DCL, and TCL. Each category serves a specific purpose and is used for a different type of operation within the database. Understanding these categories and the commands within them is essential for anyone working with relational databases.