Query about companies and regions












0















I'm doing some exercises about SQL right now.



I have a database with this schema:



CREATE TABLE regions(
region_id INTEGER PRIMARY KEY,
region_name TEXT NOT NULL,
number_of_customers INTEGER NOT NULL);

CREATE TABLE region_borders (
region_id1 INTEGER REFERENCES regions,
region_id2 INTEGER REFERENCES regions,
PRIMARY KEY (region_id1, region_id2));

CREATE TABLE companies (
company_id INTEGER PRIMARY KEY,
company_name TEXT NOT NULL,
headquarters_region INTEGER REFERENCES regions NOT NULL);

CREATE TABLE works_in(
company INTEGER REFERENCES companies,
region_id INTEGER REFERENCES regions,
PRIMARY KEY (company_id, region_id));


I want to translate to SQL this query:



"Retrieve the companies that works in three different regions that two by two share a border. Write for every company the company's name and the names of the 3 regions that share borders, in alphabetical order."



Well I have tried to work with joins and grouping, but I only achieved to get the names of companies that works in three different regions. I really have no idea about how implement this query in SQL or relational algebra.



I am using PostgreSQL.



Thank you for any advice and help!










share|improve this question























  • "Why should I provide an MCVE for what seems to me to be a very simple SQL query?" meta.stackoverflow.com/questions/333952/…

    – Raymond Nijland
    Nov 16 '18 at 12:48






  • 3





    Is that your homework?

    – schlonzo
    Nov 16 '18 at 12:50











  • Try combining GROUP BY with COUNT DISTINCT and HAVING

    – schlonzo
    Nov 16 '18 at 12:52













  • It is hard to suggest something solid without seeing table data but "Retrieve the companies that works in three different regions" That part you can easy get with SELECT companies.company_name, COUNT(*) FROM works_in INNER JOIN companies ON works_in.company = company.company_id GROUP BY works_in.company HAVING COUNT(DISTINCT region_id) >= 3 and use that result in a subquery and JOIN that with other tables to get the other information you need.. something like this is possible in SQL.. SELECT * FROM ( SELECT ... ) AS alias INNER JOIN table ON alias.column = table.column ...

    – Raymond Nijland
    Nov 16 '18 at 12:53













  • Besides you can also write the SELECT ... subquery in a INNER JOIN clause like this. SELECT * FROM table INNER JOIN ( SELECT ...) AS alias ON table.column = alias.column .. Good luck with your SQL exercises and SQL studies.

    – Raymond Nijland
    Nov 16 '18 at 12:58


















0















I'm doing some exercises about SQL right now.



I have a database with this schema:



CREATE TABLE regions(
region_id INTEGER PRIMARY KEY,
region_name TEXT NOT NULL,
number_of_customers INTEGER NOT NULL);

CREATE TABLE region_borders (
region_id1 INTEGER REFERENCES regions,
region_id2 INTEGER REFERENCES regions,
PRIMARY KEY (region_id1, region_id2));

CREATE TABLE companies (
company_id INTEGER PRIMARY KEY,
company_name TEXT NOT NULL,
headquarters_region INTEGER REFERENCES regions NOT NULL);

CREATE TABLE works_in(
company INTEGER REFERENCES companies,
region_id INTEGER REFERENCES regions,
PRIMARY KEY (company_id, region_id));


I want to translate to SQL this query:



"Retrieve the companies that works in three different regions that two by two share a border. Write for every company the company's name and the names of the 3 regions that share borders, in alphabetical order."



Well I have tried to work with joins and grouping, but I only achieved to get the names of companies that works in three different regions. I really have no idea about how implement this query in SQL or relational algebra.



I am using PostgreSQL.



Thank you for any advice and help!










share|improve this question























  • "Why should I provide an MCVE for what seems to me to be a very simple SQL query?" meta.stackoverflow.com/questions/333952/…

    – Raymond Nijland
    Nov 16 '18 at 12:48






  • 3





    Is that your homework?

    – schlonzo
    Nov 16 '18 at 12:50











  • Try combining GROUP BY with COUNT DISTINCT and HAVING

    – schlonzo
    Nov 16 '18 at 12:52













  • It is hard to suggest something solid without seeing table data but "Retrieve the companies that works in three different regions" That part you can easy get with SELECT companies.company_name, COUNT(*) FROM works_in INNER JOIN companies ON works_in.company = company.company_id GROUP BY works_in.company HAVING COUNT(DISTINCT region_id) >= 3 and use that result in a subquery and JOIN that with other tables to get the other information you need.. something like this is possible in SQL.. SELECT * FROM ( SELECT ... ) AS alias INNER JOIN table ON alias.column = table.column ...

    – Raymond Nijland
    Nov 16 '18 at 12:53













  • Besides you can also write the SELECT ... subquery in a INNER JOIN clause like this. SELECT * FROM table INNER JOIN ( SELECT ...) AS alias ON table.column = alias.column .. Good luck with your SQL exercises and SQL studies.

    – Raymond Nijland
    Nov 16 '18 at 12:58
















0












0








0








I'm doing some exercises about SQL right now.



I have a database with this schema:



CREATE TABLE regions(
region_id INTEGER PRIMARY KEY,
region_name TEXT NOT NULL,
number_of_customers INTEGER NOT NULL);

CREATE TABLE region_borders (
region_id1 INTEGER REFERENCES regions,
region_id2 INTEGER REFERENCES regions,
PRIMARY KEY (region_id1, region_id2));

CREATE TABLE companies (
company_id INTEGER PRIMARY KEY,
company_name TEXT NOT NULL,
headquarters_region INTEGER REFERENCES regions NOT NULL);

CREATE TABLE works_in(
company INTEGER REFERENCES companies,
region_id INTEGER REFERENCES regions,
PRIMARY KEY (company_id, region_id));


I want to translate to SQL this query:



"Retrieve the companies that works in three different regions that two by two share a border. Write for every company the company's name and the names of the 3 regions that share borders, in alphabetical order."



Well I have tried to work with joins and grouping, but I only achieved to get the names of companies that works in three different regions. I really have no idea about how implement this query in SQL or relational algebra.



I am using PostgreSQL.



Thank you for any advice and help!










share|improve this question














I'm doing some exercises about SQL right now.



I have a database with this schema:



CREATE TABLE regions(
region_id INTEGER PRIMARY KEY,
region_name TEXT NOT NULL,
number_of_customers INTEGER NOT NULL);

CREATE TABLE region_borders (
region_id1 INTEGER REFERENCES regions,
region_id2 INTEGER REFERENCES regions,
PRIMARY KEY (region_id1, region_id2));

CREATE TABLE companies (
company_id INTEGER PRIMARY KEY,
company_name TEXT NOT NULL,
headquarters_region INTEGER REFERENCES regions NOT NULL);

CREATE TABLE works_in(
company INTEGER REFERENCES companies,
region_id INTEGER REFERENCES regions,
PRIMARY KEY (company_id, region_id));


I want to translate to SQL this query:



"Retrieve the companies that works in three different regions that two by two share a border. Write for every company the company's name and the names of the 3 regions that share borders, in alphabetical order."



Well I have tried to work with joins and grouping, but I only achieved to get the names of companies that works in three different regions. I really have no idea about how implement this query in SQL or relational algebra.



I am using PostgreSQL.



Thank you for any advice and help!







sql database postgresql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 12:31







