O'Reilly logo

Discovering SQL: A Hands-On Guide for Beginners by Alex Kriegel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SUMMARY

Primary and foreign keys are essential to specifying relationships between tables in a relational database. They are used to enforce different types of integrity: entity integrity (primary key) and referential integrity (a combination of primary and foreign keys).

Database normalization is an iterative process that takes the data model through several refinement stages called normal forms; each subsequent stage includes the rules of the preceding one and then adds more. Usually, 3NF (the third normal form) is the desired outcome of the normalization process.

A normalized database produces data sets assembled from the tables with the help of the JOIN keyword and UNION operator.

Dynamic SQL allows for execution of SQL statements whose structure and content are not known prior to execution. It provides ultimate flexibility as the statements could be assembled in an ad hoc fashion. This flexibility comes at the price of reduced performance and increased vulnerability to security threats, however.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required