Presentation is loading. Please wait.

Presentation is loading. Please wait.

Practical Questions Movie (Title, Year, Length, inColor, StudioName, Producer) Give the SQL Statement that produced the outcome for the following query.

Similar presentations


Presentation on theme: "Practical Questions Movie (Title, Year, Length, inColor, StudioName, Producer) Give the SQL Statement that produced the outcome for the following query."— Presentation transcript:

1 Practical Questions Movie (Title, Year, Length, inColor, StudioName, Producer) Give the SQL Statement that produced the outcome for the following query from the above mention Relation. 1.Find all the movies that produced by Disney Studios in 1990. 2.Modify the above query (Q1) to produce only the movie title and length 3.Modify the above query (Q2) to produce a relation with attributes Name and Duration in place of title and length. 4.Modify the above query(Q3) to produced length in hours 5.Find all movies made after 1970 that are in black and white 6.Find the titles of the movies made by MGM Studios that either were made after 1970 or were less than 90 minutes long. 7.Search for all movies with a possessive (‘s) in their titles 8.List the Disney movies of 1990 from the relation by length, shortest first and among movies of equal length alphabetically.

2 1. Find all the movies that produced by Disney Studios in 1990. SELECT * FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990

3 2. Modify the above query (Q1) to produce only the movie title and length SELECT Title, Length FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990;

4 3. Modify the above query (Q2) to produce a relation with attributes Name and Duration in place of title and length. SELECT Title AS Name, Length AS Duration FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990;

5 4. Modify the above query(Q3) to produced length in hours SELECT Title AS Name, Length/60 AS LengthInHours FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990;

6 5. Find all movies made after 1970 that are in black and white SELECT Title FROM Movie WHEREYear > 1970 AND NOT inColor;

7 6. Find the titles of the movies made by MGM Studios that either were made after 1970 or were less than 90 minutes long. SELECT Title FROM Movie WHERE(Year > 1990 OR Length <90) AND StudioName = ‘MGM’;

8 7. Search for all movies with a possessive (‘s) in their titles SELECT Title FROM Movie WHERETitle LIKE ‘%’’s’;

9 List the Disney movies of 1990 from the relation by length, shortest first and among movies of equal length alphabetically. SELECT * FROM Movie WHEREstudioName = ‘Disney’ AND Year = 1990 ORDER BY Length, title;


Download ppt "Practical Questions Movie (Title, Year, Length, inColor, StudioName, Producer) Give the SQL Statement that produced the outcome for the following query."

Similar presentations


Ads by Google