NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

--1) Titanic filmi için kullanılan oy sayısı ve puan bilgisini ekrana yazdırınız.
use Film
go

SELECT votes, score
FROM Movie
WHERE title='Titanic'

--select votes, score
--from movie
--where title='Titanic'

--2) Robert De Niro'nun oynadığı filmlerin isimlerini ekrana yazdırınız
SELECT title
FROM (Movie INNER JOIN Casting ON Movie.id=Casting.movieid)
INNER JOIN Actor ON Casting.actorid=Actor.id
WHERE name='Robert De Niro'

--select title
--from (movie inner join Casting on movie.id=Casting.movieid)inner join Actor on Casting.actorid=Actor.id
--where name='Robert De Niro'


--3) Rob Reiner isimli aktörün oynadığı filmlerin başrol oyuncularını yazdırınız.
SELECT name
FROM Actor
WHERE id IN(
SELECT actorid
FROM Casting
WHERE movieid in (
SELECT movieid
FROM (Movie INNER JOIN Casting ON Movie.id=Casting.movieid)
INNER JOIN Actor ON Casting.actorid=Actor.id
WHERE name='Rob Reiner'
) AND ord=1
)

--select name
--from Actor
--where id in (
--select actorid
--from Casting
--where movieid in(
--select actorid
--from (Movie inner join Casting on Movie.id=Casting.movieid) inner join Actor on Casting.actorid=Actor.id
--where name='Rob Reiner'
--) and ord=1
--)
--4) Star Wars filmlerinin isimlerini ve yıllarını ekrana yazdırınız
SELECT title, yr
FROM Movie
WHERE title LIKE 'Star Wars%'

--select title,yr
--from Movie
--where title like 'Star Wars%'


--5) Tom Cruise ile birlikte yrol almış bütün aktörlerin isimlerini yazdırınız

--select name
--from Actor
--where id in(select actorid
-- from Casting
-- where movieid in
-- (select movieid
-- from (Movie inner join Casting on Movie.id=Casting.movieid) inner join Actor on Casting.actorid=Actor.id
-- where name='Tom Cruise'
-- ))
-- and id not in(select id
-- from Actor
-- where name='Tom Cruise')




SELECT name
FROM Actor
WHERE id IN (
SELECT actorid/*Film ıd sinden Actorid buluyoruz*/
FROM Casting
WHERE movieid IN (
SELECT movieid /*tom cruisenin oynadığı filim Id si*/
FROM (Movie INNER JOIN Casting ON Movie.id=Casting.movieid)
INNER JOIN Actor ON Casting.actorid=Actor.id
WHERE name='Tom Cruise'
)

)

AND id NOT IN (/*tomCruise yi çıkartıyoruz*/
SELECT id
FROM Actor
WHERE name='Tom Cruise'
)


--6) Casablanca filminin yılını ve skorunu ekrana yazdırınız
--Select yr,score
--from Movie
--where title='Casablanca'

SELECT yr,score
FROM Movie
WHERE title='Casablanca'

--7) Angelina Jolie 'nin oynadığı filmlerin isimlerini ekrana yazdırınız.
--select title
--from (Movie inner join Casting on Movie.id=Casting.movieid) inner join Actor on Casting.actorid=Actor.id
--where name='Angelina Jolie'

SELECT title
FROM (Movie INNER JOIN Casting ON Movie.id=Casting.movieid)
INNER JOIN Actor ON Casting.actorid=Actor.id
WHERE name='Angelina Jolie'

--8) Robin Williams ve Tom Hanks'in berarber oynadığı filmleri ekrana yazdırınız

--Select title
--from (Movie inner join Casting on Movie.id=Casting.movieid)inner join Actor on Casting.actorid=Actor.id
--where name= ' Robin Williams'
--intersect
--select title
--from (Movie inner join Casting on Movie.id=Casting.movieid)inner join Actor on Casting.actorid=Actor.id
--where name='Tom Hanks'

SELECT title
FROM (Movie INNER JOIN Casting ON Movie.id=Casting.movieid)
INNER JOIN Actor ON Casting.actorid=Actor.id
WHERE name='Robbin Williams'
INTERSECT
SELECT title
FROM (Movie INNER JOIN Casting ON Movie.id=Casting.movieid)
INNER JOIN Actor ON Casting.actorid=Actor.id
WHERE name='Tom Hanks'

--9) Terminator filmlerinin isimlerini ve yıllarını ekrana yazdrınız.
--Select title,yr
--from Movie
--where title like 'Terminator%'

SELECT title, yr
FROM Movie
WHERE title LIKE 'Terminator%'

--10) Johnny Depp 'in oynadığı filmlerin yönetmenlerini ekrana yazdırınız

--select name
--from Actor
--where id in(select director
-- from (Movie inner join Casting on Movie.id=Casting.movieid)inner join Actor on Casting.actorid=Actor.id
-- where name='Johnny Depp')
SELECT name
FROM Actor
WHERE id IN (
SELECT director
FROM (Movie INNER JOIN Casting ON Movie.id=Casting.movieid)
INNER JOIN Actor ON Casting.actorid=Actor.id
WHERE name='Johnny Depp'
)
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.