Bd

The function COUNT is a single row function. True or False?
True
False
The PLAYERS table contains these columns: PLAYERS TABLE: LAST_NAME VARCHAR2 (20) FIRST_NAME VARCHAR2 (20) SALARY NUMBER(8,2) TEAM_ID NUMBER(4) MANAGER_ID NUMBER(9) POSITION_ID NUMBER(4) You want to display all players' names with position 6900 or greater. You want the players names to be displayed alphabetically by last name and then by first name. Which statement should you use to achieve the required results?
SELECT last_name, first_name FROM players WHERE position_id > 6900 ORDER BY last_name, first_name;
SELECT last_name, first_name FROM players WHERE position_id >= 6900 ORDER BY last_name DESC, first_name;
SELECT last_name, first_name FROM players WHERE position_id >= 6900 ORDER BY last_name, first_name;
SELECT last_name, first_name FROM players WHERE position_id <= 6900 ORDER BY last_name, first_name;
The EMPLOYEES table contains these columns: EMPLOYEE_ID NUMBER(9) PK LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) DEPARTMENT_ID NUMBER(9) Compare these two SQL statements: 1. SELECT DISTINCT department_id DEPT, last_name, first_name FROM employees ORDER BY department_id; 2. SELECT department_id DEPT, last_name, first_name FROM employees ORDER BY DEPT; How will the results differ?
One of the statements will return a syntax error.
There is no difference in the result between the two statements.
One of the statements will eliminate all duplicate DEPARTMENT_ID values.
The statements will sort on different column values.
The following statement represents a multi-row function. True or False? SELECT MAX(salary) FROM employees
True
False
The PLAYERS table contains these columns: PLAYERS TABLE: LAST_NAME VARCHAR2 (20) FIRST_NAME VARCHAR2 (20) SALARY NUMBER(8,2) TEAM_ID NUMBER(4) MANAGER_ID NUMBER(9) POSITION_ID NUMBER(4) You must display the player name, team id, and salary for players whose salary is in the range from 25000 through 100000 and whose team id is in the range of 1200 through 1500. The results must be sorted by team id from lowest to highest and then further sorted by salary from highest to lowest. Which statement should you use to display the desired result?
SELECT last_name, first_name, team_id, salary FROM players WHERE salary BETWEEN 25000 AND 100000 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id, salary DESC;
SELECT last_name, first_name, team_id, salary FROM players WHERE (salary > 25000 OR salary < 100000) AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id, salary;
SELECT last_name, first_name, team_id, salary FROM players WHERE salary > 24999.99 AND salary < 100000 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id ASC, salary DESC;
SELECT last_name, first_name, team_id, salary FROM players WHERE salary BETWEEN 24999.99 AND 100000.01 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id DESC, salary DESC;
Which statement about the ORDER BY clause is true?
The ORDER BY clause can only contain columns that are included in the SELECT list.
You can use a column alias in the ORDER BY clause.
The default sort order of the ORDER BY clause is descending.
The ORDER BY clause should immediately precede the FROM clause in a SELECT statement
Which of the following best describes the meaning of the LIKE operator?
To find Null values.
Match a character pattern.
Display rows based on a range of values.
To test for values in a list.
Which of the following are TRUE regarding the logical AND operator?
TRUE AND FALSE return FALSE
TRUE AND TRUE return FALSE
TRUE AND FALSE return TRUE
FALSE AND TRUE return NULL
Which statement about the default sort order is true?
Character values are displayed in reverse alphabetical order.
The lowest numeric values are displayed last.
The earliest date values are displayed first.
Null values are displayed first.
What will be the results of the following selection? SELECT * FROM employees WHERE last_name NOT LIKE 'A%' AND last_name NOT LIKE 'B%'
All last names that begin with A or B
All last names that do not begin with A or B
No rows will be returned. There is a syntax error
All rows will be returned
Evaluate this SELECT statement: SELECT employee_id, last_name, first_name, salary 'Yearly Salary' FROM employees WHERE salary IS NOT NULL ORDER BY last_name, 3; Which clause contains an error?
FROM employees
SELECT employee_id, last_name, first_name, salary 'Yearly Salary'
WHERE salary IS NOT NULL
ORDER BY last_name, 3;
Which of the following is true of the ORDER BY clause:? (Choose Two)
Defaults to an ascending order (ASC)
Must be the last clause of the SQL statement
Defaults to a descending order (DESC)
Displays the fetched rows in no particular order
A column alias can be specified in an ORDER BY Clause. True or False?
True
False
Evaluate this SELECT statement: SELECT last_name, first_name, email FROM employees ORDER BY email; If the EMAIL column contains null values, which statement is true?
Null email values will be displayed last in the result.
The result will not be sorted.
Null email values will not be displayed in the result.
Null email values will be displayed first in the result.
You attempt to query the database with this SQL statement: SELECT product_id "Product Number", category_id "Category", price "Price" FROM products WHERE "Category" = 5570 ORDER BY "Product Number"; This statement fails when executed. Which clause contains a syntax error?
WHERE "Category" = 5570
ORDER BY "Product Number";
FROM products
SELECT product_id "Product Number", category_id "Category", price "price"
Which number function may be used to determine if a value is odd or even?
TRUNC
MOD
ROUND
BINARY
What is the result of the following SQL Statement: SELECT ROUND(45.923,-1) FROM DUAL;
46
45.9
50
None of the above
Which two functions can be used to manipulate number or date column values, but NOT character column values? (Choose two.)
CONCAT
INSTR
ROUND
RPAD
TRUNC
Evaluate this function: MOD (25, 2) Which value is returned?
0
25
1
2
Which script displays '01-May-2004' when the HIRE_DATE value is '20-May-2004'?
SELECT ROUND(hire_date, 'MON') FROM employees;
SELECT ROUND(hire_date, 'MONTH') FROM employees;
SELECT TRUNC(hire_date, 'MI') FROM employees;
SELECT TRUNC(hire_date, 'MONTH') FROM employees;
You need to display the current year as a character value (for example: Two Thousand and One). Which element would you use?
YY
YYYY
RR
YEAR
What is the result of the following query? SELECT ADD_YEARS ('11-Jan-1994',6) FROM dual;
11-Jul-1995
11-Jan-2000
This in not a valid SQL statement.
11-Jul-2000
You need to display the number of months between today's date and each employee's hiredate. Which function should you use?
ROUND
ADD_MONTHS
BETWEEN
MONTHS_BETWEEN
Which query would return a whole number if the sysdate is 26-May-2004?
SELECT TRUNC(MONTHS_BETWEEN(SYSDATE,'19-Mar-1979') /12) AS YEARS FROM DUAL;
SELECT TRUNC(YEARS_BETWEEN(SYSDATE,'19-Mar-1979') /12) AS YEARS FROM DUAL;
SELECT MONTHS_BETWEEN(SYSDATE,'19-Mar-1979') /12 AS YEARS FROM DUAL;
None of the above
Which SELECT statement will NOT return a date value?
SELECT (hire_date - SYSDATE) + TO_DATE('25-Jun-2002') FROM employees;
SELECT (30 + hire_date) + 1440/24 FROM employees;
SELECT SYSDATE - TO_DATE('25-Jun-2002') + hire_date FROM employees;
SELECT (SYSDATE - hire_date) + 10*8 FROM employees;
You need to display each employee's name in all uppercase letters. Which function should you use?
CASE
TOUPPER
UCASE
UPPER
The STYLES table contains this data: STYLE_ID STYLE_NAME CATEGORY COST 895840 SANDAL 85940 12.00 968950 SANDAL 85909 10.00 869506 SANDAL 89690 15.00 809090 LOAFER 89098 10.00 890890 LOAFER 89789 14.00 857689 HEEL 85940 11.00 758960 SANDAL 86979 12.00 You query the database and return the value 79. Which script did you use?
SELECT SUBSTR(category, -2,2) FROM styles WHERE style_id = 758960;
SELECT SUBSTR(category, 2,2) FROM styles WHERE style_id = 895840;
SELECT INSTR(category, 2,2) FROM styles WHERE style_id = 895840;
SELECT INSTR(category, -2,2) FROM styles WHERE style_id = 895840;
What does the following SQL SELECT statement return? SELECT UPPER( SUBSTR('Database Programming', INSTR('Database Programming','P'),20)) FROM dual;
Programming
Database
PROGRAMMING
DATABASE
You issue this SQL statement: SELECT INSTR ('organizational sales', 'al') FROM dual; Which value is returned by this command?
1
2
17
13
Which of the following are types of SQL functions? (Choose two correct answers.)
Column-Row Functions
Multi-Row Functions
Single-Row Functions
Many-to-Many Functions
{"name":"Bd", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"The function COUNT is a single row function. True or False?, The PLAYERS table contains these columns: PLAYERS TABLE: LAST_NAME VARCHAR2 (20) FIRST_NAME VARCHAR2 (20) SALARY NUMBER(8,2) TEAM_ID NUMBER(4) MANAGER_ID NUMBER(9) POSITION_ID NUMBER(4) You want to display all players' names with position 6900 or greater. You want the players names to be displayed alphabetically by last name and then by first name. Which statement should you use to achieve the required results?, The EMPLOYEES table contains these columns: EMPLOYEE_ID NUMBER(9) PK LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) DEPARTMENT_ID NUMBER(9) Compare these two SQL statements: 1. SELECT DISTINCT department_id DEPT, last_name, first_name FROM employees ORDER BY department_id; 2. SELECT department_id DEPT, last_name, first_name FROM employees ORDER BY DEPT; How will the results differ?","img":"https://cdn.poll-maker.com/30-1066505/acrord32-2018-06-27-19-35-08.png?sz=1200-00282000000787205300"}
Powered by: Quiz Maker