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

To construct a relational database, a data modeling process is deployed. It goes through several elaboration phases wherein a conceptual idea is transformed into logical and then physical representations of the data.

The data in the relational database are constrained by data types; each column in the table being one and only one data type. This helps to maintain data integrity by disallowing incompatible data types from entering into the database. RDBMSs perform both implicit and explicit data type conversion when one data type is transformed into another. It is best practice to use explicit data type conversion. A special case of data type is NULL, which signifies absence of data and requires special handling.

The database structure is defined by a subset of the SQL called the Data Definition Language (DDL), while data operations are the domain of the Data Manipulation Language (DML). There are restrictions on the use of each, specific to particular RDBMS implementations. The DDL statements CREATE, ALTER, and DROP can be used to create, alter, or destroy database objects.

The DML includes INSERT, UPDATE, and DELETE statements; while Data Query Language (DQL) includes a single member: SELECT. All these statements can be used with SQL operators, and they employ additional clauses/keywords to limit affected records horizontally, and apply vertical limits through specifying columns.

Although not emphasized in SQL, operators serve their important roles by enabling you to manipulate ...

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