---
# System prepended metadata

title: Untitled
tags: [BACK]

---

##SQL command:
--creation table
CREATE TABLE dog(
    -> id INT PRIMARY KEY AUTO_INCREMENT,
    -> name VARCHAR(255) NOT NULL,
    -> breed VARCHAR(255),
    -> birthdate DATE);

--ajout de  chien dans la table
INSERT INTO dog (name,breed,birthdate) VALUES ('Fido','Corgi', '2021-04-24'), ('Rex', 'Daschund', '2019-10-15'), ('Jean Marc', 'German Shepard', '2021-07-28'), ('Fido', 'Poodle', '2010-01-05'), ('Max', 'Corgi', '2018-04-01');

-- les différents select
SELECT * FROM dog;

SELECT * FROM dog WHERE name='Fido';

SELECT * FROM dog WHERE name='fido' AND breed='corgi';

SELECT * FROM dog WHERE birthdate > '2021-01-01';

SELECT * FROM dog WHERE birthdate BETWEEN '2015-01-01' AND '2021-12-31';
SELECT * FROM dog WHERE birthdate > '2015-01-01' AND  birthdate <'2021-12-31';

SELECT * FROM dog WHERE name LIKE 'f%';

SELECT * FROM dog ORDER BY breed;

SELECT * FROM dog ORDER BY birthdate DESC;

###### tags: `BACK`