Mark As Completed Discussion

One Pager Cheat Sheet

  • Data Definition Language (DDL) is a subset of SQL commands that we use to create, modify and manipulate the structure of database objects.
  • The CREATE command is used to create objects such as a database, table, index, view, and stored procedure in a database.
  • The CREATE TABLE command is used to create a new table called artists in the database, defining its columns, data types, size, and PRIMARY KEY.
  • The DDL command ALTER is used to modify existing databases by adding or modifying columns in a table.
  • We can use the ALTER command with the ADD keyword to add a new column called nationality to the table artists.
  • Using the DROP command we can delete a database, table, column, constraint, or index.
  • The DROP TABLE command is used to delete tables, such as artists, followed by a semicolon.
  • The TRUNCATE TABLE command is used to delete data entries from a table while keeping its structure, indexes, and dependencies.
  • The TRUNCATE TABLE command deletes the data within a table but does not affect its structure, indexes or dependencies.
  • The DDL command RENAME can be used to change the name of tables and columns in our database.
  • We RENAME the column year_published to release_year in the albums table using the RENAME COLUMN clause of the ALTER TABLE DLL command.