Re: Create Table Question

From: Stephen_CA <stephen.bell_at_sympatico.ca>
Date: 10 Jul 2003 06:22:24 -0700
Message-ID: <5aeee507.0307100522.6610d8d4_at_posting.google.com>


Victor M. <eh936_at_hotmail.com> wrote in message news:<MPG.1976438ceaff88bb989681_at_nntp.slnt.phub.net.cable.rogers.com>...
> How would you setup a sample Create Table statement with having to
> specify a constraint name for a Primary Key in the table.
>
> Would it go something like this:
>
> Create Table EMPLOYEES
> (
> FName VARCHAR(15) NOT NULL,
> MINIT CHAR,
> LName VARCHAR(15) NOT NULL,
> SSN CHAR(9) NOT NULL,
> BDATE CHAR(25),
> Address VARCHAR(30),
> Sex CHAR,
> Salary DECIMAL(10,2),
> SUPERSSN CHAR(9),
> DNO INT,
> Primary Key(SSN) Constraint PK_SSN, <------ look here ------
> Foreign Key(SUPERSSN) REFERENCES EMPLOYEES(SSN),
> Foreign Key(DNO) REFERENCES DEPARTMENT(DNUMBER)
> );
>
> Thanks in advance
>
> Victor
Hi Victor,

If you're just asking for the syntax, it's:

constraint test_pk primary key(SSN) Received on Thu Jul 10 2003 - 15:22:24 CEST

Original text of this message