Test Your SQL Basics - Part_3
Manipulating Data Questions
1. What all operations can MERGE statement perform in SQL?- INSERT
- DELETE
- GROUP BY
- None of the above
2.Which of following commands is a DDL (Data Definition Language) command but is often considered along with DML commands?
- DELETE
- INSERT
- TRUNCATE
- None of the above
3. What among the following is a TRUNCATE statement equivalent to? (Choose the most suitable answer)
- To a DELETE statement
- To an UPDATE statement
- A DELETE statement without a WHERE clause
- None of the above
4.Which of the following situations indicate that a DML operation has taken place?
- When new rows are added to a table
- When two queries are combined
- When a table is truncated
- None of the above
5.What is true about the keyword VALUES in INSERT statements?
- VALUES can add multiple rows at a time during the INSERT
- VALUES can add only 100 rows at a time during the INSERT
- VALUES is mandatory to be used if we use the keyword INSERT
- VALUES add only one row at a time
6. Which of the following commands is used to save the changed data in a table permanently?
- ROLLBACK
- COMMIT
- INSERT
- UPDATE
7. Which of the following commands / statements would end a transaction?
- COMMIT
- SELECT
- SAVEPOINT
- CREATE
8.What happens when a transaction is committed?
- The changes made during the transaction are saved for a particular user session
- The changes made during the transaction are discarded
- If the transaction is a DDL, the commit doesn't work
- None of the above
9. Which of the following reasons will the best one on the usage of string?
- Using sub-queries
- Syntax errors
- Access permissions
- Constraint violations
Using DDL Statements Questions
1.DDL statements are used for which of the following Oracle database objects?
- Tables
- Sub-queries
- Rows
- Columns
2.What is the basic unit of storage in Oracle Database that contains data?
- View
- Column
- Query
- Table
3.Which of the following database objects improves the performance of some queries?
- Table
- Synonym
- View
- Index
4. When a table can be created?
- When the database is not being used by any user
- When the database is newly created
- It can be created any time, even when a user is using the database
- None of the above
5. What is true about a table?
- It is not mandatory to specify the size of a table
- The size of each table is the same
- A table can be modified online
- None of the above
6. A table named 123_A is created for storing the number of employees in an organization. What is wrong in the name of the table?
- The name of a table cannot start with a digit
- Nothing is wrong in this name.
- You cannot use an underscore while naming a table
- None of the above
7. What among the following are the pre-requisites for creating a table?
- CREATE TABLE privilege
- Storage space
- Data in the table
- None of the above
8. What is the syntax for creating a table?
- CREATE TABLE [schema.] table (column datatype [DEFAULT expr] [,..] );
- CREATE TABLE INTO [schema.] table (column datatype [DEFAULT expr] [,..] );
- CREATE TABLE VALUES [schema.] table (column datatype [DEFAULT expr] [,..] );
- None of the above
9. What is true about a namespace?
- It is a group of object types
- Within a namespace, all the object names should be uniquely identified by schema and name
- The same type of objects in different namespaces can share the same name
- All of the above
10. Which of the following object types share the same namespace?
- Synonyms
- Table
- Views
- All of the above
11. Which of the following are the data types for date and time data?
- TIMESTAMP
- INTERVAL DAY TO SECOND
- TIMESTAMP WITH LOCAL TIMEZONE
- All of the above
12. Which of the following data types are for large objects?
- CLOB
- BLOB
- RAW
- All of the above
13. What will happen if the inserted value is of a smaller length as defined for a VARCHAR2 data type column?
- It will throw an ORA error
- It will get inserted successfully and the value will take up as much space as it needs.
- It will get inserted and the remaining space will be padded with spaces
- None of the above
14. What happens when a table which is marked Read Only is attempted for drop?
- It will throw an error
- It will no longer remain Read Only but cannot be dropped either
- It will be dropped without errors
- It will remain un-touched
15. Which of the following data types cannot be used with a GROUP BY and an ORDER BY clause?
- CLOB
- VARCHAR2
- CHAR
- LONG
16. How many LONG columns can a table contain?
- None
- Maximum 2
- Minimum 2
- Only one
Creating Other Schema Objects Questions
1. What among the following is true about synonyms?
- PUBLIC and PRIVATE synonyms can have the same name for the same table
- DROP SYNONYM will remove a synonym
- DROP PUBLIC SYNONYM can be executed only by a SYSDBA
- None of the above
2. What is true about creating a view? (Choose the most appropriate answer)
- A view can only be created from a table
- A view can only be created from one table
- A view can be created from one or many tables or views
- None of the above
3. Which of the following privileges are required to create views in one's own schema?
- CREATE TABLE system privilege
- CREATE VIEW system privilege
- ALTER VIEW system privilege
- CREATE ANY VIEW system privilege
4.How is a view stored in the data dictionary?
- As a WHERE clause
- As a CREATE statement
- As an UPDATE statement
- As a SELECT statement
5.Which of the following can contain single-row functions?
- Inline Views
- Simple Views
- Complex Views
- Composite Views
6.When can the rows from a view be removed?
- Deletion of rows through a view is not possible
- It should be a simple view
- It should be a complex view
- None of the above
7.When can the data in a view not be modified?
- When there are group expressions
- When there is a GROUP BY clause
- When ROWNUM is used in the view query
- All of the above
8.What is true about the WITH CHECK CONSTRAINT?
- INSERTs or UPDATEs performed through the view cannot create rows that the view cannot select
- Only INSERTs performed through the view cannot create rows that the view cannot select
- Only UPDATEs performed through the view cannot create rows that the view cannot select
- None of the above
9.How can you prevent DML operations on a View?
- By defining a WITH CHECK OPTION constraint
- By defining a WITH READ ONLY option
- Neither of A nor B
- None of the above
10.What is true about the above statement?
- The view will not be created
- INSERT operation on this view an will throw an ORA error
- On UPDATING the rows for all the employees in department 100, an ORA error will be thrown
- None of the above
11.How many rows can be deleted from the view as shown above?
- All rows of the view
- All the rows of only the department 100
- No rows
- None of the above
12.What is true about sequences?
- It generates integers
- It is a shareable object
- Can be used to create a PRIMARY KEY value
- All of the above
13.What can be the last value generated by this sequence?
- 0
- 100
- 101
- 9999
14.What is true about NEXTVAL pseudo column?
- It re-generates the CURRVAL of a sequence
- It returns the next available sequence value
- It can return duplicate values
- It generates the same values for different users
15.What is true about CURRVAL pseudo column?
- CURRVAL can be used before NEXTVAL with respect to a sequence
- CURRVAL gives the current value of a sequence
- CURRVAL can give duplicate values
- None of the above
16.Which of the following is used by an index to locate the data quickly?
- ROWNUM
- ROWID
- Sequence
- None of the above
17.What happens when there is no index on a column of a table?
- The data is located quickly
- There is a full table scan
- The table cannot be created
- The table cannot be altered
Comments
Post a Comment