Create a tableAnswer key - 2. Create a table similar to...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
DATABASE DESIGN STUDENT NAME: ________________________________________ID_________________ 1. Create a table called test_const1 with the following columns and constraints: you don't have to name the constraints COLUMN: CONSTRAINT col1 number(4) primary key col2 number(8) unique col3 date DEFAULT SYSDATE col4 number CHECK(col4 < 100) ANSWER: 2. CREATE TABLE test_const1 ( col1 number(4) primary key, col2 number(8) unique, col3 date DEFAULT SYSDATE, col4 number CHECK(col4 < 100))
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. Create a table similar to table test_const_1 called test_const2 with the same columns. This time name two constraints called test_const2_uk and test_const2_chck for columns col2 and col4 respectively. ANSWER: 3. CREATE TABLE test_const2 ( col1 number(4) primary key, col2 number(8) CONSTRAINT test_const2_uk unique, col3 date DEFAULT SYSDATE, col4 number CONSTRAINT test_const2_chck CHECK (col4 &lt; 100)) 3. Alter table test_const2 to disable the test_const2_uk constraint ANSWER: ALTER TABLE test_const2 DISABLE CONSTRAINT test_const2_uk 4. Alter table test_const2 to disable the test_const2_chck constraint ANSWER: ALTER TABLE test_const2 DISABLE CONSTRAINT test_const2_chck 5. Alter table alter table test_const2 to enable the test_const2_chck constraint ANSWER: ALTER TABLE test_const2 ENABLE CONSTRAINT test_const2_chck...
View Full Document

This note was uploaded on 12/27/2011 for the course IT GEIT3341 taught by Professor Sara during the Spring '11 term at Prince Mohammad Bin Fahd University, Dhahran.

Page1 / 2

Create a tableAnswer key - 2. Create a table similar to...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online