A voir également:
- Requêts SQL a partie d'un problème en anglais
- Creer un groupe whatsapp a partir d'un autre groupe - Guide
- Nbcar en anglais - Guide
- @ Clavier anglais - Guide
- Nouvelle partie pokemon x ✓ - Forum DS
- Corbeille en anglais - Guide
3 réponses
halo_quebec
Messages postés
161
Date d'inscription
samedi 14 avril 2007
Statut
Membre
Dernière intervention
9 juin 2010
10
14 déc. 2008 à 20:20
14 déc. 2008 à 20:20
Essaye sa pour le #1
SELECT PROJECTID, COUNT(BATCHNO)
FROM REACTION
GROUP BY PROJECT ID;
SELECT PROJECTID, COUNT(BATCHNO)
FROM REACTION
GROUP BY PROJECT ID;
Je suis pas très doué en SQL mais je crois que du coup on prend pas tout les PROJECTID, il y en a dans d'autres tables
J'ai essayé ça mais je sais pas si c'est bon. Pouvez vous me donner un avis ?
1.
Write the SQL statement that provides a list of all projects (PROJECTID) and the total number of batches for each.
SELECT PROJECTID, COUNT(BATCHNO)
FROM REACTION
GROUP BY PROGECTID;
2.
Write the SQL statement that provides a list of all projects (PROJECTID) and the total number of biological results for each.
SELEST PROJECTID, COUNT(BIODATAID)
FROM SAMPLE_DATA
GROUP BY PRIJECTID;
3.
Write the SQL statement that provides a list of all the compounds (COMPID) and the total number of batches and samples for each.
SELECT COMPID, COUNT(BATCHNO), COUNT(ANALYTICALID)
FROM BIOLOGICAL_DATA D, SAMPLE_DATA S
WHERE B. ANALYTICALID = S. ANALYTICALID
GROUP BY COMPID;
4.
Write the SQL statement that provides a list of all the batches (BATCHNO) that has an average purity > 50 for samples with a quantity > 10.
SELECT BATCHNO
FROM BIOLOGICAL_DATA D, SAMPLE_DATA S
WHERE B. ANALYTICALID = S. ANALYTICALID
AND S.PURITY > 50
AND S.QUANTITY > 10.
5.
Write the SQL statement that provides a list of all the batches (BATCHNO) with no biological data.
SELECT BATCHNO
FROM REACTION R, BIOLOGICAL_DATA D
WHERE R. BATCHNO <> D. BATCHNO
1.
Write the SQL statement that provides a list of all projects (PROJECTID) and the total number of batches for each.
SELECT PROJECTID, COUNT(BATCHNO)
FROM REACTION
GROUP BY PROGECTID;
2.
Write the SQL statement that provides a list of all projects (PROJECTID) and the total number of biological results for each.
SELEST PROJECTID, COUNT(BIODATAID)
FROM SAMPLE_DATA
GROUP BY PRIJECTID;
3.
Write the SQL statement that provides a list of all the compounds (COMPID) and the total number of batches and samples for each.
SELECT COMPID, COUNT(BATCHNO), COUNT(ANALYTICALID)
FROM BIOLOGICAL_DATA D, SAMPLE_DATA S
WHERE B. ANALYTICALID = S. ANALYTICALID
GROUP BY COMPID;
4.
Write the SQL statement that provides a list of all the batches (BATCHNO) that has an average purity > 50 for samples with a quantity > 10.
SELECT BATCHNO
FROM BIOLOGICAL_DATA D, SAMPLE_DATA S
WHERE B. ANALYTICALID = S. ANALYTICALID
AND S.PURITY > 50
AND S.QUANTITY > 10.
5.
Write the SQL statement that provides a list of all the batches (BATCHNO) with no biological data.
SELECT BATCHNO
FROM REACTION R, BIOLOGICAL_DATA D
WHERE R. BATCHNO <> D. BATCHNO