oracle1

Ace your homework & exams now with Quizwiz!

Which of the following are the five built-in functions provided by SQL? SUM, AVG, MIN, MAX, MULT SUM, AVG, MIN, MAX, NAME COUNT, SUM, AVG, MAX, MIN SUM, AVG, MULT, DIV, MIN

COUNT, SUM, AVG, MAX, MIN

Queries containing set operators are called ______ . Outer queries Compound queries Subqueries Inner queries

Compound queries

Queries containing set operators are called __________ . Outer queries Compound querires Subqueries Inner queries

Compound querires

The condition INSERT FIRST command evaluates the WHEN condition in order. For all conditions that are true a row is inserted into the appropriate table. True False

False

You can update only a single column at a time in a table. True False

False

Queries that return more than one row from the inner SELECT statement are called Single-row subqueries Multiple-row subqueries Sing-column subqueries Multiple-column subqueries

Multiple-row subqueries

Consider the SQL statement. Which of the following clauses does not sort the result rows by the salary values in the ascending order? SELECT last_name "Employee", salary "Salary" FROM employees ORDER BY 2 ORDER BY "Salary" ASC; ORDER BY salary; ORDER BY "Salary" DESC;

ORDER BY salary;

If there are schemas named USERA and USERB, and both have an EMPLOYEES table, then if USERA wants to access the EMPLOYEES table that belongs to USERB, USERA must write select statement as follows: SELECT * FROM employees.userb; SELECT * FROM employees; SELECT * FROM userb.employees; SELECT * FROM usera.employees;

SELECT * FROM userb.employees;

Which SQL statement is used to return only different values? SELECT DISTINCT SELECT DIFFERENT SELECT UNIQUE EXTRACT DESC

SELECT DISTINCT

With SQL, how do you select a column named "FirstName" from a table named "Persons"? EXTRACT FirstName FROM Persons SELECT Persons.FirstName EXTRACT FROM Persons SELECT FirstName FROM Persons

SELECT FirstName FROM Persons

Consider the EMPLOYEES table. Which of the following displays the maximum average salary for each department? SELECT MAX(AVG(salary)) FROM employees SELECT AVG(MAX(salary)) FROM employees GROUP BY department_id SELECT MAX(AVG(salary)) FROM employees GROUP BY department_id SELECT department_id, MAX(AVG(salary)) FROM employees GROUP BY department_id

SELECT MAX(AVG(salary)) FROM employees GROUP BY department_id

Consider the EMPLOYEES table. Which of the following statements displays the date in the 'January, 19 1998'? SELECT TO_DATE(hire_date,'fmMONTH, DD YYYY') FROM employees SELECT TO_DATE(hire_date,'fmMonth, DD YYYY') FROM employees SELECT TO_CHAR(hire_date,'fmMonth, DD YYYY') FROM employees SELECT TO_DATE(hire_date,'fmMON, DD YEAR') FROM employees

SELECT TO_CHAR(hire_date,'fmMonth, DD YYYY') FROM employees

A table can be created with or without data. True False

True

Privileges, roles, and synonyms are all used to implement security in an Oracle database. True False

True

The NOT NULL constraint enforces a column to not accept null values True False

True

The NUMBER data types is usually the best choice for a primary key. True False

True

The TRUNCATE command removes all data permanently from a table. True False

True

The data dictionary view USER_TAB_PRIVS_MADE lists details of table privilege grants performed by the current user. True False

True

Transaction control determines when data manipulates becomes permanent in a database. False True

True

You can not order the results of a set operation False True

True

You can rename a table with the RENAME or the ALTER TABLE command. True False

True

Use the _____ operator to return all rows from multiple tables and eliminate any duplicate rows. INTERSECT UNION UNION ALL MINUS

UNION

The ____ operator returns all rows that are selected by either query INTERSECT MINUS UNION UNION ALL

UNION ALL

The ____ operator compares a value to EACH value returned by a subquery ALL NOT SOME ANY

ANY

Which keyword is used to provide an alias to a column? COLUMN AS ALIAS IS

AS

Which command is used to view the structure of the table LOCATIONS? PRINT LOCATIONS SELECT * FROM LOCATIONS DESCRIBE LOCATIONS SHOW STRUCTURE LOCATIONS

DESCRIBE LOCATIONS

To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included. ONLY DISTINCT SINGLE UNIQUE

DISTINCT

Which keyword is used to eliminate duplicate rows in the result? HAVING DISTINCT DESCRIBE GROUP BY

DISTINCT

When executed, this statement cannot be rolled back ALTER TABLE DROP TABLE DELETE TABLE REMOVE TABLE

DROP TABLE

Which SQL statement is used to update data in a database? modify save update save as

update

Which of the following is a concatenation operator? * + || &

||

Which of the following statements about aliases is NOT true? Aliases immediately follows the column name The keyboard AS between an alias and a column name is optional Aliases always require double quotation marks Aliases rename column heading

Aliases always require double quotation marks

You can nor selectively delete rows a table. True False

False

What will be the result of the following SQL statement?SELECT SUBSTR ('Hello,World!!!',13) FROM DUAL !!! Hello, World! An error will occur, since SUBSTR function need to take 3 parameters Hello,World!!!13

!!!

What will be the result of the following SQL statement? (SYSDATE is a date of your exam)SELECT TO_CHAR(SYSDATE, 'DD.MM.YY') FROM Dual; 31.May.2013 An error will occur 31.05.2013 31.05.13

31.05.13

What will be the result of the following query?SELECT ROUND (63.548, -1) FROM DUAL; 63 60 70 64

60

The ______ operator compares a value to every value returned by a subquery. Some All Not Any

All