user10662775




















  • "Why should I provide an MCVE for what seems to me to be a very simple SQL query?" meta.stackoverflow.com/questions/333952/…

    – Raymond Nijland
    Nov 16 '18 at 12:48






  • 3





    Is that your homework?

    – schlonzo
    Nov 16 '18 at 12:50











  • Try combining GROUP BY with COUNT DISTINCT and HAVING

    – schlonzo
    Nov 16 '18 at 12:52













  • It is hard to suggest something solid without seeing table data but "Retrieve the companies that works in three different regions" That part you can easy get with SELECT companies.company_name, COUNT(*) FROM works_in INNER JOIN companies ON works_in.company = company.company_id GROUP BY works_in.company HAVING COUNT(DISTINCT region_id) >= 3 and use that result in a subquery and JOIN that with other tables to get the other information you need.. something like this is possible in SQL.. SELECT * FROM ( SELECT ... ) AS alias INNER JOIN table ON alias.column = table.column ...

    – Raymond Nijland
    Nov 16 '18 at 12:53













  • Besides you can also write the SELECT ... subquery in a INNER JOIN clause like this. SELECT * FROM table INNER JOIN ( SELECT ...) AS alias ON table.column = alias.column .. Good luck with your SQL exercises and SQL studies.

    – Raymond Nijland
    Nov 16 '18 at 12:58





















  • "Why should I provide an MCVE for what seems to me to be a very simple SQL query?" meta.stackoverflow.com/questions/333952/…

    – Raymond Nijland
    Nov 16 '18 at 12:48






  • 3





    Is that your homework?

    – schlonzo
    Nov 16 '18 at 12:50











  • Try combining GROUP BY with COUNT DISTINCT and HAVING

    – schlonzo
    Nov 16 '18 at 12:52













  • It is hard to suggest something solid without seeing table data but "Retrieve the companies that works in three different regions" That part you can easy get with SELECT companies.company_name, COUNT(*) FROM works_in INNER JOIN companies ON works_in.company = company.company_id GROUP BY works_in.company HAVING COUNT(DISTINCT region_id) >= 3 and use that result in a subquery and JOIN that with other tables to get the other information you need.. something like this is possible in SQL.. SELECT * FROM ( SELECT ... ) AS alias INNER JOIN table ON alias.column = table.column ...

    – Raymond Nijland
    Nov 16 '18 at 12:53













  • Besides you can also write the SELECT ... subquery in a INNER JOIN clause like this. SELECT * FROM table INNER JOIN ( SELECT ...) AS alias ON table.column = alias.column .. Good luck with your SQL exercises and SQL studies.

    – Raymond Nijland
    Nov 16 '18 at 12:58



















"Why should I provide an MCVE for what seems to me to be a very simple SQL query?" meta.stackoverflow.com/questions/333952/…

– Raymond Nijland
Nov 16 '18 at 12:48





"Why should I provide an MCVE for what seems to me to be a very simple SQL query?" meta.stackoverflow.com/questions/333952/…

– Raymond Nijland
Nov 16 '18 at 12:48




3




3





Is that your homework?

– schlonzo
Nov 16 '18 at 12:50





Is that your homework?

– schlonzo
Nov 16 '18 at 12:50













Try combining GROUP BY with COUNT DISTINCT and HAVING

– schlonzo
Nov 16 '18 at 12:52







Try combining GROUP BY with COUNT DISTINCT and HAVING

– schlonzo
Nov 16 '18 at 12:52















It is hard to suggest something solid without seeing table data but "Retrieve the companies that works in three different regions" That part you can easy get with SELECT companies.company_name, COUNT(*) FROM works_in INNER JOIN companies ON works_in.company = company.company_id GROUP BY works_in.company HAVING COUNT(DISTINCT region_id) >= 3 and use that result in a subquery and JOIN that with other tables to get the other information you need.. something like this is possible in SQL.. SELECT * FROM ( SELECT ... ) AS alias INNER JOIN table ON alias.column = table.column ...

– Raymond Nijland
Nov 16 '18 at 12:53







It is hard to suggest something solid without seeing table data but "Retrieve the companies that works in three different regions" That part you can easy get with SELECT companies.company_name, COUNT(*) FROM works_in INNER JOIN companies ON works_in.company = company.company_id GROUP BY works_in.company HAVING COUNT(DISTINCT region_id) >= 3 and use that result in a subquery and JOIN that with other tables to get the other information you need.. something like this is possible in SQL.. SELECT * FROM ( SELECT ... ) AS alias INNER JOIN table ON alias.column = table.column ...

– Raymond Nijland
Nov 16 '18 at 12:53















