starting_value, value_left and pin_number
Assumptions:
o Attribute company_name may have upto 25 characters
o Attributes starting_value and value_left are measured in rupees and paisa
o Card_number may have up to 15 digits
o Pin_number is always 12 characters long
------->ANSWER
SQL>
CREATE TABLE CALLING_CARD_743
2 (
3 COMPANY_NAME VARCHAR(25),
4 CARD_NO VARCHAR(15),
5 START_VALUE NUMBER(4,2),
6 VALUE_LEFT NUMBER(4,2),
7 PIN_NO CHAR(12)
8 );
Table created.
Q Rewrite the CREATE TABLE command with attributes card_number identified as the
primary key and pin_number identified as unique.
--------->ANWSER
SQL>
CREATE TABLE CALLING_CARD_743
2 (
3 COMPANY_NAME VARCHAR(25),
4 CARD_NO VARCHAR(15) PRIMARY KEY,
5 START_VALUE NUMBER(4,2),
6 VALUE_LEFT NUMBER(4,2),
7 PIN_NO CHAR(12) UNIQUE
8 );
Table created.
QRewrite the CREATE TABLE command using named constraints.
--------->ANWSER
SQL> DROP TABLE CALLING_CARD_743
2 ;
Table dropped.
SQL> CREATE TABLE CALLING_CARD_743
2 (
3 COMPANY_NAME VARCHAR(25),
4 CARD_NUMBER VARCHAR(15) CONSTRAINT CCARD_NUM_PK_743 PRIMARY KEY,
5 STARTING_VALUE NUMBER(4,2),
6 VALUE_LEFT NUMBER(4,2),
7 PIN_NUMBER CHAR(12) CONSTRAINT CCPIN_NUM_U_743 UNIQUE
8 );
Table created
No comments:
Post a Comment