Week2 - Data Definition Language / Explore | E-BOX DBMS

Week2 - Data Definition Language / Explore | E-BOX DBMS

Week2 - Data Definition Language / Explore

The questions can come in any order, so make sure you are selecting right option for all questions.

Which of the following is/are the DDL statements?

    (d) All of the Mentioned

You can drop a column with the help of DELETE

    (b) FALSE

Which command defines its columns, integrity constraint in create table:

    (a) Create command

In Oracle, which command(s) is(are) used to change a table’s storage characteristics?

    (a) ALTER TABLE

Which command allows the removal of all rows from a table but flushes a table more efficiently since no rollback information is retained:

    (a) TRUNCATE command

You want to put a CHECK constraint on the EMP_AGE column of employee table such that it should accept the age value greater than 23. Which of the following alter statements will help you achieve this?

    (d) ALTER TABLE employee ADD CONSTRAINT check_age CHECK (EMP_AGE > 23);

How can you remove a column named 'salary' from the 'employees' table?

    (b) ALTER TABLE employees DROP COLUMN salary;

**CREATE TABLE departments
(
dept_id NUMBER (2),
dept_name VARCHAR2(14) DEFAULT ‘CSE’,
create_date DATE
);

What is true about the above statement? **

    (a) It will automatically commit the transaction in session
    (b) It will create the table DEPARTMENTS in the schema
    (c) It will set a default value for dept_name column

Which statements are true about 'Alter' Statement ?

    (e) All the above

What is the syntax for creating a table?

    (a)
    create table table_name(
           column_name1 datatype1,
           column_name2 datatype2,
           column_name3 datatype3
    );

Which is not a ddl statement ?

    (c) delete

'Insert ' is a ddl statement .

    (b) false

___________ defines rules regarding the values allowed in columns and is the standard mechanism for enforcing database integrity.

    (c) Constraint

What is true about PRIMARY KEY constraint?

    (a) It applies a NOT NULL constraint implicitly to the column on which it is defined
    (b) It applies a UNIQUE KEY constraint implicitly to the column on which it is defined

**CREATE TABLE mytable(name CHAR(10) NOT NULL,
age INTEGER CHECK (age > 0));

Which type of constraint is created in the above statement? **

    (a) Column level constraint