How to create a SELECT statement involving a subtypeSupertype/Subtype deciding between category: complete...
How do I fight with Heavy Armor as a Wizard with Tenser's Transformation?
Is practicing on a digital piano harmful to an experienced piano player?
In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?
How can I differentiate duration vs starting time
How to know if I am a 'Real Developer'
Minimum Viable Product for RTS game?
Was Opportunity's last message to Earth "My battery is low and it's getting dark"?
Can I legally make a website about boycotting a certain company?
What happened to Hermione’s clothing and other possessions after she wiped her parents’ memories of her?
In a post-apocalypse world, with no power and few survivors, would Satnav still work?
Are there historical references that show that "diatonic" is a version of 'di-tonic' meaning 'two tonics'?
How do I find the distance from a point to a plane?
Coworker asking me to not bring cakes due to self control issue. What should I do?
Modern Algebraic Geometry and Analytic Number Theory
"I showed the monkey himself in the mirror". Why is this sentence grammatical?
How to deal with an underperforming subordinate?
Boss asked me to sign a resignation paper without a date on it along with my new contract
What dissuades people from lying about where they live in order to reduce state income taxes?
What does an unprocessed RAW file look like?
Performance and power usage for Raspberry Pi in the Stratosphere
If I tried and failed to start my own business, how do I apply for a job without job experience?
Sticky Strike or Sticky Delta
How can I put a period right after the algorithm's number in the algorithm's title?
What are some ways of extending a description of a scenery?
How to create a SELECT statement involving a subtype
Supertype/Subtype deciding between category: complete disjoint or incomplete overlappingHow to avoid duplicate entries with SELECT statement?Select Information from All TablesCategory entity relationship / subtype relationships designRepresenting a Superclass/Subclass (or Supertype-Subtype) relationship in a MySQL Workbench diagramModeling Subclass (or Subtype) Constraints in an Entity-Relationship DiagramImplementing subtype of a subtype in type/subtype design pattern with mutually exclusive subclassesDynamic result in select statement mysqlInternationalization of a Supertype-subtypeHow to handle a table schema with a new relationship subtype in an interviews scenario?
Okay, so all I'm trying to do here is "list" the managers who supervised the employee that charged a customer $100 for a rental on November 1st, 1998.
My issue is that I don't know how to select the managers' name because they're listed under MANAGER, which is a subtype of the EMPLOYEE supertype. I've posted my EER diagram below:
mysql select erd subtypes
add a comment |
Okay, so all I'm trying to do here is "list" the managers who supervised the employee that charged a customer $100 for a rental on November 1st, 1998.
My issue is that I don't know how to select the managers' name because they're listed under MANAGER, which is a subtype of the EMPLOYEE supertype. I've posted my EER diagram below:
mysql select erd subtypes
1
The diagram is helpful, but is difficult to read. What can you do to provide clarity. Reducing your diagram focus on the main question would be helpful. FWIW Based on the diagram, I suspect that the Manager_ID is likely the same as the Employeer_ID of the manager as indicated by the relationship with the (D). Just guessing of course.
– RLF
Jan 12 '15 at 19:46
add a comment |
Okay, so all I'm trying to do here is "list" the managers who supervised the employee that charged a customer $100 for a rental on November 1st, 1998.
My issue is that I don't know how to select the managers' name because they're listed under MANAGER, which is a subtype of the EMPLOYEE supertype. I've posted my EER diagram below:
mysql select erd subtypes
Okay, so all I'm trying to do here is "list" the managers who supervised the employee that charged a customer $100 for a rental on November 1st, 1998.
My issue is that I don't know how to select the managers' name because they're listed under MANAGER, which is a subtype of the EMPLOYEE supertype. I've posted my EER diagram below:
mysql select erd subtypes
mysql select erd subtypes
edited 12 mins ago
MDCCL
6,84331745
6,84331745
asked Jan 12 '15 at 19:13
elephantCoderelephantCoder
1
1
1
The diagram is helpful, but is difficult to read. What can you do to provide clarity. Reducing your diagram focus on the main question would be helpful. FWIW Based on the diagram, I suspect that the Manager_ID is likely the same as the Employeer_ID of the manager as indicated by the relationship with the (D). Just guessing of course.
– RLF
Jan 12 '15 at 19:46
add a comment |
1
The diagram is helpful, but is difficult to read. What can you do to provide clarity. Reducing your diagram focus on the main question would be helpful. FWIW Based on the diagram, I suspect that the Manager_ID is likely the same as the Employeer_ID of the manager as indicated by the relationship with the (D). Just guessing of course.
– RLF
Jan 12 '15 at 19:46
1
1
The diagram is helpful, but is difficult to read. What can you do to provide clarity. Reducing your diagram focus on the main question would be helpful. FWIW Based on the diagram, I suspect that the Manager_ID is likely the same as the Employeer_ID of the manager as indicated by the relationship with the (D). Just guessing of course.
– RLF
Jan 12 '15 at 19:46
The diagram is helpful, but is difficult to read. What can you do to provide clarity. Reducing your diagram focus on the main question would be helpful. FWIW Based on the diagram, I suspect that the Manager_ID is likely the same as the Employeer_ID of the manager as indicated by the relationship with the (D). Just guessing of course.
– RLF
Jan 12 '15 at 19:46
add a comment |
1 Answer
1
active
oldest
votes
How you do the select depends on your table design. Your EER depicts the entities, relationships and attributes nicely, but doesn't say anything about table design. (That's as it should be, IMO). A relational schematic would give those details.
If you are interested in how to design tables for a subtype (or subclass) situation here are two alternative techniques for you to explore:
http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
http://martinfowler.com/eaaCatalog/classTableInheritance.html
And there is a technique often used when tables have a one to one relationship to each other. You can see it here:
https://stackoverflow.com/questions/tagged/shared-primary-key
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f89099%2fhow-to-create-a-select-statement-involving-a-subtype%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
How you do the select depends on your table design. Your EER depicts the entities, relationships and attributes nicely, but doesn't say anything about table design. (That's as it should be, IMO). A relational schematic would give those details.
If you are interested in how to design tables for a subtype (or subclass) situation here are two alternative techniques for you to explore:
http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
http://martinfowler.com/eaaCatalog/classTableInheritance.html
And there is a technique often used when tables have a one to one relationship to each other. You can see it here:
https://stackoverflow.com/questions/tagged/shared-primary-key
add a comment |
How you do the select depends on your table design. Your EER depicts the entities, relationships and attributes nicely, but doesn't say anything about table design. (That's as it should be, IMO). A relational schematic would give those details.
If you are interested in how to design tables for a subtype (or subclass) situation here are two alternative techniques for you to explore:
http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
http://martinfowler.com/eaaCatalog/classTableInheritance.html
And there is a technique often used when tables have a one to one relationship to each other. You can see it here:
https://stackoverflow.com/questions/tagged/shared-primary-key
add a comment |
How you do the select depends on your table design. Your EER depicts the entities, relationships and attributes nicely, but doesn't say anything about table design. (That's as it should be, IMO). A relational schematic would give those details.
If you are interested in how to design tables for a subtype (or subclass) situation here are two alternative techniques for you to explore:
http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
http://martinfowler.com/eaaCatalog/classTableInheritance.html
And there is a technique often used when tables have a one to one relationship to each other. You can see it here:
https://stackoverflow.com/questions/tagged/shared-primary-key
How you do the select depends on your table design. Your EER depicts the entities, relationships and attributes nicely, but doesn't say anything about table design. (That's as it should be, IMO). A relational schematic would give those details.
If you are interested in how to design tables for a subtype (or subclass) situation here are two alternative techniques for you to explore:
http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html
http://martinfowler.com/eaaCatalog/classTableInheritance.html
And there is a technique often used when tables have a one to one relationship to each other. You can see it here:
https://stackoverflow.com/questions/tagged/shared-primary-key
edited May 23 '17 at 12:40
Community♦
1
1
answered Jan 25 '15 at 13:23
Walter MittyWalter Mitty
3,3041317
3,3041317
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f89099%2fhow-to-create-a-select-statement-involving-a-subtype%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The diagram is helpful, but is difficult to read. What can you do to provide clarity. Reducing your diagram focus on the main question would be helpful. FWIW Based on the diagram, I suspect that the Manager_ID is likely the same as the Employeer_ID of the manager as indicated by the relationship with the (D). Just guessing of course.
– RLF
Jan 12 '15 at 19:46