• 0

Question about database normalization


Question

Howdy.

I have an IT class in which we're studying SQL.

We have a midterm coming up and we've been given a sample exam for studying. I've got everything locked down, just one thing left - Database normalization. I answered the first two parts of a question, and I'm not sure how to answer the 3rd. Would appreciate if someone can verify my answer for the 1st and 2nd parts and perhaps advice on the 3rd part.
 

The question is:

1. When is the process of normalization used?

If a database is designed in a flawed way, it may contain anomalies, which makes managing that database nearly impossible. The normalization of a database is a method to remove all anomalies and bring the database to a consistent state by designing it according to specific rules. In the normalization process we systematically examine relations for anomalies and when detecting some, remove those anomalies by splitting up the relation into two, related, relations. Finding problems with the database structure at an early stage is strongly important, when the other option being those problems detected only at a later stage.
 

2. Describe BCNF

BCNF stand for "Boyce and Codd Normal Form", named after the two who invented it. It is another version of the 3NF, and deals with certain type of anomaly that is isn't handled by 3NF.
 

3. For the given relation, find all functional dependencies and possible anomalies implied from the functional dependencies. Put the relation into the appropriate BCNF.

 

EmployeeID  |  Name  |    Dept.         |        Title

100                 Jones       HR                   Executive director

200                 Chau        HR                   PR

205                 Parker      Marketing         Clerk

300                 Garret      Accounting        Accountant

400                  Miller      Marketing          Clerk

 

Thanks!

15 answers to this question

Recommended Posts

  • 0

The question you should ask yourself first is

 

Why is there a "EmployeeID" column in the first place?

 

and then:

 

What happens if "Accounting" changes to "US Accounting" and "Europe Accounting"?

 

What happens if "Clerk" changes to "Front Office Clerk" and "Back Office Clerk"?

 

What happens when Jones retires and is no longer "Executive director"?

 

 

One last thing I should add is that normalization is as good as it is bad. You can under-normalize and you can over-normalize. It all depends on business logic, that's your reference, so it's not a clear cut.

 

To answer shortly, you could create a DEPARTMENTS table and a TITLES table and then create two more tables: EMPS_DEPS and EMPS_TITLES. Can you figure it out by yourself from here?

  • 0

OK. That's a good start for the understanding process :) Basically, I understand that EmployeeID is there as a primary key to identify every employee and make sure there's no other duplicates, because there can be more than one "Jones" for instance, but there can't be 2 "100" employeeID, no? I don't really know how to answer the next 2 things you've said, but as for the third - wouldn't we just delete the record for "Jones" when he retires?

  • 0

It's a small course, 2 credits out of my entire bachelor degree, and I skipped the last class which was the class in which all of this was taught. Prior to that, we were studying basic SQL, queries etc which I'm good with.

 

After re-reading the questions, I gave it a try, can this be the answer?:

 

        

Untitled.png

 

EDIT: In the 3rd new table, the second column is "Dept"

  • 0
  On 02/05/2015 at 17:19, Builds said:

[...] wouldn't we just delete the record for "Jones" when he retires?

 

And what if you wanted to run a report which overlapped the period of time that "Jones" was employed and then retired ?

 

By removing the record you lose his data forever.

 

Physically deleting data (especially primary data) is a big no-no. You could have another Department of retired to get around that (there are other ways to model that as well)

  • 0
  On 02/05/2015 at 19:53, itmitic? said:

attachicon.gifitmitica2.png

1. You'd create DEPARTMENTS for your business.

2. You'd come up with TITLES for your business.

3. You'd assign titles per departments: DEPS_TITS.

4. You'd hire EMPLOYEES.

5. You'd assign them to departments and give them titles: EMPS_DEPS_TITS. In time...

 

I'm not sure I understand the division you've made in the graph, I'd create 5 tables out of 1?...

  • 0

Yes. It's about the atomicity of the employee data.

 

Ask yourself this: what happens if an employee changes title or if an employee changes department or if an employee changes both title and department?

 

The way you've normalized the tables it only accounts for a single change in department and title for an employee.

 

The way I've done it, it doesn't matter how many changes there are, they're all accounted for.

 

The first normalization is not explicit about the changes in title and department for an employee. It requires additional work, a perfect candidate for views or stored procedures.

 