Besides you can also write the SELECT ... subquery in a INNER JOIN clause like this. SELECT * FROM table INNER JOIN ( SELECT ...) AS alias ON table.column = alias.column .. Good luck with your SQL exercises and SQL studies.

– Raymond Nijland
Nov 16 '18 at 12:58







Besides you can also write the SELECT ... subquery in a INNER JOIN clause like this. SELECT * FROM table INNER JOIN ( SELECT ...) AS alias ON table.column = alias.column .. Good luck with your SQL exercises and SQL studies.

– Raymond Nijland
Nov 16 '18 at 12:58














1 Answer
1






active

oldest

votes


















1














The final solution I could come up with is below, I try to go though the logical steps that took me to get there.
This is in T-SQL. (SQL Server 2016)



List how many regions a company works in



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
GROUP BY company_name


The result is like this (test data included below):



Results



See which borders does a certain region have:



SELECT DISTINCT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = 1 OR region_id2 = 1)


enter image description here



List which adjacent regions a company is working in:



SELECT * from regions where exists (SELECT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = regions.region_id OR region_id2 = regions.region_id)
AND w1.company_id = 4
AND w2.company_id = 4)


This is for company 4, this will be generalized later.



enter image description here



Putting it all together:



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
WHERE EXISTS (
SELECT region_id1, region_id2 FROM region_borders
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = works_in.region_id OR region_id2 = works_in.region_id)
AND w1.company_id = companies.company_id
AND w2.company_id = companies.company_id
)
GROUP BY company_name
HAVING COUNT(works_in.region_id) = 3


This lists the companies that work in 3 adjacent regions. I left out selecting the actual results you need, you should be able to build on this and finish the exercise.






share|improve this answer
























  • Thank you really a lot! I was getting crazy in understanding relations between bordering regions, but not only in SQL, just reasoning on a very normal table drawn with a pen on a sheet.

    – user10662775
    Nov 20 '18 at 16:54











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337976%2fquery-about-companies-and-regions%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









1














The final solution I could come up with is below, I try to go though the logical steps that took me to get there.
This is in T-SQL. (SQL Server 2016)



List how many regions a company works in



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
GROUP BY company_name


The result is like this (test data included below):



Results



See which borders does a certain region have:



SELECT DISTINCT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = 1 OR region_id2 = 1)


enter image description here



List which adjacent regions a company is working in:



SELECT * from regions where exists (SELECT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = regions.region_id OR region_id2 = regions.region_id)
AND w1.company_id = 4
AND w2.company_id = 4)


This is for company 4, this will be generalized later.



enter image description here



Putting it all together:



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
WHERE EXISTS (
SELECT region_id1, region_id2 FROM region_borders
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = works_in.region_id OR region_id2 = works_in.region_id)
AND w1.company_id = companies.company_id
AND w2.company_id = companies.company_id
)
GROUP BY company_name
HAVING COUNT(works_in.region_id) = 3


This lists the companies that work in 3 adjacent regions. I left out selecting the actual results you need, you should be able to build on this and finish the exercise.






share|improve this answer
























  • Thank you really a lot! I was getting crazy in understanding relations between bordering regions, but not only in SQL, just reasoning on a very normal table drawn with a pen on a sheet.

    – user10662775
    Nov 20 '18 at 16:54
















1














The final solution I could come up with is below, I try to go though the logical steps that took me to get there.
This is in T-SQL. (SQL Server 2016)



List how many regions a company works in



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
GROUP BY company_name


The result is like this (test data included below):



Results



See which borders does a certain region have:



SELECT DISTINCT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = 1 OR region_id2 = 1)


enter image description here



List which adjacent regions a company is working in:



SELECT * from regions where exists (SELECT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = regions.region_id OR region_id2 = regions.region_id)
AND w1.company_id = 4
AND w2.company_id = 4)


This is for company 4, this will be generalized later.



enter image description here



Putting it all together:



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
WHERE EXISTS (
SELECT region_id1, region_id2 FROM region_borders
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = works_in.region_id OR region_id2 = works_in.region_id)
AND w1.company_id = companies.company_id
AND w2.company_id = companies.company_id
)
GROUP BY company_name
HAVING COUNT(works_in.region_id) = 3


This lists the companies that work in 3 adjacent regions. I left out selecting the actual results you need, you should be able to build on this and finish the exercise.






share|improve this answer
























  • Thank you really a lot! I was getting crazy in understanding relations between bordering regions, but not only in SQL, just reasoning on a very normal table drawn with a pen on a sheet.

    – user10662775
    Nov 20 '18 at 16:54














1












1








1







The final solution I could come up with is below, I try to go though the logical steps that took me to get there.
This is in T-SQL. (SQL Server 2016)



List how many regions a company works in



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
GROUP BY company_name


The result is like this (test data included below):



Results



See which borders does a certain region have:



SELECT DISTINCT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = 1 OR region_id2 = 1)


enter image description here



List which adjacent regions a company is working in:



SELECT * from regions where exists (SELECT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = regions.region_id OR region_id2 = regions.region_id)
AND w1.company_id = 4
AND w2.company_id = 4)


This is for company 4, this will be generalized later.



enter image description here



Putting it all together:



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
WHERE EXISTS (
SELECT region_id1, region_id2 FROM region_borders
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = works_in.region_id OR region_id2 = works_in.region_id)
AND w1.company_id = companies.company_id
AND w2.company_id = companies.company_id
)
GROUP BY company_name
HAVING COUNT(works_in.region_id) = 3


This lists the companies that work in 3 adjacent regions. I left out selecting the actual results you need, you should be able to build on this and finish the exercise.






share|improve this answer













The final solution I could come up with is below, I try to go though the logical steps that took me to get there.
This is in T-SQL. (SQL Server 2016)



List how many regions a company works in



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
GROUP BY company_name


The result is like this (test data included below):



Results



See which borders does a certain region have:



SELECT DISTINCT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = 1 OR region_id2 = 1)


enter image description here



List which adjacent regions a company is working in:



SELECT * from regions where exists (SELECT region_id1, region_id2 FROM region_borders 
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = regions.region_id OR region_id2 = regions.region_id)
AND w1.company_id = 4
AND w2.company_id = 4)


This is for company 4, this will be generalized later.



enter image description here



Putting it all together:



SELECT company_name, COUNT(works_in.region_id) AS count FROM companies 
LEFT JOIN works_in ON works_in.company_id = companies.company_id
WHERE EXISTS (
SELECT region_id1, region_id2 FROM region_borders
INNER JOIN works_in w1 ON region_borders.region_id1 = w1.region_id
INNER JOIN works_in w2 ON region_borders.region_id2 = w2.region_id
WHERE (region_id1 = works_in.region_id OR region_id2 = works_in.region_id)
AND w1.company_id = companies.company_id
AND w2.company_id = companies.company_id
)
GROUP BY company_name
HAVING COUNT(works_in.region_id) = 3


This lists the companies that work in 3 adjacent regions. I left out selecting the actual results you need, you should be able to build on this and finish the exercise.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 16 '18 at 15:30









Marcell TóthMarcell Tóth

1,056317




1,056317













  • Thank you really a lot! I was getting crazy in understanding relations between bordering regions, but not only in SQL, just reasoning on a very normal table drawn with a pen on a sheet.

    – user10662775
    Nov 20 '18 at 16:54



















  • Thank you really a lot! I was getting crazy in understanding relations between bordering regions, but not only in SQL, just reasoning on a very normal table drawn with a pen on a sheet.

    – user10662775
    Nov 20 '18 at 16:54

















Thank you really a lot! I was getting crazy in understanding relations between bordering regions, but not only in SQL, just reasoning on a very normal table drawn with a pen on a sheet.

– user10662775
Nov 20 '18 at 16:54





Thank you really a lot! I was getting crazy in understanding relations between bordering regions, but not only in SQL, just reasoning on a very normal table drawn with a pen on a sheet.

– user10662775
Nov 20 '18 at 16:54


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337976%2fquery-about-companies-and-regions%23new-answer', 'question_page');
}
);

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







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()