The wildcard in a WHERE clause is useful when? An exact match is necessary in a SELECT statement. An exact match is necessary in a CREATE statement. An exact match is not possible in a SELECT statement. An exact match is not possible in a CREATE statement.

An exact match is not possible in a SELECT statement.

The ______ constraint defines a condition that each row must satisfy. FOREIGN KEY PRIMARY KEY CHECK UNIQUE

CHECK

Which SQL statement is used to create a database? NEW DATABASE CREATE DATABASE TEST CREATE DB CREATE TABLE

CREATE DATABASE TEST

Which SQL statement is used to create a table in a database? CREATE DATABASE TABLE CREATE DATABASE TAB CREATE TABLE CREATE DB

CREATE TABLE

Any user can grant or revoke ant type of system privileges to or from another user. True False

False

The UNION and UNION ALL set operator have the opposite effect other. True False

False

The data of a temporary table is visible to all session. True False

False

What will be the result of the following SQL statement? (SYSDATE is a date of your exam)SELECT TO_CHAR(SYSDATE, 'Day') FROM Dual; 31-05.2013 31.05.2013 Friday 31

Friday

You can place the subquery in a number of SQL clauses, including the following:I. WHERE clauseII. HAVING clauseIII. FROM clause I and III I,II and III I only I and II

I,II and III

Which of the following functions finds the numeric position of a named character? INSTR SUBSTR TRIM CONCAT

INSTR

Which of the following functions finds the numeric position of a named character? INSTR TRIM CONCAT SUBSTR

INSTR

The SQL WHERE clause: Both A and B are correct. Limits the row data are returned. Limits the column data that are returned. Neither A nor B are correct.

Limits the row data are returned.

What will be the result of the following SQL statement?SELECT INITCAP(SUBSTR(CONCAT('Hello',world),4,3)) FROM DUAL; LLO Llo LOW Low

Low

Which statement discards all pending data changes COMMIT ROLLBACK SAVEPOINT DISCARD

SAVEPOINT

Which SQL statement is used to extract data from a database? OPEN SELECT GET EXTRACT

SELECT

With SQL, how do you select all the columns from a table named "Persons"? SELECT [all] FROM Persons SELECT Persons SELECT *.Persons SELECT * FROM Persons

SELECT * FROM Persons

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"? SELECT * FROM Persons ORDER FirstName DESC SELECT * FROM Persons SORT OR 'FirstName' DESC SELECT * FROM Persons SORT BY 'FirstName' DESC SELECT * FROM Persons ORDER BY FirstName DESC

SELECT * FROM Persons ORDER BY FirstName DESC

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"? SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter' SELECT * FROM Persons WHERE FirstName='Peter' SELECT [all] FROM Persons WHERE FirstName='Peter' SELECT * FROM Persons WHERE FirstName<>'Peter'

SELECT * FROM Persons WHERE FirstName='Peter'

With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"? SELECT FirstName='Peter', LastName='Jackson' FROM Persons SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson' SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson' SELECT * FROM Persons WHERE FirstName='Peter' OR LastName='Jackson'

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

With SQL, how can you return the number of records in the "Persons" table? SELECT NO(*) FROM Persons SELECT COUNT(*) FROM Persons SELECT COLUMNS(*) FROM Persons SELECT LEN(*) FROM Persons

SELECT COUNT(*) FROM Persons

Consider the EMPLOYEES table. Which of the following SQL statements is correct to provide the sentence in the format "King has been working since 01.01.1987" with "Employee Information" alias? SELECT last_name ||'has been working since' || hire_date "Employee Information" FROM employees; SELECT last_name || 'has been working since' || hire_date 'Employee Information' FROM employees; SELECT last_name || 'has been working since' || hire_date Employee Information FROM employees SELECT last_name || "has been working since" || hire_date "Employee Information" FROM employees;

SELECT last_name ||'has been working since' || hire_date "Employee Information" FROM employees;

What does SQL stand for? Structured Question Language Strong Question Language Structured Query Language Slow Query Language

Structured Query Language

The result of a SQL SELECT statement is a(n) ________ . Form Table File Report

Table

Which of the following statements about aliases is NOT true? The keyboard AS between an alias and a column name is optional Aliases rename column heading Aliases immediately follows the column name Aliases always require double quotation marks

The keyboard AS between an alias and a column name is optional

A parent table referenced by a child table may not be dropped. True False

True

By default, the foreign key restricts deletes of any parent row has a corresponding child row(s). True False

True

Privileges, roles, and synonyms are all used to implement security in an Oracle Database. True False

True

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true True False

True

You can add and drop columns from a table using the ALTER TABLE command. True False

True

Which of the following clauses is used to limit the rows that are retrieved by the query? GROUP BY WHERE FROM ORDER BY

WHERE

Consider the EMPLOYEES table. Which condition in the WHERE clause limit the employees to those who work in the department prompted by the user? WHERE department_id like '_Department' WHERE department_id = '%Department' WHERE department_id = '&Department' WHERE department_id LIKE '%Department'

WHERE department_id = '&Department'

Consider the EMPLOYEES table. Which condition in the WHERE clause limit the employees to those whose salary is greater than 5000 but less than 18000? WHERE salary > 5000 AND salary < 18000 WHERE salary > 5000 OR salary < 18000 WHERE salary < 5000 AND salary > 18000 WHERE salary >5000 AND salary > 18000

WHERE salary > 5000 AND salary < 18000

Which operator is used to search for a specified pattern in a column? get from set like

like


Related study sets

UNIT CIRCLE, radians, coordinates

View Set

Biology 1b: Energy Conversions in Cells

View Set

Econ Test 4 (17, 18, 19, 20, 21)

View Set

Praxis (5511) Practice: English Language Arts

View Set