The second normalization is about classifying the titles inside departments as well and, as such, it's explicit about the correlated department-title changes.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Windows 11 receives a handful of new AI features by Taras Buria Microsoft is supercharging its operating system with a handful of new AI-powered features. Those with compatible computers (mostly Copilot+ PCs) can download a new Windows 11 update that introduces new AI experiences. One of the biggest updates is the Settings app, which now features agentic search to understand complaints about your computer. You can click the search box and tell Windows what is wrong. For example, "my mouse cursor is too small." Windows will then process your request and suggest taking action on your behalf. You can also ask for specific changes like, "change my screen resolution to 1920x1080." The Settings agent is now available for users with Snapdragon-powered Copilot+ PCs. It is coming soon to Intel and AMD-based Copilot+ PCs. Click to Do has received several new actions: Practice in Reading Coach helps improve reading skills by giving feedback and offering suggestions on how to improve. Read with Immersive Reader displays text in a distraction-free environment with the ability to adjust text size, spacing, font and background theme, have text read aloud, break words into syllables and highlight parts of speech. The picture dictionary shows images for unfamiliar words. Draft with Copilot in Word turns a portion of text into a full draft. Actions in Microsoft Teams let you click an email to send a message or schedule a meeting. More AI is available in the Photos app. After a couple of months in testing, the Relight feature is now rolling out, allowing users to adjust lights with AI. You can place three light sources or use built-in presets to edit your photos. Like with the Settings app, this feature is currently available to Snapdragon-powered devices only. Paint now has a sticker generator and a new object select tool that uses AI to isolate the object and edit individual elements, even if they are part of one layer. Snipping Tool has received the "Perfect Screenshot" feature to help you select parts of the screen for a proper cropped screenshot, and a new Color Picker to read colors on the screen in different formats (available on all PCs, not only Copilot+ PCs). Finally, the Copilot app now supports Highlights, a new feature that enables Copilot to show you how to perform specific tasks in the current app on the entire desktop. Today's updates are not just about AI and sticker generation. Microsoft is also improving the performance and security of its system with a redesigned blue screen of death and the new Quick Machine Recovery system. You can read more about those changes here. If you want to get all these updates today, download the latest non-security update for Windows 11 version 24H2, which is now available.
    • Well their mistake was choosing Microsoft, the backstabbers
    • Yet my Surface Pro 7+ was running ok with 23H2, only having issues with the laggy-mess that's the new File Explorer...
    • Brave browser blocks Windows feature that takes screenshots of everything you do on your PC by David Uzondu If there's anything Microsoft Build 2024 will be remembered for, it's the introduction of the controversial Windows Recall on its new Copilot+ PCs. Pitched as a "photographic memory" for your computer, this feature works by constantly taking screenshots of your activity to build a detailed and searchable timeline of everything you have ever seen or done. Almost immediately, critics and security researchers labeled the feature a privacy nightmare, pointing out that a single piece of malware could gain access to a user's entire digital life. In response to the backlash, Microsoft promised that users will be able to filter which apps get recorded, but some developers are not waiting around. Just about a month after the feature became generally available for Copilot+ PCs (it is now rolling out to users in Europe), some app developers took matters into their own hands to protect their users. One such company was Signal, which implemented an opt-out feature called "Screen Security" to prevent its chats from being captured. It cleverly uses a Digital Rights Management (DRM) flag to black out the application window during a screenshot attempt, using the same technology that streaming services like Netflix use to prevent people from recording movies. Now, Brave Browser has joined the party, announcing on X that it will block Recall by default with its v1.81 update, which is expected in the coming weeks. While Microsoft stated that Recall would not capture content from private browsing windows, Brave's new update just tells the Windows operating system that all of its browser windows are private. This prevents Recall from snapshotting anything you do in Brave, not just the activity in a designated private tab. In its announcement, the company did give Microsoft some credit for making changes following the initial public outcry, such as making Recall an opt-in feature. However, the company still feels that giving any application unrestricted access to a user's browsing history is a huge risk. If you, for some reason, like Windows Recall, you can disable the upcoming protection by navigating to Settings, then Privacy and Security, and toggling off the "Block Microsoft Recall" option.
    • I have the Tab A9+ also, and I agree with all your points. I really like this tablet.
  • Recent Achievements

    • Week One Done
      SmileWorks Dental earned a badge
      Week One Done
    • Community Regular
      vZeroG went up a rank
      Community Regular
    • Collaborator
      Snake Doc earned a badge
      Collaborator
    • Week One Done
      Snake Doc earned a badge
      Week One Done
    • One Month Later
      Johnny Mrkvička earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      587
    2. 2
      Michael Scrip
      199
    3. 3
      ATLien_0
      192
    4. 4
      +FloatingFatMan
      131
    5. 5
      Xenon
      122
  • Tell a friend

    Love Neowin? Tell a friend!