Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql newb - creating tables

Status
Not open for further replies.

hanan98

Technical User
Apr 2, 2009
1
CA
I have data
Customer(Cust_id, Cust_fname, Cust_lname, Phone_area_code, Cust_phone, Cust_balance)

and want to create it in sql with Cust_id as the primary key.

I came up with this.

Create collection assignment2
Create table assignment2.customer (cust_id char (10 ) not null with default, cust_fname char (10 ) not null with default, cust_lname char (10 ) not null with default, phone_area_code char (3 ) not null with default, cust_phone char (7 ) not null with default, cust_balance char (10 ) not null with default, constraint assignment2.cust_id_pk primary key (cust_id))
Table customer created in assignment2



am I on the right track?
 
u can use alter table command to set primary key to Cust_id
iff the field has no duplicate data
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top