COMU114 - Introduction to Database Development

back to module main page

Hints

Where to look...

Frequently Asked Questions

How do I use the Digital Dropbox?

Do I need to use SQL to create my tables? Do I need to use SQL to enter data into my tables?

Why do I get an error like 'Invalid field name <name> in definition of index or relationship' or 'Could not find field' when creating a table with a foreign key?

 

Q: How do I use the Digital Dropbox

A: Follow these steps:

  1. Log into Blackboard and select the module
  2. Select the Course Tools menu option
  3. Select the Digital Dropbox option
  4. Click the SEND FILE button (not ADD FILE)Digital Dropbox screenshot
  5. Fill in a name and comment for your submission and browse to find the file on your computer you want to send, then click the SUBMIT buttonDigital Dropbox screenshot

back to FAQ list

Q: Do I need to use SQL to create my tables? Do I need to use SQL to enter data into my tables?

A: Yes, you must use SQL to create tables, and you must save your SQL create table statements?

However, you do not need to use SQL to enter data into your tables?

back to FAQ list

Q: Why do I get an error like 'Invalid field name <name> in definition of index or relationship' or 'Could not find field' when creating a table with a foreign key?

A: It could be simply because you've misspelled the name of a field.

Or, it could be because you are using a field in your foreign key which exists as the PK of the other table, but does not exist in the table you are creating. A field must exist in the table before you can use it as a foreign key. For example, from the GCUCars database:

CREATE TABLE Hires(
startDate DateTime NOT NULL,
endDate DateTime,
CDWChosen YesNo NOT NULL,
startMileage Number NOT NULL,
endMileage Number,
status Text(10),
customerID Long NOT NULL,
registration Text(8) NOT NULL,
PRIMARY KEY(customerID, registration, startDate),
FOREIGN KEY(customerID) REFERENCES Customers(customerID),
FOREIGN KEY(registration) REFERENCES Cars(registration)
)

Note that the foreign key fields customerID and registration appear as field definitions:

customerID Long NOT NULL,
registration Text(8) NOT NULL,

AND in the foreign key definitions:

FOREIGN KEY(customerID) REFERENCES Customers(customerID),
FOREIGN KEY(registration) REFERENCES Cars(registration)

back to FAQ list

back to module main page