0

databases Online Quiz - 58

Description: databases Online Quiz - 58
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

  1. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson' ;

  2. SELECT * FROM Persons WHERE FirstName LIKE 'Peter' AND LastName LIKE 'Jackson';

  3. SELECT FirstName='Peter', LastName='Jackson' FROM Persons

  4. SELECT FirstName LIKE 'Peter', LastName LIKE 'Jackson' FROM Persons


Correct Option: A

With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

  1. SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName

  2. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen' ;

  3. SELECT LastName>'Hansen' AND LastName

  4. SELECT LastName LIKE'%Hansen%' AND LastName LIKE '%Pettersen%' FROM Persons ;


Correct Option: B

With SQL, how can you insert a new record into the "Persons" table?

  1. INSERT ('Jimmy', 'Jackson') INTO Persons ;

  2. INSERT VALUES ('Jimmy', 'Jackson') INTO Persons ;

  3. INSERT INTO Persons VALUES ('Jimmy', 'Jackson') ;

  4. INSERT VALUES ('Jimmy', 'Jackson') INTO Table Persons ;


Correct Option: C

With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?

  1. INSERT INTO Persons ('Olsen') INTO LastName ;

  2. INSERT INTO Persons (LastName) VALUES ('Olsen');

  3. INSERT ('Olsen') INTO Persons (LastName) ;

  4. INSERT INTO Table Persons (LastName) VALUES ('Olsen');


Correct Option: B

Which SQL statement is used to delete data and its tablespace from a database?

  1. DELETE

  2. TRUNCATE

  3. REMOVE

  4. None of the Above


Correct Option: B
  1. SELECT Persons.FirstName ;

  2. EXTRACT FirstName FROM Persons ;

  3. SELECT FirstName FROM Persons;

  4. EXTRACT Persons.FirstName


Correct Option: C

Which SQL statement is used to return only different values?

  1. SELECT DIFFERENT

  2. SELECT DISTINCT

  3. SELECT UNIQUE

  4. All of the above


Correct Option: B

What does SQL stand for?

  1. Structured Query Language

  2. Strong Question Language

  3. Structured Question Language

  4. None of the Above


Correct Option: A

Identify whether the following statement is true or false

  1. True

  2. False


Correct Option: B

AI Explanation

To answer this question, we need to understand the given statement and determine its truth value.

The given statement is: "Correct Answer is: B"

The correct answer is indeed B.

Therefore, the statement "Correct Answer is: B" is true.

So, the correct answer is A) True.

Which of the following data types are specific only to Teradata and not compatible to ANSI.

  1. LONG VARCHAR

  2. BYTEINT

  3. DATE

  4. TIMESTAMP WITH ZONE


Correct Option: A,B,C

Which of the following does not hold true for the subqueries?

  1. Can be the object of an IN or NOT IN clause

  2. Can be the object of EXISTS or NOT EXISTS

  3. Support quantifiers ALL, ANY, SOME

  4. Support LIKE or NOT LIKE used with a

  5. Cannot specify more than one column to match


Correct Option: E

Which of the following is not a DDL statement?

  1. CREATE

  2. DROP

  3. MODIFY

  4. ALTER

  5. GRANT

  6. REPLACE


Correct Option: E

Which SELECT statement should you use if you want to display unique combinations of the POSITION and MANAGER values from the EMPLOYEE table?

  1. SELECT DISTINCT position, manager

  2. SELECT position, manager DISTINCT

  3. SELECT position, manager

  4. SELECT position, DISTINCT manager


Correct Option: A

Which two are attributes of /SQL*Plus?

  1. SQL*Plus commands cannot be abbreviated.

  2. SQL*Plus commands are accesses from a browser.

  3. SQL*Plus commands are used to manipulate data in tables.

  4. SQL*Plus commands manipulate table definitions in the database.


Correct Option: C,D

Which is an /SQL*Plus command?

  1. Insert

  2. update

  3. select

  4. describe

  5. delete

  6. rename


Correct Option: D

Evaluate this SQL statement: SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAME. FROM EMP e, DEPARTMENT d WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID; In the statement, which capabilities of a SELECT statement are performed?

  1. Selection, projection, join

  2. Difference, projection, join

  3. Selection, intersection, join

  4. Intersection, projection, join

  5. Difference, projection, product


Correct Option: A

Which two statements are true regarding the ORDER BY clause?

  1. The sort is in ascending by order by default

  2. The sort is in descending order by default

  3. The ORDER BY clause must precede the WHERE clause.

  4. The ORDER BY clause is executed on the client side.

  5. The ORDER BY clause comes last in the SELECT statement.

  6. The ORDER BY clause is executed first in the query execution.


Correct Option: A,E

From SQL*Plus, you issue this SELECT statement: SELECT* From orders; You use this statement to retrieve data from a data table for __________.

  1. updating

  2. viewing

  3. deleting

  4. inserting

  5. truncating


Correct Option: B,D

Evaluate this SQL*Plus command: START delaccount Which task will this command accomplish?

  1. It executes the DELACCOUNT PL/SQL routine.

  2. It runs the DELACCOUNT.SQL script file.

  3. It creates the DELACCOUNT file using the default file extension.

  4. It invokes the editor to edit the contents of the DELACCOUNT file.


Correct Option: B
Explanation:

To solve this question, the user needs to have some basic knowledge about SQL*Plus. This command starts a SQL*Plus script from the current directory.

Now, let's go through each option and explain why it is right or wrong:

A. It executes the DELACCOUNT PL/SQL routine. - This option is incorrect as START command is used to start a SQL script or a file and not a PL/SQL routine.

B. It runs the DELACCOUNT.SQL script file. - This option is correct as the START command is used to start a SQL script or a file. Here, the command START delaccount will run the DELACCOUNT.SQL script file.

C. It creates the DELACCOUNT file using the default file extension. - This option is incorrect as the START command is used to start an existing SQL script or file and not for creating a new file.

D. It invokes the editor to edit the contents of the DELACCOUNT file. - This option is incorrect as the START command is used to start an existing SQL script or file and not for invoking the editor to edit the contents of a file.

Therefore, the answer is:

The Answer is: B

Which /SQL*Plus feature can be used to replace values in the WHERE clause?

  1. Substitution variables

  2. Replacement variables

  3. Prompt variables

  4. Instead-of variables


Correct Option: A
Explanation:

To solve this question, the user needs to know the basic functionalities of SQL*Plus.

The feature that can be used to replace values in the WHERE clause is Substitution variables.

Option A is correct. Substitution variables can be used to replace values in the WHERE clause at runtime. They begin with an ampersand (&) and can be used to replace any part of the SQL query, including the WHERE clause.

Option B is incorrect. Replacement variables are not a feature of SQL*Plus, and they cannot be used to replace values in the WHERE clause.

Option C is incorrect. Prompt variables are also not a feature of SQL*Plus and cannot be used to replace values in the WHERE clause.

Option D is incorrect. Instead-of variables are not a feature of SQL*Plus and cannot be used to replace values in the WHERE clause.

The answer is: A

- Hide questions