Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3355502
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:24:11+00:00 2026-05-18T02:24:11+00:00

Having briefly studied databases in college, I haven’t worked with them since and have

  • 0

Having briefly studied databases in college, I haven’t worked with them since and have drawn a bit of a blank, so I was wondering if someone could help me out. I have a database called Convert, which holds the following tables:

**File**
ID  int  PK
ISBN nvarchar(MAX)
UserName nvarchar(50)
CoverID
PDFID

**PDF**
PDFID int PK
FileContent image
MimeType nvarchar
FileName nvarchar

**Cover**
CoverID int PK
FileContent image
MimeType nvarchar
FileName nvarchar

I’ve just drawn a blank on two things really.

  1. Relationships. I think if I a sql query such as below I will create foreign keys:

    Alter TABLE Cover ADD FOREIGN KEY (CoverID) REFERENCES File (CoverID)

What I need to do is create one to one relationships –> One File will have one Cover, and one PDF.

The second is thing I’m having difficulty getting my head around again is the insert statements. Any advice on how I should handle those would be appreciated?

I’m using SQL Server 2008 Also.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:24:12+00:00Added an answer on May 18, 2026 at 2:24 am

    if you want to ensure that a relation will have one to one relationship, then make one big table.

    one table where you have

    create table
    
    ID  int  PK
    
    ISBN nvarchar(MAX)
    
    UserName nvarchar(50)
    
    
    PDFFileContent image
    
    PDFFileName nvarchar
    
    CoverFileContent image
    
    CoverFileName nvarchar
    

    what you might ment in your original design is to make one table that could contain all 3 types and each row is different by having different value at “mime type” which is also possible, if hold keys that relet the table to itself.

    such as

    create table
    ID int pk
    ISBN nvarchar(max)
    userName nvarchar(50)
    pdfID int fk table2 id
    coverID int fk table 2 id
    
    create table2
    id pk int
    fileContent image
    fileName nvarchar
    mimetype (something)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is linked to a question I asked yesterday. Briefly, the problem I'm having
Having worked with Classic ASP for about 2 years now by creating a few
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
I’m having fun with EF and have come unstuck. Originally I used the following
I have recently found the great card came - SET . Briefly, there are
sorry for the cryptic question title. I'm having a strange problem and i have
Briefly, here's the scenario. I have an ASP.NET application using forms authentication and a
I want to do some cross database references in my application. Briefly, i have
I've looked up briefly about the problems of having a dynamically changing site via
I seem to be having problems with my java gui code, and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.