0% found this document useful (0 votes)
4 views1 page

Devoir Mysql

The document details a series of commands executed in a MariaDB database environment, including dropping and creating databases and tables. A new database named 'DBemployé' is created, and a table with employee details is populated with four records. The commands also include checks for age and salary constraints within the table schema.

Uploaded by

ednerlouis1978
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Devoir Mysql

The document details a series of commands executed in a MariaDB database environment, including dropping and creating databases and tables. A new database named 'DBemployé' is created, and a table with employee details is populated with four records. The commands also include checks for age and salary constraints within the table schema.

Uploaded by

ednerlouis1978
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Last login: Tue Dec 3 11:48:48 on ttys000

desirloudjifny@MacBook-Air-de-DESIR ~ % /applications/xampp/xamppfiles/bin/mysql -u
root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 536
Server version: 10.4.28-MariaDB Source distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> drop database enploye;


Query OK, 0 rows affected, 2 warnings (0.006 sec)

MariaDB [(none)]> drop database DBemployé;


Query OK, 1 row affected, 2 warnings (0.011 sec)

MariaDB [(none)]> drop database employé;


ERROR 1008 (HY000): Can't drop database 'employé'; database doesn't exist
MariaDB [(none)]> system clear;

MariaDB [(none)]> create database DBemployé;


Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> use DBemployé;


Database changed
MariaDB [DBemployé]> Create table DBemployé(
-> Nom char(200) not null,
-> Prenom char(200) not null,
-> Grade char(200) not null,
-> Age int check (age>=18),
-> Salaire decimal(10, 2) check (salaire >=500 and salaire <=1000000)
-> );
Query OK, 0 rows affected (0.014 sec)

MariaDB [DBemployé]> Insert into DBemployé values ('Martin', 'Liza', 'Secrétaire',


28, 19500.00),
-> ('Martin', 'Marc', 'Programmeur', 32, 45300.00),
-> ('Dupond', 'Eric', 'Programmeur II', 45, 75020.00),
-> ('Simon', 'Jean', 'Graphiste', 35, 91032.00);
Query OK, 4 rows affected (0.005 sec)
Records: 4 Duplicates: 0 Warnings: 0

MariaDB [DBemployé]> select *from DBemployé;


+--------+--------+----------------+------+----------+
| Nom | Prenom | Grade | Age | Salaire |
+--------+--------+----------------+------+----------+
| Martin | Liza | Secrétaire | 28 | 19500.00 |
| Martin | Marc | Programmeur | 32 | 45300.00 |
| Dupond | Eric | Programmeur II | 45 | 75020.00 |
| Simon | Jean | Graphiste | 35 | 91032.00 |
+--------+--------+----------------+------+----------+
4 rows in set (0.001 sec)

MariaDB [DBemployé]>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy