Theory of database (Meirzhan)

Descripción

Exam Test sobre Theory of database (Meirzhan), creado por Alex Q el 26/03/2019.
Alex Q
Test por Alex Q, actualizado hace más de 1 año
Alex Q
Creado por Alex Q hace alrededor de 5 años
124
5

Resumen del Recurso

Pregunta 1

Pregunta
A DISTINCT must always be user in the top-most SELECT statement of a set operation
Respuesta
  • True
  • False

Pregunta 2

Pregunta
A parent table referenced by a child table may not be dropped
Respuesta
  • True
  • False

Pregunta 3

Pregunta
A SELECT statement that is embedded in a clause of another SELECT statement is called
Respuesta
  • Main query
  • Subquery
  • Inner query
  • Outer query

Pregunta 4

Pregunta
A subquery must be enclosed in _________ .
Respuesta
  • Double quotes
  • Single quotes
  • Parantheses
  • Braces

Pregunta 5

Pregunta
A table can be created with or without data
Respuesta
  • True
  • False

Pregunta 6

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

Pregunta 7

Pregunta
Both object and system privileges can be granted through a single role to a user.
Respuesta
  • True
  • False

Pregunta 8

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

Pregunta 9

Pregunta
Comparison conditions fall into two classes:
Respuesta
  • Single-column operators (>, \=, >\=, <, <>,<\=) and multiple-column operators (IN, ANT, ALL)
  • Single-row operators (>, \=, >\=, <, <>,<\=) and multiple-column operators (IN,ANY,ALL)
  • Single-row operators (>, \=, >\=, <, <>,<\=) and multiple-row operators (IN,ANY,ALL)
  • Multiple-row operators (>, \=, >\=, <, <>,<\=) and single-row operators (IN,ANY,ALL)

Pregunta 10

Pregunta
Consider the EMPLOYEES table. When condition in the WHERE clause limit the employees to IT Programmers with salary greater than 5000?
Respuesta
  • WHERE salary>5000 AND job_id \= 'IT_PROG'
  • WHERE salary>5000 AND job_id \= "IT_PROG"
  • WHERE salary>5000 AND job_id \= IT_PROG
  • WHERE salary>5000 OR job_id \= 'IT_PROG'

Pregunta 11

Pregunta
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?
Respuesta
  • WHERE salary > 5000 OR salary < 18000
  • WHERE salary < 5000 AND salary > 18000
  • WHERE salary > 5000 AND salary < 18000
  • WHERE salary >5000 AND salary > 18000

Pregunta 12

Pregunta
Consider the EMPLOYEES table. Which condition in the WHERE clause limit the employees to those whose last name and first name starts with the letter 'K'?
Respuesta
  • WHERE last_name \= 'K%' and first_name \= 'K%'
  • WHERE last_name LIKE 'K_' and first_name LIKE 'K_'
  • WHERE last_name LIKE 'K%' and first_name LIKE 'K%'
  • WHERE last_name and first_name \= 'K%'

Pregunta 13

Pregunta
Consider the EMPLOYEES table. Which condition in the WHERE clause limit the employees to those who do not work in the departments 90 and 60?
Respuesta
  • WHERE department_id \= 90 AND department_id \= 60
  • WHERE department_id IN (90,60)
  • WHERE department_id NOT IN (90,60)
  • WHERE department_id \=90 PR department_id \= 60

Pregunta 14

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

Pregunta 15

Pregunta
Consider the EMPLOYEES table. Which of the following statements displays the date in the 'January, 19 1998'?
Respuesta
  • SELECT TO_DATE(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
  • SELECT TO_DATE(hire_date,'fmMonth, DD YYYY') FROM employees

Pregunta 16

Pregunta
Consider the EMPLOYEES table. Which of the following conditions in the WHERE clause will generate an error?
Respuesta
  • SELECT * FROM employees WHERE last_name\='&amp;Name'
  • SELECT job_id, SUM(salary) FROM employees GROUP BY '&amp;Column'
  • SELECT * FROM &amp;Table
  • SELECT &amp;Column FROM employees

Pregunta 17

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

Pregunta 18

Pregunta
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?
Respuesta
  • 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;

Pregunta 19

Pregunta
Consider the EMPLOYEES table. Which of the following statements count the number of employees within each department?
Respuesta
  • SELECT department_id, COUNT(last_name) FROM employees GROUP BY department_id
  • SELECT department_name, COUNT(last_name) FROM employees GROUP BY department_id
  • SELECT department_id, COUNT(last_name) FROM departments GROUP_BY last_name
  • SELECT department_id, department_name, COUNT(last_name) FROM employees GROUP BY department_id

Pregunta 20

Pregunta
Consider the following SQL statement. What will be the result? SELECT e.last_name, e.salary, d.department_name FROM employees e, departments d WHERE e.department_id \= d.department_id
Respuesta
  • An error will occur since none of the JOIN operations is used
  • An error will occur since in the SELECT clause a column thet is used to join the tables is missing
  • The last names of the employees and their salaries will be displayed along with the departments names where the employees work
  • The Cartesian product of the two tables based on the department_id column will be displayed

Pregunta 21

Pregunta
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
Respuesta
  • ORDER BY salary;
  • ORDER BY 2;
  • ORDER BY "Salary" ASC;
  • ORDER BY Salary DESC;

Pregunta 22

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

Pregunta 23

Pregunta
Delete the zip codes 02199 and 43011 from the ZIPCODE table. Make the change permanent.
Respuesta
  • DELETE FROM zipcode WHERE zip ANY ('02199','43011') COMMIT
  • DELETE FROM zipcode WHERE zip ANY ('02199','43011')
  • DELETE FROM zipcode WHERE zip IN ('02199','43011') COMMIT
  • DELETE FROM zipcode WHERE zip ALL ('02199','43011') COMMIT

Pregunta 24

Pregunta
Constraints always have a name.
Respuesta
  • True
  • False

Pregunta 25

Pregunta
DML statement such as INSERT, UPDATE, DELETE, and MERGE obtain a lock on the row(s), so other users cannot manipulate it.
Respuesta
  • True
  • False

Pregunta 26

Pregunta
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:
Respuesta
  • SELECT * FROM userb.employees;
  • SELECT * FROM employees;
  • SELECT * FROM usera.employees;
  • SELECT * FROM employees.userb;

Pregunta 27

Pregunta
It is possible to combine from two tables that do not have a primary key/foreign key relationship into one result using a set operation.
Respuesta
  • True
  • False

Pregunta 28

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

Pregunta 29

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

Pregunta 30

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

Pregunta 31

Pregunta
Queries that return only one row from the inner SELECT statement are called
Respuesta
  • Multiple-column subqueries
  • Single-row subqueries
  • Single-column subqueries
  • Multiple-row subqueries

Pregunta 32

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

Pregunta 33

Pregunta
What will be the result of the following SQL statement? SELECT count(d.department_name), l.city FROM departments d NATURAL JOIN locations l GROUP BY l.city
Respuesta
  • The number of department in all cities is shown
  • The number of departments in EACH city is shown.
  • An error will occur since the GROUP BY clause cannot be used with NATURAL JOIN
  • The number if departments in one particular city is shown

Pregunta 34

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

Pregunta 35

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

Pregunta 36

Pregunta
The ______ operator compares a value to every value returned by a subquery.
Respuesta
  • NOT
  • ALL
  • SOME
  • ANY

Pregunta 37

Pregunta
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.
Respuesta
  • True
  • False

Pregunta 38

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

Pregunta 39

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

Pregunta 40

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

Pregunta 41

Pregunta
The subquery generally executes ______ , and its output is used to complete the query condition for the main (or ____ ) query.{
Respuesta
  • First, outer
  • Last, outer
  • Last, inner
  • First, inner

Pregunta 42

Pregunta
The TRANCATE command and the TRUNC function can be used interchangeably.
Respuesta
  • True
  • False

Pregunta 43

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

Pregunta 44

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

Pregunta 45

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

Pregunta 46

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

Pregunta 47

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

Pregunta 48

Pregunta
To obtain a list of last names that students and instructors share, you use the MINUS set operator
Respuesta
  • True
  • False

Pregunta 49

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

Pregunta 50

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

Pregunta 51

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

Pregunta 52

Pregunta
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;{
Respuesta
  • 31.May.2013
  • An error will occur
  • 31.05.2013
  • 31.05.13

Pregunta 53

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

Pregunta 54

Pregunta
When inserting data into a table form another table, the table names and columns must be the same.
Respuesta
  • True
  • False

Pregunta 55

Pregunta
When using LIKE condition which symbol is used to denote one character?
Respuesta
  • _
  • +
  • %
  • *

Pregunta 56

Pregunta
When using LIKE conditions which symbol is used to denote zero or many characters?
Respuesta
  • +
  • *
  • %
  • _

Pregunta 57

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

Pregunta 58

Pregunta
Which is right of the following clauses?
Respuesta
  • SELECT... WHERE ... ORDER BY ... GROUP BY
  • SELECT ... FROM ... GROUP BY ... ORDER BY ... WHERE
  • SELECT...FROM...WHERE...GROUP BY...ORDER BY
  • SELECT ... FROM ... WHERE ... ORDER BY ... GROUP BY

Pregunta 59

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

Pregunta 60

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

Pregunta 61

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

Pregunta 62

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

Pregunta 63

Pregunta
Which of the following functions is not single-row function?
Respuesta
  • CONCAT
  • SUM
  • UPPER
  • ROUND

Pregunta 64

Pregunta
Which of the following functions joins two strings together?
Respuesta
  • CONCAT
  • TRIM
  • INSTR
  • SUBSTR

Pregunta 65

Pregunta
Which of the following is a concatenation operator?
Respuesta
  • &amp;
  • ||
  • *
  • +

Pregunta 66

Pregunta
Which of the following SQL statements will generate an error?
Respuesta
  • SELECT last_name Name FROM employees WHERE Name like 'K%'
  • SELECT last_name Name FROM employees ORDER BY Name
  • SELECT department_id Dep, COUNT(last_name) Num FROM employees GROUP BY department_id HAVING Num>5
  • SELECT department_id Dep, COUNT(last_name) FROM employees GROUP BY dep

Pregunta 67

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

Pregunta 68

Pregunta
Which of the following statements is NOT true?
Respuesta
  • SQL statements are no case sensitive
  • Keywords cannot be abbreviated
  • SQL statement can be only one line
  • Keywords cannot be split across lines

Pregunta 69

Pregunta
Which statement discards all pending data changes
Respuesta
  • SAVEPOINT
  • COMMIT
  • DISCARD
  • ROLLBACK

Pregunta 70

Pregunta
Which symbol do you use if you need to choose all the columns from the table to the result query?
Respuesta
  • %
  • All
  • +
  • *

Pregunta 71

Pregunta
Which symbol is used to create a substitution variable?{
Respuesta
  • &amp;
  • _
  • %
  • *

Pregunta 72

Pregunta
Write SQL statement for display the department numbers with more than employees in each dept.
Respuesta
  • Select deptno, count(deptno) from emp group by deptno having count(*)>3;
  • Select deptno, count(deptno) from deptno group by emp having count(*)>3;
  • Select deptno, count (emp) from deptno group by emp having count(*)>2;
  • Select deptno, count (deptno) from emp group by deptno having count(*)>2;

Pregunta 73

Pregunta
Write SQL statement for display the names of the employees who are working in the company for the past 5 years:
Respuesta
  • Select ename from emp where hiredate < add_month(sysdate,-60);
  • Select ename from emp where hiredate < add_month(sysdate,-5);
  • Select ename from emp where hiredate < add_month(sysdate,+60);
  • Select ename from emp where hiredate < add_month(sysdate,+5);

Pregunta 74

Pregunta
Write SQL statement for increase salary of all managers by 10%
Respuesta
  • Update emp set sal\=sal*1.1 where empno in (select mgr from emo);
  • Update emp set sal\=sal*0.1 where empno in (select mgr from emo);
  • Update emp set sal\=sal*0.1 where empno in (select emp from emo);
  • Update emp set sal\=sal*1.1 where empno in (select emp from emo);

Pregunta 75

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

Pregunta 76

Pregunta
You can nor (not?) selectively delete rows a table.
Respuesta
  • True
  • False

Pregunta 77

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

Pregunta 78

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

Pregunta 79

Pregunta
You cannot drop a user if objects exist in the user's schema.
Respuesta
  • True
  • False

Pregunta 80

Pregunta
You cannot order the results of a set operation
Respuesta
  • True
  • False

Pregunta 81

Pregunta
______ clause can be used and is required in the subquery to perform Top-N analysis.
Respuesta
  • HAVING
  • ORDER BY
  • GROUP BY
  • WHERE
Mostrar resumen completo Ocultar resumen completo

Similar

The SAT Math test essentials list
lizcortland
How to improve your SAT math score
Brad Hegarty
State & Local Govt - Budgetary Accounting
turquoise_cat
RE Keywords - Paper 1 - Religion and life
Kerris Linney
Quick tips to improve your Exam Preparation
James Timpson
Command Words
Mr Mckinlay
LOGARITHMS
pelumi opabisi
Flashcards for CPXP exam
Lydia Elliott, Ed.D
TYPES OF DATA
Elliot O'Leary
CCNA Security 210-260 IINS - Exam 1
Mike M
History- Home Front WW1
jessmitchell