17. Write the SQL statement that will display the following (do not hardcode 'George', 'Lorraine', or any names, in your statement): | Person | Spouse | George | Lorraine

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter2: Database Design Fundamentals
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question
For the remaining questions, use the following table of people:
people (id (pk), firstname, lastname, spouse_id (fk))
The table was created as:
CREATE TABLE people (id INT NOT NULL AUTO INCREMENT PRIMARY KEY,
firstname VARCHAR(30), lastname VARCHAR (30), spouse id INT,
CONSTRAINT spouse fk FOREIGN KEY (spouse id) REFERENCES people (id));
This is some sample data:
Participation Activity 9
+----
| id | firstname | lastname | spouse_id |
+
1 | Marty
2 | Jennifer
| McFly
| Parker
| McFly
| Tannen
| McFly
|
|
3 | Lorraine
4 | Biff
5 | George
NULL |
NULL |
5 |
NULL |
3 |
+----+--
Transcribed Image Text:For the remaining questions, use the following table of people: people (id (pk), firstname, lastname, spouse_id (fk)) The table was created as: CREATE TABLE people (id INT NOT NULL AUTO INCREMENT PRIMARY KEY, firstname VARCHAR(30), lastname VARCHAR (30), spouse id INT, CONSTRAINT spouse fk FOREIGN KEY (spouse id) REFERENCES people (id)); This is some sample data: Participation Activity 9 +---- | id | firstname | lastname | spouse_id | + 1 | Marty 2 | Jennifer | McFly | Parker | McFly | Tannen | McFly | | 3 | Lorraine 4 | Biff 5 | George NULL | NULL | 5 | NULL | 3 | +----+--
17. Write the SQL statement that will display the following (do not hardcode 'George', 'Lorraine', or any
names, in your statement):
| Person | Spouse
| George | Lorraine
Transcribed Image Text:17. Write the SQL statement that will display the following (do not hardcode 'George', 'Lorraine', or any names, in your statement): | Person | Spouse | George | Lorraine
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr