A Learning Portal from Recruitment India
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Data Manipulation Language(DML)
Data Definition Language(DDL)
Both of above
Answer with explanation
Answer: Option BExplanation
The Data Definition Language (DDL) is used to manage the table and index structure.
CREATE, ALTER, RENAME, DROP and TRUNCATE statements are the names of few data definition elements.
Workspace
The SQL -92 wildcards are ____ and ____ .
asterisk (*); percent sign (%)
percent sign (%); underscore (_)
underscore(_); question mark (?)
question mark (?); asterisk (*)
Answer with explanation
Answer: Option BExplanation
percent sign (%); underscore (_)
Workspace
Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct interpretation of the above query?
Find the names of all suppliers who have not supplied only non-blue parts.
Find the names of all suppliers who have supplied a non-blue part
Find the names of all suppliers who have supplied only non-blue parts.
Find the names of all suppliers who have not supplied a non-blue part
Answer with explanation
Answer: Option BExplanation
Find the names of all suppliers who have supplied a non-blue part
Workspace
If a query involves NOT, AND, OR with no parenthesis!
NOT will be evaluated first; AND will be evaluated second; OR will be evaluated last
NOT will be evaluated first; OR will be evaluated second; AND will be evaluated last.
AND will be evaluated first; OR will be evaluated second; NOT will be evaluated last
The order of occurrence determines the order of evaluation.
Answer with explanation
Answer: Option AExplanation
NOT will be evaluated first; AND will be evaluated second; OR will be evaluated last.
Workspace
In the existing table, ALTER TABLE statement is used to
Add columns
Add constraints
Delete columns
All of the above
Answer with explanation
Answer: Option DExplanation
The ALTER TABLE statement is used to add, delete, or modify columns and constraints e.g. UNIQUE KEY, FOREIGN and NOT NULL etc. in an existing table.
Workspace
In an SQL SELECT statement querying a single table, according to the SQL-92 standard the asterisk (*) means that:
all columns of the table are to be returned.
all records meeting the full criteria are to be returned.
all records with even partial criteria met are to be returned.
None of the above is correct.
Answer with explanation
Answer: Option AExplanation
all columns of the table are to be returned.
Workspace
Which statement is wrong about PRIMARY KEY constraint in SQL?
The PRIMARY KEY uniquely identifies each record in a SQL database table
Primary key can be made based on multiple columns
Primary key must be made of any single columns
Primary keys must contain UNIQUE values.
Answer with explanation
Answer: Option CExplanation
Workspace
Which SQL keyword is used to retrieve only unique values
DISTINCTIVE
UNIQUE
DISTINCT
DIFFERENT
Answer with explanation
Answer: Option CExplanation
This command is used to select the distinct rows.
For Example: If we want to select all distinct department names from employee table, the query would be:
SELECT DISTINCT dept FROM employee;
Workspace
If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default ______________
ASC
DESC
There is no default value
None of the mentioned
Answer with explanation
Answer: Option AExplanation
ASC is the default sort order. Null values are treated as the lowest possible values.
Workspace
Structured Query Language
Structured Query List
Simple Query Language
None of these
Answer with explanation
Answer: Option AExplanation
SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS).
Originally based upon relational algebra and tuple relational calculus, SQL consists of a data definition language and a data manipulation language. The scope of SQL includes data insert, query, update and delete, schema creation and modification, and data access control.
Workspace
Which of the following are TCL commands?
UPDATE and TRUNCATE
SELECT and INSERT
GRANT and REVOKE
ROLLBACK and SAVEPOINT
Answer with explanation
Answer: Option DExplanation
Transaction control commands manage changes made by DML commands. These SQL commands are used for managing changes affecting the data.
Workspace
Wrong statement about UPDATE keyword is
If WHERE clause in missing in statement the all records will be updated
Only one record can be updated at a time using WHERE clause
Multiple records can be updated at a time using WHERE clause
None is wrong statement
Answer with explanation
Answer: Option BExplanation
If you omit the WHERE clause, ALL records will be updated.
Workspace
Which of the following is true about the use of modifiers?
If no accessibility modifier (public, protected, and private) is specified for a member declaration, the member is only accessible for classes in the package of its class and subclasses of its class anywhere
You cannot specify accessibility of local variables. They are only accessible within the block in which they are declared
Subclasses of a class must reside in the same package as the class they extend
Local variables can be declared static
Answer with explanation
Answer: Option BExplanation
You cannot specify accessibility of local variables. They are only accessible within the block in which they are declared
Workspace