Oracle__3. Oracle 1Z0-051 Exam - Table Objects Flashcards
Can a column with a UNIQUE constraint store nulls.
Yes
Can a foreign key contain a null value?
Yes
Is a constraint only enforced by an INSERT operation on the table?
NoA constraint is also enforced by an UPDATE operation on a table
Can a constraint be disabled even if the column contains data?
Yes
Can all constraints be defined at the column level as well as the table level?
NoNULL and NOT NULL are only defined at the column level
Can a constraint prevent deletion of a table?
YesIf there are dependencies. A parent cannot be deleted if a child exists.
Can a table from another schema in the same database be viewed be used in a different schema?
Yesadd prefix to the tablename to access that table from the other schema
Can the ALTER TABLE statement be used to modify a constraint after a table is created?
Yes
What is returned from this statement? CREATE TABLE order (trans_id Number(6) NOT NULL, trans_date DATE NOT NULL, cust_name CHAR, trans_Valid VARCHAR2)
an errorThe varchar2 needs a size value
How many characters can be store in the cust_name field? CREATE TABLE order (trans_id Number(6) NOT NULL, trans_date DATE NOT NULL, cust_name CHAR, trans_Valid VARCHAR2(5))
only 1 character because the size was not identified to the default of one is used.
What is the length of the cust_name field if the value is ‘Ac’? CREATE TABLE order (trans_id Number(6) NOT NULL, trans_date DATE NOT NULL, cust_name CHAR(5), trans_Valid VARCHAR2(5))
5the CHAR field is right-padded with spaces
What is the length of the trans_valid field if the value is ‘Ac’? CREATE TABLE order (trans_id Number(6) NOT NULL, trans_date DATE NOT NULL, cust_name CHAR(5), trans_valid VARCHAR2(5))
2The VARCHAR2 only uses the spaces needed
What is the largest value that can be stored in trans_id? CREATE TABLE order (trans_id Number(2) NOT NULL, trans_date DATE NOT NULL, cust_name CHAR(5), trans_Valid VARCHAR2(5))
99
What is the largest value that can be stored in trans_id? CREATE TABLE order (trans_id Number(2,1) NOT NULL, trans_date DATE NOT NULL, cust_name CHAR(5), trans_valid VARCHAR2(5))
9.9The scale of 1 takes one value from the precision
In defining a numeric field, precision is defined as what?
The total number of decimal digits allowed in the field, either left or right of the decimal.
If defining a numeric field, scale is defined as what?
The total number of digit to the right of the decimal point.
What is the precision of trans_id? CREATE TABLE order (trans_id Number NOT NULL, trans_date DATE NOT NULL, cust_name CHAR(5), trans_valid VARCHAR2(5))
38 digits
What is the maximum size number allowed for a CHAR?
2000
What is the maximum value for a date data type?
12-DEC-9999
What will result after the execution of this statement? CREATE TABLE EMP9$#_A as (empid number(2))
It will create a table name EMP9$#_A with one numeric field named empid.
What will result after the execution of this statement? CREATE TABLE EMP*123 as (empid number(2))
It will fail because there is an arithmetic expression in the table name
What will result after the execution of this statement? CREATE TABLE package as (empid number(2))
It will fail because PACKAGE is a keyword for Oracle
What will result after the execution of this statement? CREATE TABLE ord_details (ord_id NUMBER(2) CONSTRAINT ord_id_pd PRIMARY KEY, ord_date DATE DEFAULT SYSDATE NOT NULL, ord_amount NUMBER(5,2) CONSTRAINT ord_amount_min CHECK (ord_amount >=50), ord_status VARCHAR2(15) CONSTRAINT order_status_chk CHECK(ord_status IN (‘Shipped’,’Not Shipped’)) ord_pay_ode VARCHAR2(15) CONSTRAINT ord_pay_chk CHECK (ord_pay_mode in (‘Check’,’Credit Card’,’Cash’)));
It will execute successfully
What term is used to choose rows from a table?
Selection