Summary

Today you learned about the Data Definition Language (DDL) that is included in every relational database system now available. Using DDL, you can create, alter, and drop databases and tables. When creating or altering these tables, you can add or remove columns or change any of their properties.

You also learned about the importance of setting data types and column constraints to help ensure database integrity. Columns can be set up with specific data types to force the type of data that can be inserted into a column. You can set columns to allow or not allow NULL values. You also saw how primary and foreign keys can be used together to maintain data integrity between tables.

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.