
/* Chapter 6 - Try It Out sections */


/* Try It Out: Using UPDATE Statements to Modify Data in Joined Tables */

UPDATE DVDs, Studios
SET DVDs.StatID='s2'
WHERE DVDs.StudID=Studios.StudID
   AND Studios.StudDescrip='Metro-Goldwyn-Mayer';



/*Try It Out: Using the <from join delete> Alternative to Delete Data from the DVDRentals Database*/

DELETE DVDs
FROM DVDs, Studios
WHERE DVDs.StudID=Studios.StudID
   AND Studios.StudDescrip='New Line Cinema';


DELETE DVDs
FROM DVDs, Studios
WHERE DVDs.StudID=Studios.StudID
   AND Studios.StudDescrip='Metro-Goldwyn-Mayer';



/* Using the <using join delete> Alternative to Delete Data from the DVDRentals Database */

DELETE FROM DVDs
USING DVDs, Studios
WHERE DVDs.StudID=Studios.StudID
   AND Studios.StudDescrip='New Line Cinema';


DELETE FROM DVDs
USING DVDs, Studios
WHERE DVDs.StudID=Studios.StudID
   AND Studios.StudDescrip='Metro-Goldwyn-Mayer';


