In: Computer Science
1.A TIMESTAMP data type is the same as a DATE data type, except that time zone can be specified.. Single choice.
a) True
b) False
2.If the column S_ID is the primary key of the STUDENT table, the constraint name would be pk_STUDENT_S_ID according to the constraint naming convention.. Single choice.
a) True
b) False
3.You can always rename a table.. Single choice.
a) True
b) False
4.Which of the following is not a legal table name according to the Oracle Naming Standard?. Single choice.
a. #COURSE_ID
b. COURSE$ID
c. COURSEID
d. COURSE_ID
5.Which of the following data types is used to store variable length ASCII character data?. Single choice.
a. CHAR
b. NCHAR
c. VARCHAR2
d. NVARCHAR2
6.Deleting columns from a table is a(n) ____ action.. Single choice.
a. restricted
b. unrestricted
c. illegal
d. privileged
7.Which of the following pieces of information about a table is not displayed when using the DESCRIBE command?. Single choice.
a. column name
b. column data type
c. not null settings
d. table constraints
8.When selecting the table_name column from the all_tables view which tables are displayed?. Single choice.
a. all tables in database
b. all tables in user’s schema
c. all tables user has permission to manipulate
d. all newly created tables
9.Which command would be used to delete table x and all foreign key constraints to x?. Single choice.
a. delete x
b. delete x cascade constraints
c. drop x
d. drop x cascade constraints
10.Which of the following is true when decreasing the maximum size of a CHAR column?. Single choice.
a. it is an unrestricted action
b. it is only permitted if all values are NULL
c. all values in the column will be truncated to the new size
d. all values larger than the new size will be automatically set to NULL
11.Which of the following column data type changes is permitted?. Single choice.
a. DATE to CHAR
b. VARCHAR2 to CHAR
c. CHAR to NUMBER
d. NUMBER to DATE
12.Which command is used to disable the constraint named faculty_loc_id_fk in the faculty table?. Single choice.
a. MODIFY TABLE CONSTRAINT DISABLE faculty_loc_id_fk;
b. ALTER TABLE faculty DISABLE faculty_loc_id_fk;
c. MODIFY TABLE faculty DISABLE faculty_loc_id_fk;
d. ALTER TABLE faculty DISABLE CONSTRAINT faculty_loc_id_fk;
Solution 1: No, it is false, as the difference between the date and the timestamp is that the date features the day, month as well as the year while the timestamp features the same but even with the fractional seconds and hence there is nothing about the timezones.
Solution 2: For a unique constraint in SQL, the naming convention is UQ_<TableName>_<ColumnName(s) and it is followed by the example given in the question and hence it is completely true.
Solution 3: Yes, it is true as the table can always be renamed.
Solution 4: Option A is the incorrect table name according to the oracle naming convention as # should not be there at the start of a table name.
Solution 5: Option D is the correct option as the nvarchar is a datatype that is used for storing the variable length character data.
Solution 6: Option B is the correct option as the columns can be deleted from the tabel using the drop columns command from the table.
Solution 7: Option D is the correct option as the table constraints are not displayed by the desc command.
Solution 8: Option C is the correct option as the given command actually displays all tables user has permission to manipulate.
Solution 9: Option D is the correct option as the drop x cascade constraints is the command that can be used to delete a table with all the foreign key constraints.
Solution 10: Not sure about this solution, cannot provide you with wrong answers, thanks for understanding dear.
Solution 11: Option C is the correct option as VARCHAR2 to CHAR is the only change that is allowed within the table columns.
Solution 12: Option D is the correct option as it is the correct way to disable the constraints on a table.
Here's the solution to your question, please provide it a 100% rating. Thanks for asking and happy learning!!