issue67:tutoriel_-_libreoffice_p._20
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue67:tutoriel_-_libreoffice_p._20 [2013/01/14 18:00] – frangi | issue67:tutoriel_-_libreoffice_p._20 [2013/01/18 16:38] (Version actuelle) – [3] auntiee | ||
---|---|---|---|
Ligne 9: | Ligne 9: | ||
To start the database wizard, select Database from the LibreOffice Home screen or File > New > Database. The first screen of the database wizard lets us choose whether we want to open an existing database or create a new one. Select Create a New Database, and click Next. | To start the database wizard, select Database from the LibreOffice Home screen or File > New > Database. The first screen of the database wizard lets us choose whether we want to open an existing database or create a new one. Select Create a New Database, and click Next. | ||
** | ** | ||
+ | |||
+ | Les bases de données sont utilisées pour stocker des informations sur des objets ou des données. Dans le tutoriel précédent, | ||
+ | |||
+ | Création du fichier de base de données | ||
+ | |||
+ | Comme je l'ai mentionné précédemment, | ||
+ | |||
+ | Pour lancer l' | ||
** | ** | ||
Ligne 15: | Ligne 23: | ||
Once you have a name and location for the database file, the main Base screen opens. Down the left side, you have the different pieces which can make up a database file. The top right gives you access to the different actions you can take for each part, and the lower right shows the objects already created. | Once you have a name and location for the database file, the main Base screen opens. Down the left side, you have the different pieces which can make up a database file. The top right gives you access to the different actions you can take for each part, and the lower right shows the objects already created. | ||
** | ** | ||
+ | |||
+ | Le deuxième écran de l' | ||
+ | |||
+ | Une fois que vous avez un nom et un emplacement pour le fichier de base de données, l' | ||
===== 2 ===== | ===== 2 ===== | ||
Ligne 30: | Ligne 42: | ||
For our purposes, we will use Integer and VarChar. | For our purposes, we will use Integer and VarChar. | ||
** | ** | ||
+ | |||
+ | Types de champs | ||
+ | |||
+ | Avant de créer notre premier tableau, nous devons discuter de quelques-uns des types les plus courants de champs de base de données. Lorsque vous sélectionnez un type pour un champ, on vous présente de nombreuses options pour ce type. Beaucoup de types sont identiques et sont là pour des raisons de compatibilité. Les types les plus courants sont les suivants : | ||
+ | |||
+ | Integer(Entier) : un nombre entier, par exemple 123 | ||
+ | VarChar : une chaîne de caractères de longueur variable. Vous allez définir la longueur maximale de la VarChar. | ||
+ | Date : une valeur de date, bien sûr, par exemple 15/10/2012 (le format exact spécifique à votre pays) | ||
+ | Temps : une valeur de temps, telles que 09:15:25 | ||
+ | Decimal : un nombre réel comprenant la partie entière et la partie fractionnaire, | ||
+ | |||
+ | Pour nos besoins, nous allons utiliser Integer et VarChar. | ||
** | ** | ||
Ligne 38: | Ligne 62: | ||
We will start with the Books table. Select Tables from the Database pane on the left. In the Tasks pane, click on Create Table in Design View... to open the Design View dialog. Across the top you have labels for each of the elements of a field: Field Name, Field Type, and Description. The Description is optional but is useful for making notes about how a field is used. At the bottom, we see the Field Properties. This section will change according to the type of field we select. | We will start with the Books table. Select Tables from the Database pane on the left. In the Tasks pane, click on Create Table in Design View... to open the Design View dialog. Across the top you have labels for each of the elements of a field: Field Name, Field Type, and Description. The Description is optional but is useful for making notes about how a field is used. At the bottom, we see the Field Properties. This section will change according to the type of field we select. | ||
** | ** | ||
+ | |||
+ | Création des tables | ||
+ | |||
+ | Base a trois façons de créer des tables : grâce à un assistant de table, par la vue de conception et par des instructions SQL. L' | ||
+ | |||
+ | Nous allons commencer avec la table Books. Cliquez sur Tables dans le volet Database à gauche. Dans le volet Tasks, cliquez sur Create Table in Design View... | ||
===== 3 ===== | ===== 3 ===== | ||
Ligne 45: | Ligne 75: | ||
Our tables for Authors and Media are created in much the same way. For Authors, create two fields: AuthorID, integer (AutoValue Yes); and Name, VarChar (length 50). For Media, MediaID, integer (AutoValue Yes); and Type, VarChar (length 25). | Our tables for Authors and Media are created in much the same way. For Authors, create two fields: AuthorID, integer (AutoValue Yes); and Name, VarChar (length 50). For Media, MediaID, integer (AutoValue Yes); and Type, VarChar (length 25). | ||
** | ** | ||
+ | |||
+ | Dans le premier champ, entrez le nom BookID. Dans la boîte déroulante du Type de champ, cliquez sur Integer. À vous de choisir d' | ||
+ | |||
+ | Nos tables pour les auteurs et les médias sont créées à peu près de la même manière. Pour Authors (les auteurs), créez deux champs : AuthorID, integer (AutoValue Yes); et Name, VarChar (longueur 50). Pour Media, MediaID, integer (AutoValue Yes) et Pour Type, VarChar (longueur 25). | ||
** | ** | ||
Our two foreign key tables need a little different treatment. In BooksAuthors, | Our two foreign key tables need a little different treatment. In BooksAuthors, | ||
+ | ** | ||
+ | |||
+ | Nos deux tables de clés étrangères nécessitent un traitement un peu différent. Dans BooksAuthors, | ||
+ | |||
+ | ** | ||
Create Relationships | Create Relationships | ||
Once we have all our tables defined, we can create the relationships that bind everything together. We will create relationships between our three main tables and our foreign key tables. The direction in which you drag the fields is important, so pay close attention to how you do it. | Once we have all our tables defined, we can create the relationships that bind everything together. We will create relationships between our three main tables and our foreign key tables. The direction in which you drag the fields is important, so pay close attention to how you do it. | ||
- | ** | ||
- | ** | ||
To start the Relation Design dialog, go to Tools > Relationships. You are presented with a list of tables. Select a table and click Add to add the table to the Relation Design. Add the tables in the following order to make it easy: Authors, BooksAuthors, | To start the Relation Design dialog, go to Tools > Relationships. You are presented with a list of tables. Select a table and click Add to add the table to the Relation Design. Add the tables in the following order to make it easy: Authors, BooksAuthors, | ||
Ligne 60: | Ligne 97: | ||
With our tables and relationships created, we are ready to begin work on creating forms for data input. In our next How-To, we will create the forms for data entry. Everything will come together to create a usable data entry system. | With our tables and relationships created, we are ready to begin work on creating forms for data input. In our next How-To, we will create the forms for data entry. Everything will come together to create a usable data entry system. | ||
** | ** | ||
+ | |||
+ | Créer des relations | ||
+ | |||
+ | Une fois que nous avons défini toutes nos tables, nous pouvons créer les relations qui lient tout ensemble. Nous allons créer des relations entre nos trois principaux tableaux et nos tables de clés étrangères. La direction dans laquelle vous faites glisser les champs est importante, donc attention à la façon dont vous le faites. | ||
+ | |||
+ | Pour lancer la boîte de dialogue de définition de relation (Relation Design), allez dans Tools > Relationships. Une liste de tables apparaît. Choisissez une table et cliquez sur Add pour ajouter la table dans Relation Design. Ajoutez les tables dans l' | ||
+ | |||
+ | Faites glisser le champ BookID de Books vers BookID de BooksAuthors. Une boîte de dialogue Relations s' | ||
+ | |||
+ | Avec nos tables et les relations créées, nous sommes prêts à commencer notre travail sur la création de formulaires de saisie de données. Dans notre prochain tutoriel, nous allons créer les formulaires de saisie de données. L' | ||
issue67/tutoriel_-_libreoffice_p._20.1358182833.txt.gz · Dernière modification : 2013/01/14 18:00 de frangi