Aid sur une requete
yuri648
Messages postés
785
Statut
Membre
-
yuri648 Messages postés 785 Statut Membre -
yuri648 Messages postés 785 Statut Membre -
Bonjour,
je ne sai pas comment faire cette requete
-Find all the makers who have all their models of PC type in the PC table.
voila le model relationnel
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, screen, price)
Printer(code, model, color, type, price)
et merci d'avence
je ne sai pas comment faire cette requete
-Find all the makers who have all their models of PC type in the PC table.
voila le model relationnel
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, screen, price)
Printer(code, model, color, type, price)
et merci d'avence
A voir également:
- Aid sur une requete
- Registry first aid - Télécharger - Optimisation
- Aid 64 extreme - Télécharger - Informations & Diagnostic
- Quelle requête écrire pour demander au moteur de recherche de présenter de préférence les pages web traitant de tennis mais pas de tennis de table ✓ - Forum Java
- L'opérateur ou l'administrateur a refusé la requête ✓ - Forum Windows
- Erreur d'exécution de la requete erreur inconnue - Forum Framework .NET
10 réponses
pouvez vous nous expliquer les relations entre ces tables
BadBoy3
Messages postés
128
Statut
Membre
15
je pense que les relation sont claire!!!!!!! juste voir les proprité doublant dans chaque une des tables
select product.maker from product where maker not in (select product.maker from product where product.model not in (select pc.model from pc) and type="pc")
voila quelque explication:
The table "Product" includes information about the maker, model number, and type ('PC', 'Laptop', or 'Printer'). It is assumed that model numbers in the Product table are unique for all the makers and product types. Each PC uniquely specifying by a code in the table "PC" is characterized by model (foreign key referencing to Product table), speed (of the processor in MHz), total amount of RAM - ram (in Mb), hard disk drive capacity - hd (in Gb), CD ROM speed - cd (for example, '4x'), and the price. The table "Laptop" is similar to that one of PCs except for the CD ROM speed, which is replaced by the screen size - screen (in inches). For each printer in the table "Printer" it is told whether the printer is color or not (color attribute is 'y' for color printers; otherwise it is 'n'), printer type (laser, jet, or matrix), and the price.
The table "Product" includes information about the maker, model number, and type ('PC', 'Laptop', or 'Printer'). It is assumed that model numbers in the Product table are unique for all the makers and product types. Each PC uniquely specifying by a code in the table "PC" is characterized by model (foreign key referencing to Product table), speed (of the processor in MHz), total amount of RAM - ram (in Mb), hard disk drive capacity - hd (in Gb), CD ROM speed - cd (for example, '4x'), and the price. The table "Laptop" is similar to that one of PCs except for the CD ROM speed, which is replaced by the screen size - screen (in inches). For each printer in the table "Printer" it is told whether the printer is color or not (color attribute is 'y' for color printers; otherwise it is 'n'), printer type (laser, jet, or matrix), and the price.
la requete que vous m'avez donné Mr redlifebig elle me revois les maker qui 'ont au moin un pc dans la tables pc je l'ai essayé sur la console ;
merci
merci
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Bonjour
dans la requête que je t'ai donné
SR1:(select product.maker from product where product.model not in (select pc.model from pc) and type="pc")
nous renvoie tous les product maker qui on au moin un pc qui n'est pas dans la table pc après je fais
Select product.maker from product where maker not in SR1
donc les maker qui on tous les pc dans la table PC verifie de nouveau n'oublie pas NOT IN
dans la requête que je t'ai donné
SR1:(select product.maker from product where product.model not in (select pc.model from pc) and type="pc")
nous renvoie tous les product maker qui on au moin un pc qui n'est pas dans la table pc après je fais
Select product.maker from product where maker not in SR1
donc les maker qui on tous les pc dans la table PC verifie de nouveau n'oublie pas NOT IN
Bonjour
moi j'execute la requet sur une table mysql voici le schema
/*Table structure for table `pc` */
DROP TABLE IF EXISTS `pc`;
CREATE TABLE `pc` (
`code` varchar(50) default NULL,
`model` varchar(50) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `pc` */
insert into `pc`(`code`,`model`) values ('1','a');
/*Table structure for table `product` */
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`maker` varchar(20) default NULL,
`model` varchar(20) default NULL,
`type` varchar(20) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `product` */
insert into `product`(`maker`,`model`,`type`) values ('g','a','PC'),('g','z','Laptop'),('g','b','PC'),('f','a','PC');
et voici la requete
Select distinct product.maker from product where maker not in (select product.maker from product where product.model not in (select pc.model from pc) and type='PC')
ça marche, maintenant que ça marche pas sur le site je ne sais pas pourquoi
Cordialement
moi j'execute la requet sur une table mysql voici le schema
/*Table structure for table `pc` */
DROP TABLE IF EXISTS `pc`;
CREATE TABLE `pc` (
`code` varchar(50) default NULL,
`model` varchar(50) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `pc` */
insert into `pc`(`code`,`model`) values ('1','a');
/*Table structure for table `product` */
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`maker` varchar(20) default NULL,
`model` varchar(20) default NULL,
`type` varchar(20) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `product` */
insert into `product`(`maker`,`model`,`type`) values ('g','a','PC'),('g','z','Laptop'),('g','b','PC'),('f','a','PC');
et voici la requete
Select distinct product.maker from product where maker not in (select product.maker from product where product.model not in (select pc.model from pc) and type='PC')
ça marche, maintenant que ça marche pas sur le site je ne sais pas pourquoi
Cordialement
meme je me suis douter du site qu'il marche pas bien
en tout cas j'ai compris le principe et merci bcp
en tout cas j'ai compris le principe et merci bcp