Computers, Consoles and I.T. Post all computer related chat in here for our I.T techies to help with. Please be aware that any discussions related to piracy will be removed and render the member liable to a possible ban. Piracy renders PassionFord Admin liable for prosecution, as well as its members.

SQL help needed.

Old Feb 18, 2005 | 07:39 AM
  #1  
Andreas's Avatar
Andreas
Thread Starter
PassionFord Post Whore!!
 
Joined: May 2003
Posts: 3,551
Likes: 0
Default SQL help needed.

Im supposed to create a database in a uni assignment and need some hints on how to solve a problem.

Ive created 4 tables and one of them is a connection table for the others where i would like to run some test on the data entered to make shure it already exists in the database. You are supposed to sign up for a class by entering its ClassCode and the database should check if the ClassCode exists. ie the return a TRUE or FALSE to the database handler.

So basicily this is what i want to do:
CREATE TABLE ClassSignup
classcode VARCHAR(6) NOT NULL
CONSTRICTION CheckIfClasscodeExists
CHECK (EXISTS (SELECT classcode FROM class));

The problem is that the CHECK-statement dont allow me run subqueries within it so im stuck and dont know how to proceed to get the proper result?
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
J4son
Computers, Consoles and I.T.
2
Nov 29, 2005 11:02 PM
Bread
General Car Related Discussion.
1
May 22, 2005 10:18 AM
essexrsturbo
General Car Related Discussion.
2
Apr 24, 2005 11:34 PM
Jim Galbally
General Car Related Discussion.
3
Sep 10, 2004 02:42 PM
Jim Galbally
General Car Related Discussion.
10
Sep 8, 2004 02:10 PM


Thread Tools
Search this Thread

All times are GMT. The time now is 07:14 AM.