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/ 4
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 Server version: 8.2.0 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+ | Database | +--------------------+ | barca | | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.00 sec)
mysql> use barca
Database changed mysql> create table artiste ( -> art_id bigint primary key, -> art_nom varchar(255), -> art_date_naissance date , -> ; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4 mysql> create table artiste ( -> -> art_id bigint primary key, -> -> art_nom varchar(255), -> -> art_date_naissance date )engine=innodb; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-> art_id bigint primary key, -> art_nom varchar(255), -> art_date_naiss' at line 2 mysql> create table artiste ( -> art_id bigint primary key, -> art_nom varchar(255), -> art_date_naissance date )engine=innodb; Query OK, 0 rows affected (0.05 sec)
mysql> desc artiste ;
+--------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------+--------------+------+-----+---------+-------+ | art_id | bigint | NO | PRI | NULL | | | art_nom | varchar(255) | YES | | NULL | | | art_date_naissance | date | YES | | NULL | | +--------------------+--------------+------+-----+---------+-------+ 3 rows in set (0.02 sec) mysql> create table film ( -> film_id bigint primary key, -> film_nom varchar(255), -> film_annee year )engine=innodb; Query OK, 0 rows affected (0.04 sec)
mysql> desc film;
+------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------+ | film_id | bigint | NO | PRI | NULL | | | film_nom | varchar(255) | YES | | NULL | | | film_annee | year | YES | | NULL | | +------------+--------------+------+-----+---------+-------+ 3 rows in set (0.01 sec)
+------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------+ | film_id | bigint | NO | PRI | NULL | | | film_nom | varchar(255) | YES | | NULL | | | film_annee | year | YES | | NULL | | | film_genre | varchar(255) | YES | | NULL | | +------------+--------------+------+-----+---------+-------+ 4 rows in set (0.00 sec)
mysql> alter table change film_nom film_titre varchar(255) ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change film_nom film_titre varchar(255)' at line 1 mysql> alter table film change film_nom film_titre varchar(255) ; Query OK, 0 rows affected (0.05 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql> desc film ;
+------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------+ | film_id | bigint | NO | PRI | NULL | | | film_titre | varchar(255) | YES | | NULL | | | film_annee | year | YES | | NULL | | | film_genre | varchar(255) | YES | | NULL | | +------------+--------------+------+-----+---------+-------+ 4 rows in set (0.00 sec)
mysql> alter table film modify column film_titre text ;