KEMBAR78
Solution 4 SQL Code | PDF
0% found this document useful (0 votes)
7 views1 page

Solution 4 SQL Code

The document contains SQL queries for selecting names and birth dates of directors and actors. The first query retrieves all names and birth dates, ordered by date of birth, while the second query filters for those born in the 1960s, ordered by last name. Both queries use UNION ALL to combine results from directors and actors.

Uploaded by

Wipro pvt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Solution 4 SQL Code

The document contains SQL queries for selecting names and birth dates of directors and actors. The first query retrieves all names and birth dates, ordered by date of birth, while the second query filters for those born in the 1960s, ordered by last name. Both queries use UNION ALL to combine results from directors and actors.

Uploaded by

Wipro pvt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 1

-- 1. Select the first names, last names and dates of birth from directors and actors.

-- Order the results by the date of birth.

SELECT first_name, last_name, date_of_birth FROM directors


UNION ALL
SELECT first_name, last_name, date_of_birth FROM actors
ORDER BY date_of_birth;

-- 2. Select the first and last names of all directors and actors born in the 1960s.
-- Order the results by last name.

SELECT first_name, last_name FROM directors


WHERE date_of_birth BETWEEN '1960-01-01' AND '1969-12-31'
UNION ALL
SELECT first_name, last_name FROM actors
WHERE date_of_birth BETWEEN '1960-01-01' AND '1969-12-31'
ORDER BY last_name;

You might also like