Database [3i Infotech Placement]: Sample Questions 151 - 152 of 294

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 151

Database
Edit

Describe in Detail

Essay▾

What command is used to get back the privileges offered by the GRANT command?

Explanation

Understanding of REVOKE Command
  • REVOKE command is used to get back the privileges offered by the GRANT command.
  • It takes back permission from user.
  • Removes user access rights or privileges to the database objects.
  • We can revoke any combination of SELECT, INSERT, UPDATE, DELETE, REFERENCEs, ALTER, or ALL.

SQL REVOKE Command:

REVOKE privilege_name

ON object_name

FROM {user_name|PUBLIC|role_name}

  • privilege_name:
    • Access right or privilege granted to the user.
  • object_name:
    • The name of a database object like TABLE, VIEW, STORED PROC and SEQUENCE.
  • user_name:
    • The name of the user which access right is being granted.
  • role_name:
    • A set of privileges grouped together.

Question 152

Database

Question

MCQ▾

Is it possible to modify a Datatype of a column when column contains data?

Choices

Choice (4)

a.

No

b.

Yes

c.

Question does not provide sufficient data or is vague

d.

None of the above

Answer

a.

Explanation

  • No, it is not always possible to modify a datatype of a column when column contains data.
  • If the table is empty or the column contains null values, we can change the column to any datatype.
  • However, we can change the datatype of a column to a compatible data type for example an INT can be changed to a FLOAT.

ALTER TABLE

  • Alter table changes column datatype or renames a column.
  • Used to add, modify, or delete columns in a table.
  • Statement is also used to rename a table.

Syntax:

ALTER TABLE table_name

ADD column_name column-defination.

Developed by: