General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
SQL constraint question
Using the following CREATE TABLE statements, add AND EXPLICITLY NAME the listed constraints specified for each table. Use the naming convention TableName_ColumnName_ ConstraintTypeAbbreviation for each constraint name. Constraint abbreviations are:
? PK for Primary Key
? FK for Foreign Key
? NN for Not Null.
To complete the exercise:
? All Primary Key constraints should be defined at the table level.
? All NOT NULL constraints should be defined at the column level.
? All Foreign Key constraints should be defined using the ALERT TABLE statement.
STUDENT table:
Add the following constraints to identified columns in the CREATE TABLE statement or the Student table:
PRIMARY KEY - student_id
NOT NULL - lname, fname, phone
CREATE TABLE student
(
student_id NUMBER(5)
lname VARCHAR2(15)
fname VARCHAR2(15)
street VARCHAR2(20)
city VARCHAR2(20)
state CHAR(2)
zip NUMBER(9)
phone NUMBER(10
);