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
CREATEcommand is used to create objects such as a database, table, index, view, and stored procedure in a database. - The
CREATE TABLEcommand is used to create a new table called artists in the database, defining its columns, data types, size, andPRIMARY KEY. - The DDL command
ALTERis used to modify existing databases by adding or modifying columns in atable. - We can use the
ALTERcommand with theADDkeyword to add a new column called nationality to the table artists. - Using the
DROPcommand we can delete a database, table, column, constraint, or index. - The
DROP TABLEcommand is used to deletetables, such as artists, followed by asemicolon. - The
TRUNCATE TABLEcommand is used to delete data entries from a table while keeping its structure, indexes, and dependencies. - The
TRUNCATE TABLEcommand deletes the data within a table but does not affect its structure, indexes or dependencies. - The DDL command
RENAMEcan be used to change the name of tables and columns in our database. - We
RENAMEthecolumnyear_published to release_year in the albums table using theRENAME COLUMNclause of theALTER TABLEDLLcommand.


