Create the following table in your database with the following schema: Table: Customer +- | Column Name | Type +. | id | int | varchar | | int | name | referee id +- ---+ id is the primary key column for this table. Each row of this table indicates the id of a customer, their name, and the id of the customer who referred them. Add the following data to your tables: Input: Customer table: +----+----- | id | name | referee id | +----+------ | 1 | 2 | 3 | 4 | 5 | 6 | will | null | Jane | null | Alex | 2 | Bill | null | Zack | 1 | Mark | 2 +--- Write an SQL query to report the IDs of the customer that are not referred by the customer with id 2.
Create the following table in your database with the following schema: Table: Customer +- | Column Name | Type +. | id | int | varchar | | int | name | referee id +- ---+ id is the primary key column for this table. Each row of this table indicates the id of a customer, their name, and the id of the customer who referred them. Add the following data to your tables: Input: Customer table: +----+----- | id | name | referee id | +----+------ | 1 | 2 | 3 | 4 | 5 | 6 | will | null | Jane | null | Alex | 2 | Bill | null | Zack | 1 | Mark | 2 +--- Write an SQL query to report the IDs of the customer that are not referred by the customer with id 2.
Chapter4: Constraints
Section: Chapter Questions
Problem 11MC: In the initial creation of a table, if a UNIQUE constraint is included for a composite column that...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
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.Recommended textbooks for you
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning