Explain DDL commands with example.
DDL consist of Commands to commands like CREATE, ALTER, TRUNCATE and DROP. These commands are used to create or modify the tables in SQL. CREATE : This command is used to create a new table in SQL. The user has to give information like table name, column names, and their datatypes.Example – We need to create a table for storing Student information of a particular College. Create syntax would be as below. CREATE TABLE Student_info ( College_Id number(2), College_name varchar(30), Branch varchar(10) ); Command-2 : ALTER : This command is used to add, delete or change columns in the existing table. The user needs to know the existing table name and can do add, delete or modify tasks easily. Syntax – Syntax to add a column to an existing table. ALTER TABLE table_name ADD column_name datatype; Example – In our Student_info table, we want to add a new column for CGPA. The syntax would be as below as follows. ALTER TABLE Student_info ADD CGPA number; Command-3 : TRUNCATE : This command is use...