This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| c.country, | |
| SUM(s.amount) AS total_ventes | |
| FROM SALES s | |
| JOIN CLIENT c ON s.idcli = c.idcli | |
| GROUP BY c.country | |
| ORDER BY c.country; | |
| ------------------------------------- | |
| SELECT | |
| d.year, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --------- | |
| select EMPLOYEE_NUMBER,Concat(LAST_NAME,' ',FIRST_NAME) as prénom_et_nom,SALARY + coalesce (COMMISSION,0) as salaire_net, | |
| year (CURRENT_TIMESTAMP)-year(birth_date) as age , | |
| year (CURRENT_TIMESTAMP)-year(HIRE_date) as Ancienneté | |
| from EMPLOYEES | |
| where title in ( 'Mr.' , 'Dr.') and SALARY + coalesce (COMMISSION,0) >=8000 | |
| ORDER BY Ancienneté desc | |
| -------- | |
| select product_ref,product_name,supplier_number,quantity,unit_price,CATEGORY_CODE FROM PRODUCTS where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE systeme; | |
| --retrieve table names -- | |
| select name from sys.tables | |
| --Retrieve les données dans chaque table -- | |
| select * from DEPARTEMENT | |
| select * from EMPLOYEE | |
| select* from PROJET | |
| select *from EMPLOYEE_PROJET |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Use systeme; | |
| --1)insertion des données-- | |
| Select * from DEPARTEMENT; | |
| --varchar and text sont insérés entre deux simple guillemets-- | |
| insert into departement (Num_S,Lab_el,_du_manager) | |
| values | |
| (1, 'IT', 'Alice Johnson'), | |
| (2, 'HR', 'Bob Smith'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE DATABASE systeme; | |
| use systeme; | |
| CREATE TABLE DEPARTEMENT ( | |
| Num_S int primary key, | |
| Lab_el NVARCHAR(255) not null, | |
| Nom_du_manager VARCHAR(255) not null); | |
| CREATE TABLE EMPLOYEE ( | |
| Num_E int primary key, |