Professional Documents
Culture Documents
I. Queries in SQL:
1. List name and gender of stars that appeared in the movie 'Star Wars'.
select name, gender from MovieStar where name IN (select starName from StarsIn where movieTitle LIKE
'Star Wars' )
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
………………………………………………………………………………………………….
2. List all the titles and years of the movies that have appeared in the Movies but have not
been mentioned in StarsIn relation.
……select title, year from dbo.Movies
except
select movieTitle, movieYear from dbo.StarsIn
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………….
3. Find title of movies that are no longer than “Empire Strikes Back”.
……… select title from dbo.Movies where len(title) < len('Empire Strikes Back')
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
…………………………………………………………………………………………….
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
…………………………………………………………………………………………………
5. Delete the movie 'Star Wars', 1977 from the dbo.Movies table.
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
1. Equipment………………………………………………………………………………….
2. Project…………………………………………………………………………….
3. Employee………………………………………………………………………………….
4. Assign……………………………………………………………………………….
5. Many………………………………………………………………………………………….
6. One………………………………………………………………………………………….
7. Work………………………………………………………………………………………….
8. Many………………………………………………………………………………………….
9. Many………………………………………………………………………………………….