What is the difference between data definition language DDL and SQL?
These are used to manage the changes made by DML-statements. It also allows statements to be grouped together into logical transactions. DCL is short name of Data Control Language which includes commands such as GRANT and mostly concerned with rights, permissions and other controls of the database system. So far we’ve covered the major examples of modifying table structures using the DDL statements of ALTER, CREATE, and DROP. However, there are some other features or options these provide, such as creating views, indexes, and triggers.
The DDL provides facilities to specify such constraints. The database system checks these constraints every time the database is updated. In general, a constraint can be an arbitrary predicate pertaining to the database. However, arbitrary predicates may be costly to the test. Thus, the database system implements integrity constraints that can be tested with minimal overhead.
Relational data Model
The first command in the example will drop the Employee table and the second one will drop the entire database. The above diagram (produced from the Relationships Tool) represents the database we wish to create but where we will do so using DDL commands. The drop Table command deletes the whole table along with all the data. Now we can add data and query the results as and when needed. Thus, in the simplest terms, DDL is a computer language used to code data structures.
The most notable one is setting permissions for database users, which is done chiefly through the GRANT, REVOKE, and DENY commands. DCL includes commands such as GRANT and REVOKE which mainly deal with the rights, permissions, and other controls of the database system. DDL is sometimes known as Data Description Language basis sql since its statements can also be used to describe, comment on and place labels on database objects. It is used to delete the entities inside the table while holding the structure of the table. It free up the space from the table whereas the column names are left resulting to store new data in the table.
Alter Command
The Book table was created previously, but there is no specification for a primary key. To add a primary key, we use the ALTER TABLE command as shown below. Transaction Control Language commands are used to manage transactions in the database.
The first one is used with the ALTER TABLE statement to change the name of an object (table, column, etc.). COMMENT is used to add single line, multi-line and in-line comments. The SQL commands that deal with the manipulation of data present in the database belong to DML or Data Manipulation Language and this includes most of the SQL statements.