20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 8<br />

238<br />

FilmName PlotSummary Email<br />

The Dirty Half Dozen Six men go to war wearing unwashed uniforms. katie@mail.com<br />

The horror!<br />

On Golden Puddle A couple finds love while wading through a puddle. katie@mail.com<br />

The Lion, the Witch, and A fun film for all those interested in zoo/<br />

the Chest of Drawers magic/furniture drama. katie@mail.com<br />

Nightmare on Oak Street, The murderous Terry stalks Oak Street. katie@mail.com<br />

Part 23<br />

The Wide-Brimmed Hat Fascinating life story of a wide-brimmed hat katie@mail.com<br />

Sense and Insensitivity She longs for a new life with Mr. Arcy; he longs katie@mail.com<br />

for a small cottage in the Hamptons.<br />

Planet of the Japes Earth has been destroyed, to be taken over by katie@mail.com<br />

a species of comedians.<br />

The Maltese Poodle A mysterious bite mark, a guilty-looking poodle. katie@mail.com<br />

First-class thriller.<br />

One Flew over the Life and times of a scary crow. katie@mail.com<br />

Crow’s Nest<br />

Raging Bullocks A pair of bulls get cross with each other. katie@mail.com<br />

The Life of Bob A seven-hour drama about Bob’s life. What fun! katie@mail.com<br />

Gone with the Window Historical documentary on window cleaners. katie@mail.com<br />

Cleaner Thrilling.<br />

The Good, the Bad, and Joe seeks plastic surgery in this spaghetti Western. katie@mail.com<br />

the Facially Challenged<br />

15th Late Afternoon One of Shakespeare’s lesser-known plays katie@mail.com<br />

Soylent Yellow Detective Billy Brambles discovers that Soylent katie@mail.com<br />

Yellow is made of soya bean. Ewwww!<br />

The preceding results are a combination of FilmName and PlotSummary from the Films table and the<br />

results of the subquery, which is the email address of the member with an ID of 1.<br />

If, however, you change the MemberDetails table to the Attendance table, where MemberId appears<br />

more than once, you get the following query:<br />

SELECT FilmName, PlotSummary,<br />

(SELECT MeetingDate FROM Attendance WHERE MemberId = 1)<br />

FROM Films;<br />

Executing this query results in an error message similar to the following:<br />

“Subquery returned more than 1 value. This is not permitted when the subquery<br />

follows =, !=, = or when the subquery is used as an expression.”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!