I have created a database, what is data structure and relationship?

I have a database.
I have 4 tables.
Employee table
Project Table
Sales order table
Customer table
================================
SalesOrderId is unique
EmploeeId Is unique
CustomerID is unique
ProjectId is unique
What would be the relationship for these tables?
Should I create 5th table that has salesOrderID and ProjectID and the primary key is the combination of salesOrderId and ProjectId?
Is the whole process correct?
Regards,
GGGGGNNNNN
GGGGGNNNNN

. IDENTITY is never part of a valid data model and certainly not  a key.
Identity can be a primary key, can't it be?
It can be. What Celko is trying to say is that IDENTITY is not a good choice for a key. Unfortunately, he is sitting in an ivory tower and does not have very good ideas of real-world systems.
More generally, when you design a database, you may decide to introduce a
surrogate key in your tables. That is, a key which is not drawn from the data, but just generated in the system. Ideally, you should still have a real key in the data. The reason you would use the surrogate key is that the real key may be difficult to
work with, for instance it is a long string or consists of many components.
In practice, far from all entities can (easily) be described with a natural key, why the surrogate key is the only one you will have. However, you should always strive for finding a natural key, and not slap on IDENTITY as a matter of routine. For instance,
say that you have a table called ProductCategories which defines which categories a product belongs to, that table should have a two-column of ProductID and CategoryID, and there should not be any IDENTITY column in that table.
Generally, when I see people post a table table definition with an IDENTITY column and all other columns nullable, I know that they have not put in enough thought to their data-modelling.
And, no, surrogate key != IDENTITY. IDENTITY is one way to implement surrogate keys, but you can also use guids, sequences (in SQL 2012 and up) or roll your own. Since IDENTITY incurs some limitations, you may want to avoid it. Sequences are cleaner and
you don't have the same limitations. And rolling your own works very well, as long as you don't expect a high level of parallel inserts, which is what IDENTITY and sequences really are aimed for.
We never put audit data in the table under audit. It is not just silly, it is illegal.
What do you mean?
Again, Celko is out of touch with reality. It may be illegal in Texas where he is sitting but not where you and I are sitting. It may also be illegal if the auditing is made for legal reasons. Obviously, if the auditing is mainly done to facilitate troubleshooting,
your local law-enforcing authorities could not care less.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Firefox is refusing to start. It says that my profile is missing, which it appears to be. Yet the way in which one goes about creating a new profile wont' work either. Anybody have a bloody clue what's going on and how to fix it?

    Firefox is refusing to start. It says that my profile is missing, which it appears to be. Yet the way in which one goes about creating a new profile wont' work either. Anybody have a bloody clue what's going on and how to fix it?

    AIR give you classes to detect an on-line or off-line status, it's in 
    this way for the sake of flexibility for instance what happens if you 
    only what to sync  data only on Saturdays at 2 am? If it were done 
    automatically that'll be a problem. And it isn't so complicated.
    You can download the SalesBuilder from AIR examples at www.adobe.com/devnet/air
      it's an application that does everything you have in mind.
    I don't understand your question abou file types.
    An AIR app can communicate with almost every backend served tech 
    CF, .Net, PHP, RoR.
    Sincerely,
    Michael
    El 14/05/2009, a las 8:48, IrishAIRMax <[email protected]> escribió:
    >
    I have to say that I'm loving the picture! well cool!
    >
    Sorry but I don't quiet understand. I thought AIR did the updating 
    automatically? I didn't realise the developer had to program the 
    logic of how the updates take place?  Is it a case in most AIR apps 
    that when online the app updates the server and once every intervel 
    (of however long) the local SQLite DB is synced to the more updated 
    server DB. Then when offline the developer has to sense that the app 
    is offline and store a log manually of the updates without any help 
    from AIR itself, and then update once it comes online again?
    >
    Can AIR link to anything more than a database on the server side 
    apart from webservices, for example .as files or any other file types?
    >
    What type of server is a Flex app stored on, is it a specific Adobe 
    server rather than a Java or .NET server?
    >
    Thank you so much for your last comment!
    IrishAIRMax
    >

  • I have created a 12 minutes slideshow on imovies and on idvd.  I want to show it to my relatives in Europe.  What is the best way for me to do this? utube?

    I have created a 12 minute slideshow on imovies and burned it through idvd.  I would like to share it with my relatives in Europe. what would be the best means of doing this? uTube? any other ideas?

    You could put it on Youtube, but then they don't have a cop saved to their drive. You could also upload it to your Dropbox and make it public. Note the size of the file, Dropbox and Youtube can only handle such big files, and if your family has a good internet connection (download/playback speeed over bandwith).

  • The FInal Step, i have created a program to all my specifications and i am now ready to connect the hardware

    I have created a program to all my specifications and i am now ready to connect the hardware.
    My program was created to automate the cleaning process of an atmostpheric chamber. It controls two valves based on the pressure readings and time intervals. When creating this program i figured that if a could make a boolean turn on or off based on the pressure readings then it would be no problem somehow wiring it to send a signal to the hardware. I have reached that point and don't know how to proceed.  I was told that the first step is to figure out what kind of Card is being interfaced with the program. 
    I have read up on this subject and it seems like there is many ways to do it.
    All sugestions will be greatly appreciated

    I'm not sure how you can create the program without knowing what hardware you're going to be using. But...  What have you read up on? You will need to select your data acquisition hardware. What kind of signals do you have? What kind of transducers do you have? What kind of actuators do you have? You may want to start with:
    Introduction to Data Acquisition
    Digital Voltage Measurement Fundamentals
    Complete Data Acquisition Tutorial
    EDIT: Re-reading your post and seeing Waldemar's response: Do you actually already have a card installed?
    Message Edited by smercurio_fc on 07-29-2008 02:25 PM

  • SQL ENTERPRISE: The edition of Reporting Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database

    The error below makes absolutely no sense! I'm using Enterprise Core...yet I'm being told I can't use remote data sources:
    w3wp!library!8!03/05/2015-19:08:48:: i INFO: Catalog SQL Server Edition = EnterpriseCore
    w3wp!library!8!03/05/2015-19:08:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: , Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: The feature: "The edition of Reporting
    Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database." is not supported in this edition of Reporting Services.;
    Really? This totally contradicts the documentation found here:
    https://msdn.microsoft.com/en-us/library/ms157285(v=sql.110).aspx
    That article says remote connections are completely supported.
    ARGH! Why does this have to be so difficult to setup?!?

    Hi jeffoliver1000,
    According to your description, you are using Enterprise Core edition and you are prompted that you can’t use remote data sources.
    In your scenario, we neither ignore your point nor be doubt with what you say. But actually we have met the case before that even though the SQL Server engine is Enterprise but the reporting services is still standard. So I would recommend you to find the
    actual edition of reporting services you are using. You can find Reporting Services starting SKU in the Reporting Service logs ( default location: C:\Program Files\Microsoft SQL Server\<instance name>\Reporting Services\LogFiles). For more information,
    please refer to the similar thread below:
    https://social.technet.microsoft.com/Forums/en-US/f98c2f3e-1a30-4993-ab41-acbc5014f92e/data-driven-subscription-button-not-displayed?forum=sqlreportingservices
    By the way, have you installed the other SQL Server edition before?
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Wandering data structure and database infrastructure

    1, what do I need to do for building a new data structure?
    2, what do I need to do for building a database infrastructure?

    The questions still, unfortunately, don't make sense.
    The first question is at least starting to coalesce into something answerable. I'm guessing that the first question is about data modeling but in order to make that guess, I have to assume that they're not talking about a "data structure" and that they mean to be talking about an application. If question 1 is really asking to describe a situation where your friend had to design a data model, the answer, presumably, would be to describe a situation where your friend had to design a data model. The interviewer would almost certainly have followup questions about how the data model was designed, why particular design decisions were made, etc. depending on the data model your friend started describing.
    The second question still isn't close to answerable-- it is far from clear what is being asked.
    Justin

  • I recently installed a new hard drive in a MacBook 2007 and then 10.6.3. I'd like to be able to Sync iCal to the calendars I have created on other devices (new iCloud account and an ME account). I can't upgrade to 10.7 or 10.8 because the MacBook is 32bit

    I recently installed a new hard drive in a MacBook 2007 and then 10.6.3. I'd like to be able to Sync iCal to the calendars I have created on other devices (new iCloud account and an ME account). I can't upgrade to 10.7 or 10.8 because the MacBook is 32 bit. Just looking for a workaround as this is not a primary device.

    You should update to the latest version of Snow Leopard, 10.6.8 - you can download it here; however it's still not compatible with iCloud and though you can connect to access your email you cannot access any other of iCloud's facilities.
    However some people have been able to set up calendar syncing by using the method detailed here - this is an unsupported hack and may not be reliable, and may stop working at some future point. I've not tried it: use at your own discretion.
    To access the email:
    Entering iCloud email settings manually in Snow Leopard or Leopard
    Are you sure you can't upgrade to Lion? It requires an Intel Core 2 Duo processor, which you may well have, though it also needs 2GB RAM so you might need to add additional RAM (might not be worth it for what you want). The published specs don't mention 32 or 64 bit. You can buy Lion by ringing the Apple Store at the number at bottom left of this page.

  • HT4314 hello i have an ipod touch 4 5.1.1 and i can't post status updates or have a profil picture what is the problem and my sister has it and we have the same itunes account in game center

    hello i have an ipod touch 4 5.1.1 and i can't post status updates or have a profil picture what is the problem and my sister has it and we have the same itunes account in game center

    And the answer is: 
    williamfromlongueuil wrote:
    we have the same itunes account in game center
    You need to have your own account...  DUH....

  • What is data archiving and DMS(Data Management System) in SAP

    what is data archiving and DMS(Data Management System) in SAP
    Welcome to SCN. Before posting questions please search for available information here and in the web. Please also read the Rules of Engagement before further posting.
    Edited by: kishan P on Aug 31, 2010 1:06 PM

    Hi,
    Filtering at the IDoc Level
    Identify the filter object (BD59)
    Modify the distribution model
    Segment Filtering
    specify the segments to be filtered (BD56)
    The Reduced IDoc Type
    Analyze the data.
    Reduce the IDoc type (BD53)
    Thanks and regards.

  • What is Data filtering and Segment filtering in ALE/IDOCs

    Hi sap gurus
    what is Data filtering and Segment filtering in ALE/IDOCs

    Hi,
    Filtering at the IDoc Level
    Identify the filter object (BD59)
    Modify the distribution model
    Segment Filtering
    specify the segments to be filtered (BD56)
    The Reduced IDoc Type
    Analyze the data.
    Reduce the IDoc type (BD53)
    Thanks and regards.

  • What Tree Data Structures does Java Include?

    Hello,
    I have been reading about several tree data structures like a binary search tree, self-balancing bst, minimum spanning tree, red-black tree, AVL tree, etc... Are there data structures in Java represent the various trees, or is implementation of the ds left to user?
    Eric

    "Java" can be termed the "Java Language". The language does not have trees.
    In more general usage "Java" can refer to a standard, desktop, delivered VM which includes the standard Java API. The types that you are asking about would be found in the following package.
    [http://java.sun.com/javase/6/docs/api/java/util/package-summary.html]
    "Java" could also refer to any other commonly available implementations. In that case probably anything that can be implemented has been implemented somewhere. Googling works.

  • Hi, I would like to create a database from my numbers spreadsheet and create reports (like SQL). Is there a way?

    Hi, I would like to create a database from my numbers spreadsheet and create reports (like SQL). Is there a way?

    Numbers is a lightweight spreadsheet.  If you know sql you will know that it can handle many queries and is a real databases that can handle many thousands of records.  Number is not the correct tool.  You can make something that does something like a query but it is not truly a query.
    Can you share anything about the specific application and how much information there is in each record?  How many records (rows)?

  • When trying to save it says don't have enough access privileges. what that mean please and how to remedy?

    when trying to save it says don't have enough access privileges. what that mean please and how to remedy?

    It means just that.
    You don't have privilege to write to your harddisk
    Check your user account.
    Which system is it?
    Which version of Illustrator?

  • I have created a journal on my iPad 2 and shared it on iCloud, it contains screenshots of webpages, but when i try to view the journal on my desktop only some of the images appear...any ideas?

    I have created a journal on my iPad 2 and shared it on iCloud, it contains screenshots of webpages. But when I try to view the journal on my desktop only some of the images appear...any ideas why this is happening?

    Hi there Paula120,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    -Griff W. 

  • How can I use slideshows that I have created in Aperture 3 (complete with captions and music tracks) in my DVD through iDVD version 7.1.2 ?  iDVD Manuals that I have read seem to avoid explaining that export process.  Any advice will be greatly appreciate

    How can I use slideshows that I have created in Aperture 3 (complete with captions and music tracks) in my DVD through iDVD version 7.1.2 ?  iDVD Manuals that I have read seem to avoid explaining that export process. I'm using Aperture 3, Mac OS X (10.7.5), on a Any advice will be greatly appreciated.  Anthony Zasadney, Bolingbrook IL.

    Export the slideshow from Aperture as a .mov file and import it into iDVD.

Maybe you are looking for

  • File will not open in Elements 11

    I installed Elements 11 on a Windows 7 system.  When I go to FILE and select OPEN and then go to the folder where pictures are stored and then click on the folder nothing appears except the message "No items match your search".  I have been using Ele

  • Purchased songs wont transfer to Itouch

    I just got a new mac and I transferred all my old songs to my new computer and they all transferred to my Itouch fine but the new songs I bought on my mac wont transfer. Any ideas??

  • File Vault Stripping Permissions

    (Note: this is reposted here at the suggestion of a sysadmin on the Tiger group). I've written a C++ application that will be used by both Windows and OSX clients. The app is simple and console based and is distributed as a simple binary file, compil

  • W520 dock 433830U in good supply

    The mini dock for the W520 is available in quantity. I just bought one brand new (my second) from eBay for $160 shipped; not to say some sellers aren't trying for a lot more. Buy and Amazon both have them in the the $214 - $225 range: 433830U dock So

  • I have existing excel and word documents how do i get theminto the cloud for access from my ipad

    I have just brought an ipad air and want to set up the cloud so i can access all my excel files, how do i get all my documents onto the cloud so i can access them ? from my ipad remotly