![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I have to give a little presentation on database theory, and I'm looking for a few good examples of questions that cannot be (easily) answered if a database isn't normalized. If you have any examples that I could use, I'd greatly appreciate it. Here's one that I've got so far: A social club kept track of members, their spouses, and children in an Excel spreadsheet, which they imported into a database. The single table looks like this create table members ( firstName varchar(20), child1 varchar(20), child1age tinyint, child2 varchar(20) child2age tinyint, ) problem: list the names of any children eligible to participate in the trick or treat outing, which is open to kids 5-10 years old. select child1 as childname from members where age >= 5 or age < 10 union select child2 as childname from members where age >=5 or age 10 so as you can see, I can do it, but it's cumbersome. The actual database might have 10 child fields. It's *much* nicer if the children are in another table. I'm looking for examples like this one. Any help is appreciated. Just a simple narrative will do. You don't have to provide code unless you want to. thanks |
#4
| |||
| |||
|
|
Your example is also a potentially misleading one. The term "repeating groups" does NOT refer to repeated sets of columns in a table. It means repeated sets of values within a *column* - something which is impossible to do in SQL. |
#5
| |||
| |||
|
|
It's possible (but obviously inadvisable) to fake it, though, e.g. using a comma-separated list. |
#6
| |||
| |||
|
|
It's *much* nicer if the children are in another table. |
![]() |
| Thread Tools | |
| Display Modes | |
| |