Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

What kind of return on investment is there in learning Set Theory, with respect to database design and query?

General Tech Learning Aids/Tools

Max. 2000 characters
Replies

usr_profile.png

User

( 4 months ago )

I am learning database right now -- and some of the queries are getting just plain crazy. I know that during query optimization you may sometimes rewrite queries in different ways to minimize certain things. I am looking at a correllated subquery example and see that it results in the same resultset as a LEFT JOIN.

I am thinking that possibly mathematically (set theory) they may be related, and if someone comfortable with set theory would be able to see that easily.

My question is: What kind of return on investment would I see from learning set theory? Would I see any return on investment? Would it be faster to learn database just by writing more queries, or should I spend time on set theory? I don't want to fall down a rabbit hole. I want to be good with database, but I need to get there as fast as possible.

usr_profile.png

User

( 4 months ago )

That's a tricky question. I've taken courses in set theory and relational algebra at school, and I can definitely say that they have aided my understanding of relational databases. But just learning set theory by itself probably won't help a lot. Relational algebra, which requires a little basic set theory, is a better formalism for modeling relational databases (by design), and it's a great thing to learn if you're planning on using them a lot. It will help with not only query optimization but also database design, which can seem like a black art without examining the theoretical underpinnings. Database normal forms, for example, can be succinctly describes as simple expressions in relational algebra.

If you're only doing simple SQL querying and no complex queries or database design, then the effort to learn relational algebra may not be justified by the benefit.

It's worth mentioning that real-world relational databases are not actually sets, but rather bags or multisets. Applying set theory to bags tends to cause headaches from the impedance mismatch.

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif