Re: Create Table Question

From: michael ngong <mngong_at_yahoo.com>
Date: 10 Jul 2003 05:49:27 -0700
Message-ID: <ecf365d5.0307100449.6997aa74_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

The line with the primary key should read

constraint pk_ssn primary key(ssn)

Michael Tubuo Ngong Received on Thu Jul 10 2003 - 14:49:27 CEST

Original text of this message