title: central attachment/file table design
body: <p>UPDATE:</p>
  
  <p>I have generated below tables from sql server.</p>
  
  <p>here is the screen shots of my design:</p>
  
  <p><img src="https://i.stack.imgur.com/IJMAo.png" alt="enter image description here"></p>
  
  <p>shows the data after combining three tables, getting total of 12 rows
  my <code>request table</code> has <strong>4 rows</strong> and <code>attachment table</code> has <strong>3 rows</strong></p>
  
  <p><img src="https://i.stack.imgur.com/0hZVw.png" alt="enter image description here"></p>
  
  <pre><code>CREATE TABLE [dbo].[attachment](
      [attach_id] [int] IDENTITY(1,1) NOT NULL,
      [process_type_id] [int] NULL,
      [attach_content_type] [varchar](100) NULL,
      [attach_name] [varchar](100) NULL,
   CONSTRAINT [PK_attachment] PRIMARY KEY CLUSTERED 
  (
      [attach_id] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  
  
  CREATE TABLE [dbo].[process_type](
      [process_type_id] [int] IDENTITY(1,1) NOT NULL,
      [process_type] [varchar](100) NULL,
   CONSTRAINT [PK_process_type] PRIMARY KEY CLUSTERED 
  (
      [process_type_id] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  
  
  
  CREATE TABLE [dbo].[request](
      [request_Id] [int] IDENTITY(1,1) NOT NULL,
      [request_desc] [varchar](200) NULL,
      [process_type_id] [int] NOT NULL,
   CONSTRAINT [PK_request] PRIMARY KEY CLUSTERED 
  (
      [request_Id] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  
  
  
  CREATE TABLE [dbo].[request_review](
      [review_request_Id] [int] IDENTITY(1,1) NOT NULL,
      [review_desc] [varchar](200) NULL,
      [process_type_id] [int] NULL,
   CONSTRAINT [PK_request_review] PRIMARY KEY CLUSTERED 
  (
      [review_request_Id] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  </code></pre>
  
  <p>I am busy building a database, and now I have a question about my design.</p>
  
  <p>I have got the following tables:
  Customer
  Employee
  upload_doc </p>
  
  <p>I want to be able to add multiple attachments to Customers, Employees  </p>
  
  <p>what is the best design:</p>
  
  <p>design #1</p>
  
  <h2>Upload_doc</h2>
  
  <pre><code>upload_doc_id (NOT auto generated)
  upload_doc_name (uploaded doc name)
  upload_content_type 
  upload_doc_data (blob)
  </code></pre>
  
  <h2>employee</h2>
  
  <pre><code>employee_id
  first_name
  middle_name
  last_name
  upload_doc_id
  </code></pre>
  
  <h2>customer</h2>
  
  <pre><code>customer_id
  first_name
  last_name
  upload_doc_id
  </code></pre>
  
  <p>design #2</p>
  
  <h2>Upload_doc</h2>
  
  <pre><code>upload_doc_id (AUTO generated)
  upload_doc_name (uploaded doc name)
  upload_content_type 
  upload_doc_data (blob)
  employee_id
  customer_id  
  </code></pre>
  
  <h2>employee</h2>
  
  <pre><code>employee_id
  first_name
  middle_name
  last_name
  </code></pre>
  
  <h2>customer</h2>
  
  <pre><code>customer_id
  first_name
  last_name
  </code></pre>