Introduction

4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next

version 11


SQL (Structured Query Language) is a tool for creating, organizing, managing and retrieving data stored by a computer database. SQL is not a database management system itself nor a stand-alone product; however, SQL is an integral part of a database management system, both a language and a tool used to communicate with this system.

The goal of this tutorial is not to teach you how to work with SQL (for this you can find documentation and links on the Internet), nor to teach you how to use and/or program in 4D. Instead, its purpose is to show you how to manage SQL inside 4D code, how to retrieve data using SQL commands, how to pass parameters and how to get the results after a SQL query.

Description of the database that accompanies this tutorial

All the examples that will be detailed in this document were fully tested and verified in one of the example databases named "4D SQL Code Samples".

The structure is as follows:

The MOVIES table contains information about 50 movies, such as the title, the director, the category (Action, Animation, Comedy, Crime, Drama, etc.), the year it was released, whether or not it has subtitles, a brief summary, a picture of its poster, the type of media (DVD, VHS, DivX), whether it is in black and white, a blog saved in a BLOB, and the number of tickets sold.

The ACTORS table contains information regarding the actors of the movies such as an ID, their last and first names, any comments and the ID of the city where the actor was born.

The CITIES table contains information regarding the name and ID of the cities where the actors were born.

The MOVIE_ACTOR table is used to simulate a Many-to-Many relation between the MOVIES and ACTORS tables.

All the information you need to launch every example described in the tutorial is situated in the following main window which you can access by selecting the Demo SQL>Show Samples menu command:


4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next