1.Movies with duration more than 90 minutes. 

DELIMITER $$
 CREATE DEFINER=`root`@`localhost` PROCEDURE `routin`(IN `num` INT)
BEGIN 
 pikkus, filmNimetus
 FROM film 
 WHERE pikkus > num;
END$$
 DELIMITER ;

2. Was inserted a new genre of movies *Documentary*

INSERT INTO zanr(zanrID, zanrNimi, zanrKirjeldus)
VALUES(11,'Dokumentaal','filmid, mis põhinevad tõsistel sündmustel ja inimestel');

3.Has been added a new column price with discount

ALTER TABLE kinokava 
 ADD COLUMN soodushind INT(10)

3.1 Have chancged type of data for column discount to add written information about discount

ALTER TABLE kinokava 
 CHANGE soodushind soodushind VARCHAR(200);

3.2 has been inputted constant discount

ALTER TABLE kinokava
 ADD sooduhind TEXT default "soodustus kõigile   kliendikaardiga filmidele 15%";

3.3 We have updated discount option where kinokavaID=3

UPDATE kinokava SET 
    soodushind='sünnipäeva allahindlus 50%'
    WHERE kinokavaID=3

4. To the table director was added the column awards

ALTER TABLE rezisoor 
 ADD  auhind TEXT default"Palme d'Or";

4.1  we’ve used the opportunity to change all rows in the column awards with the help of the query UPDATE/SET/CASE/ELSE/END/WHEN/THEN

UPDATE rezisoor SET auhind = CASE rezisoorID
  WHEN 1 THEN 'Gold palme'
  WHEN 2 THEN 'Grand Jury Award'
  WHEN 3 THEN 'Grand Prize of the Festival'
  WHEN 4 THEN 'Favorite Movie'
  WHEN 5 THEN 'Best director'
  WHEN 6 THEN 'Grammy award'
ELSE auhind END

5. opportunity to add a language

BEGIN 
 INSERT INTO keel(keelNimi, keelNimiVene,      keelNimiInglise)
 VALUES(name,vene,Inglise );
 SELECT * from keel;
END

No responses yet

Lisa kommentaar

Sinu e-postiaadressi ei avaldata. Nõutavad väljad on tähistatud *-ga