DDL, DML, and programmable objects

As a developer, you are often also responsible for creating the database objects. Of course, in an application, you need also to insert, update, and delete the data. In order to maintain data integrity, meaning enforcing data to comply with business rules, you need to implement constraints. In our quick review of the data definition language (DDL) and data modification language (DML) elements, we will look at the following statements:

  • CREATE for creating tables and programmatic objects
  • ALTER to add constraints to a table
  • DROP to drop an object
  • INSERT to insert new data
  • UPDATE to change existing data
  • DELETE to delete the data

In a SQL Server database, you can also use programmatic objects. You can use triggers for advanced constraints or to maintain some redundant data such as aggregated data. You can use other programmatic objects for data abstraction, for an intermediate layer between the actual data and an application. The following programmatic objects are introduced here:

  • Triggers
  • Stored procedures
  • Views
  • User-defined functions

It is worth mentioning again that this chapter is just a reminder of the features SQL Server gives to developers. Therefore, this section is also not a comprehensive database logical and physical design guide.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.62.122