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

Create Database SyntaxeDQL 2

Uploaded by

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

Create Database SyntaxeDQL 2

Uploaded by

Cellou Diallo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

create database cellou;


use cellou;
create table customer(
customer_id int primary key not null,
customer_name varchar(30) not null,
customer_tel varchar(20) not null
);
create table product(
product_id int primary key not null,
product_name varchar(30) not null,
category varchar(20) not null,
prix float
);
create table orders(
customer_id int foreign key references customer (customer_id) not null,
product_id int foreign key references product(product_id) not null,
order_date date,
quantity int,
total_amount float
);
2.
INSERT INTO customer VALUES(1,'Fall', '547657' ) ,(2, 'fatou' , '436578');
SELECT *FROM customer;
INSERT INTO product VALUES(4 ,'gel', 'bien-etre', 10) ,(8, 'sirop', 'sante' ,
15.2);
SELECT *FROM product;
INSERT INTO orders VALUES(1,4,'2024-02-28', 6, 105) ,(2, 8, '2024-02-29' ,4,
75.2);
SELECT *FROM orders;

You might also like