Вы находитесь на странице: 1из 2

create table film(idfilm integer primary key,titre varchar(14),nom varchar(14),a

nnee integer);
create table acteur(idacteur integer primary key,nom varchar(14),prenom varchar(
14));
create table filmographie(idacteur integer primary key,idfilm integer,role varc
har(14),salaire float(7,2));
/*****pour modifier les 2 cl******/
ALTER TABLE `filmographie`
DROP PRIMARY KEY,
ADD PRIMARY KEY(
`idacteur`,
`idfilm`);
/*****changement de varchar a text*************/
ALTER TABLE `film` CHANGE `titre` `titre` TEXT CHARACTER SET latin1 COLLATE lati
n1_swedish_ci NULL DEFAULT NULL;
///****ajouter film
INSERT INTO film VALUES
(1,'Les evads','Drabon',1994),
(2,'Le parrain','Coppola',1972),
(3,'Le parrain','Coppola',1972),
(4,'Lodysse de Pi','Ang Lee',2013);
/*****afichage des films
SELECT * from film
///question 4 ajout des films suivants
INSERT INTO film VALUES
(5,'Chocolat','Hallstrom',2000),
(6,'Scarface','De Palma',1983),
(7,'Rango','Verbinski',2011);
/***question 5 affichage des titre et cle des films
SELECT idFilm,titre FROM film
/*****Insertion de acteur
Insert INTO acteur VALUES
(1,'Johnny','Deep'),
(2,'Al','Pacino'),
(3,'Suraj','Sharma'),
(4,'Brad','Pitt'),
(5,'Edwar','Norton');
/*******************************
11---Filmographie
Insert INTO filmographie VALUES
(1,5,'Roux',5000),
(1,7,'Rango',10000),
(2,2,'Michael Corleone',10000),
(2,3,'Michael Corleone',20000),
(2,6,'Tony Montana',15000),
/***
voir le nombre des film jou par Johhhny
Select idfilm from filmographie where idacteur=1
(3,4,'Pi',20000);
Select titre from film,acteur,filmographie where filmographie.idacteur=
/*****
Select idacteur from acteur where nom='Johnny'
/******affichage de titre jou par johnny
Select titre
from film,filmographie
where
film.idfilm=filmographie.idfilm
and idacteur=(Select idacteur from acteur where nom='johnny');
/*****realisateur
SELECT titre from film where realisateur=(SELECT realisateur from film where tit

re='Le parrain')
/*******tt qui commence par de
SELECT titre from film
where titre like'Le%';
/*******de ou le
SELECT titre from film
where titre like'Le%'
or titre like 'de%';
/*******
SELECT titre from film
order by annee desc
/***********************nombre acteur
SELECT count(idacteur) from filmographie
where
idfilm=(Select idfilm from film where titre='Lodysse de Pi');

Вам также может понравиться

  • Corriges Des Exercices Sur La Loi de Poisson
    Corriges Des Exercices Sur La Loi de Poisson
    Документ32 страницы
    Corriges Des Exercices Sur La Loi de Poisson
    Mourad Bouiga
    62% (13)
  • Stru Alg PDF
    Stru Alg PDF
    Документ54 страницы
    Stru Alg PDF
    Ouijdane Tabti
    Оценок пока нет
  • Statistique
    Statistique
    Документ143 страницы
    Statistique
    Imad Hakkache
    100% (1)
  • TD N°4-1
    TD N°4-1
    Документ13 страниц
    TD N°4-1
    Imad Hakkache
    Оценок пока нет
  • Mission Intégration PFE
    Mission Intégration PFE
    Документ1 страница
    Mission Intégration PFE
    Imad Hakkache
    Оценок пока нет
  • Fiche Technique - Entreprise OCP
    Fiche Technique - Entreprise OCP
    Документ2 страницы
    Fiche Technique - Entreprise OCP
    Imad Hakkache
    85% (13)
  • Student
    Student
    Документ10 страниц
    Student
    Imad Hakkache
    Оценок пока нет
  • Cours 12
    Cours 12
    Документ9 страниц
    Cours 12
    Imad Hakkache
    Оценок пока нет
  • Autres Lois de Probabilite
    Autres Lois de Probabilite
    Документ17 страниц
    Autres Lois de Probabilite
    Imad Hakkache
    Оценок пока нет
  • Lois Pms
    Lois Pms
    Документ25 страниц
    Lois Pms
    simao_sabrosa7794
    Оценок пока нет
  • Cours 5
    Cours 5
    Документ29 страниц
    Cours 5
    Imad Hakkache
    Оценок пока нет
  • Readme
    Readme
    Документ2 страницы
    Readme
    Imad Hakkache
    Оценок пока нет
  • Demande Manuscrite
    Demande Manuscrite
    Документ4 страницы
    Demande Manuscrite
    Imad Hakkache
    Оценок пока нет
  • Demande Manuscrite
    Demande Manuscrite
    Документ4 страницы
    Demande Manuscrite
    Imad Hakkache
    Оценок пока нет
  • Demande Manuscrite
    Demande Manuscrite
    Документ4 страницы
    Demande Manuscrite
    Imad Hakkache
    Оценок пока нет
  • Les Vlans
    Les Vlans
    Документ14 страниц
    Les Vlans
    Imad Hakkache
    Оценок пока нет
  • Qcmcorr 2004
    Qcmcorr 2004
    Документ2 страницы
    Qcmcorr 2004
    Imad Hakkache
    Оценок пока нет
  • Cinématique Des Solides - TD2 Enoncé
    Cinématique Des Solides - TD2 Enoncé
    Документ3 страницы
    Cinématique Des Solides - TD2 Enoncé
    Imad Hakkache
    Оценок пока нет
  • JAVA
    JAVA
    Документ4 страницы
    JAVA
    Melina Marine
    Оценок пока нет
  • Maillage2d3d Annexe1
    Maillage2d3d Annexe1
    Документ1 страница
    Maillage2d3d Annexe1
    Imad Hakkache
    Оценок пока нет
  • Support Dossier Inscription
    Support Dossier Inscription
    Документ3 страницы
    Support Dossier Inscription
    Imad Hakkache
    Оценок пока нет
  • SMI5 2010 Etudiants
    SMI5 2010 Etudiants
    Документ27 страниц
    SMI5 2010 Etudiants
    Rfx Bzx
    100% (1)
  • Dosi Me Trie
    Dosi Me Trie
    Документ107 страниц
    Dosi Me Trie
    Imad Hakkache
    Оценок пока нет
  • Fsab1104 Cours7
    Fsab1104 Cours7
    Документ38 страниц
    Fsab1104 Cours7
    Imad Hakkache
    Оценок пока нет
  • 4dc3 2009
    4dc3 2009
    Документ2 страницы
    4dc3 2009
    Imad Hakkache
    Оценок пока нет