单选题Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()ASORT BY age ASC, last_nameBSORT BY age DESC, last_nameCORDER BY age DESC, last_nameDORDER BY age ASC, last_name

单选题
Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age > 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()
A

SORT BY age ASC, last_name

B

SORT BY age DESC, last_name

C

ORDER BY age DESC, last_name

D

ORDER BY age ASC, last_name


参考解析

解析: 暂无解析

相关考题:

检索所有比"王华"年龄大的学生姓名、年龄和性别。正确的SELECT语句是() A、SELECT SN,AGE,SEX FROM SSHERE AGE>(SELECT AGE FROM S)WHERE SN=’王华’)B、SELECT SN,AGE,SEXFROM SWHERE SN=’王华’C、SELECT SN,ACE,SEX FROM SWHERE AGE>(SELECT ACEWHERE SN=’王华’)D、SELECT SN,ACE,SEX FROM SWHERE ACE>王华AGE

根据SQL标准,下面哪条语句与select min(age) from student等效?()A select age from student where age >= min(age)B select distinct age from student where age >= all min(age)C select distinct a.age from student a where a.ageD select distinct a.age from student a where a.age

Examine the structure of the EMPLOYEES table:Column name Data type RemarksEMPLOYEE_ID NUMBER NOT NULL, Primary KeyLAST_NAME VARCNAR2(30)FIRST_NAME VARCNAR2(30)JOB_ID NUMBERSAL NUMBERMGR_ID NUMBER References EMPLOYEE_ID column DEPARTMENT_ID NUMBERYou need to create an index called NAME_IDX on the first name and last name fields of the EMPLOYEES table. Which SQL statement would you use to perform this task? ()A. CREATE INDEX NAME _IDX (first_name, last_name);B. CREATE INDEX NAME _IDX (first_name, AND last_name)C. CREATE INDEX NAME_IDX ON (First_name, last_name);D. CREATE INDEX NAME_IDX ON employees (First_name, AND last_name);E. CREATE INDEX NAME_IDX ON employees (First_name, last_name);F. CREATE INDEX NAME_IDX FOR employees (First_name, last_name);

Review the definition of the phone_list view.CHEATE OR REPLACE ALGORITHM=MERGE DEFINER= ‘root‘@localhost‘ SQL SECURITY DEFINER VIEW ‘phone_list‘ AS SELECTe . id as id ‘e . first_name AS ‘first_name‘ ‘e . last_name AS ‘last_name‘ ‘coalesce ( ph1.phone_no, ‘ – ‘) AS ‘office_no‘ ‘coalesce (ph2 .phone_no, ‘ – ‘) AS ‘cell_no‘ FROM employees e LEFT JOIN employee_phone ph1 ON ph1.emp_id = e.id AND ph1.type = ‘office‘ LEFT JOIN employee_phone ph2 ON ph2 .emp_id = e.id AND ph2 .type = ‘mobile‘The tables employees and employee_phone are InnoDB tables;all columns are used in this view. The contents of the phone_list view are as follows: Mysql select * from phone_list; 1 row in set (0.00 sec)Which method can you use to change the cell_no value to ‘555-8888‘ for John Doe?()A.INSERT INTO employee_phone (emp_id, phone_no, type) VALUES (1, ‘555-8888‘,‘mobile‘)B.UPDATE phone_list SET cell_name ‘555-8888‘ WHERE first_name= ‘John‘ and last_name= ‘Doe‘C.DELETE FROM phone_list WHERE first_name= ‘John‘ and last_name= ‘Doe‘; INSERT INTO phone_list (first_name, last_name, office_no, cell_no) VALUES (‘John‘ , ‘Doe‘ , ‘x1234‘ , ‘555-8888)D.UPDATE employee_phone SET phone_no= ‘555-8888‘ where emp_id=1

在SQL Server 2000中,现要在employees表的first_name和last_name列上建立一个唯一的非聚集复合索引,其中first_name列数据的重复率是5%,last_name列数据的重复率是10%。请补全下列语句使以first_name和last_name列作为条件的查询效率最高。CREATE UNIQUE NONCLUSTERED INDEX Idx_NameON employees(______)

检索所有比“王华”年龄大的学生姓名、年龄和性别。正确的SELECT语句是______。A.SELECT SN,AGE,SEX FROM S WHERE AGE>(SELECT AGE FROM S WHERE SN='王华')B.SELECT SN,AGE,SEX FROM S WHERE SN='王华'C.SELECT SN,AGE, SEX FROM S WHERE AGE>(SELECT AGE WHERE SN='王华')D.SELECT SN,AGE,SEX FROM S WHERE AGE>王华 AGE

FACULTY表包含以下各列: FACULTYID VARCHAR2(5) NOT NULL PRIMARY KEY FIRST_NAME VARCHAR2(20) LAST_NAME VARCHAR2(20) ADDRESS VARCHAR2(35) CITY VARCHAR2(15) STATE VARCHAR2(2) ZIP NUMBER(9) TELEPHONE NUMBER(10) STATUS VARCHAR2(2) NOT NULL COURSE 表包含以下各列: COURSEID VARCHAR2(5) NOT NULL PRIMARY KEY SUBJECT VARCHAR2(5) TERM VARCHAR2(6 FACULTYID VARCHAR2(5) NOT NULL FOREIGN KEY 您需要制定一个报表,用于确定在下学期任教的所有副教授。您要创建一个视图来简化报表的创建过程。以下哪条CREATE VIEW语句将完成此任务()A、CREATE VIEW(SELECT first_name,last_name,status,courseid,subject,term FROM faculty,course WHERE facultyid=facultyid)B、CREATE VIEW pt_view ON(SELEC Tfirst_name,last_name,status,courseid,subject,term FROM faculty f and coursec WHERE f.facultyid=c.facultyid)C、CREATE VIEW pt_view IN(SELECT first_name,last_name,status,courseid,subject,term FROM faculty course)D、CREATE VIEW pt_view AS(SELECT first_name,last_name,status,courseid,subject,term FROM facultyf,coursec WHERE f.facultyid=c.facultyid)

您要对EMPLOYEES表的FIRST_NAME和LAST_NAME列创建一个组合索引。以下哪条语句将完成此任务()A、CREATE INDEXfl_idx ON employees(first_name last_name)B、CREATE INDEXfl_idx ON employees(first_name),employees(last_name)C、CREATE INDEXfl_idx ON employees(first_name,last_name)D、CREATE INDEXfl_idx ON employees(first_name);CREATE INDEXfl_idx ON employees(last_name)

Examine the data in the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20 1500 Bill 20 2200 Davis 30 5000 Kochhar 5000 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Sales 20 Marketing 30 Accounts 40 Administration You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()A、SELECT last_name, department_name FROM employees , departments(+);B、SELECT last_name, department_name FROM employees JOIN departments(+);C、SELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments dD、SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E、SELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);F、SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e. department _ id = d. department _id);

You need to display the last names of those employees who have the letter "A" as the second character in their names.Which SQL statement displays the required results?()A、SELECT last_name FROM EMP WHERE last_ name LIKE '_A%';B、SELECT last_name FROM EMP WHERE last name ='*A%'C、SELECT last_name FROM EMP WHERE last name ='_A%';D、SELECT last_name FROM EMP WHERE last name LIKE '*A%'

评估此CREATE VIEW 语句: CREATE VIEW pt_view AS (SELECT first_name, last_name, status, courseid, subject, term FROM faculty f, course c WHERE f.facultyid = c.facultyid); 此语句将创建什么类型的视图()A、嵌套B、简单C、内嵌D、复杂

Click the Exhibit button and examine the data in the EMPLOYEES and DEPARTMENTS tables.You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()A、SELECT last_name, department_name FROM employees NATURAL JOIN departments;B、SELECT last_name, department_name FROM employees JOIN departments ;C、SELECT last_name, department_name FROM employees e JOIN departments d ON (e.department_id = d.department_id);D、SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E、SELECT last_name, department_name FROM employees FULL JOIN departments ON (e.department_id = d.department_id);F、SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id);

Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) Which statement produces the number of different departments that have employees with last name Smith?()A、SELECT COUNT(*) FROM employees WHERE last_name='Smith';B、SELECT COUNT(dept_id) FROM employees WHERE last_name='Smith';C、SELECT DISTINCT(COUNT(dept_id)) FROM employees WHERE last_name='Smith';D、SELECT COUNT(DISTINCT dept_id) FROM employees WHERE last_name='Smith';E、SELECT UNIQUE(dept_id) FROM employees WHERE last_name='Smith';

Evaluate the following query: SQL SELECT TRUNC(ROUND(156.00,-1),-1)FROM DUAL; What would be the outcome?()A、16 B、100 C、160 D、200 E、150

You need to display the last names of those employees who have the letter “A” as the second character in their names.Which SQL statement displays the required results?()A、SELECT last_name FROM EMP WHERE last_name LIKE ‘_A%’;B、SELECT last_name FROM EMP WHERE last name =’*A%’C、SELECT last_name FROM EMP WHERE last name =’_A%’;D、SELECT last_name FROM EMP WHERE last name LIKE ‘*A%’

Which SQL statement accepts user input for the columns to be displayed, the table name, and the WHERE condition?()A、SELECT 1, "2" FROM 3 WHERE last_name = '4';B、SELECT 1, '2' FROM 3 WHERE 'last_name = '4'';C、SELECT 1, 2 FROM 3 WHERE last_name = '4';D、SELECT 1, '2' FROM EMP WHERE last_name = '4';

多选题Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements insert a row into the table? ()AINSERT INTO employees VALUES (NULL, 'John', 'smith');BINSERT INTO employees (first_name, last_name) VALUES ('John', 'smith');CINSERT INTO employees VALUES ('1000, 'John', 'smith');DINSERT INTO employees (first_name, last_name, employee_id) VALUES (1000, 'John', 'smith');EINSERT INTO employees (employee_id) VALUES (1000);FINSERT INTO employees ( employee_id, first_name, last_name, ) VALUES (1000, 'John','');

多选题Which three statements inserts a row into the table?()AINSERT INTO employees VALUES ( NULL, ‘John’,‘Smith’);BINSERT INTO employees( first_name, last_name) VALUES(‘John’,‘Smith’);CINSERT INTO employees VALUES (‘1000’,‘John’,NULL);DINSERT INTO employees(first_name,last_name, employee_id) VALUES ( 1000, ‘John’,‘Smith’);EINSERT INTO employees (employee_id) VALUES (1000);FINSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, ‘John’,‘’);

单选题Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE Which UPDATE statement is valid? ()AUPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;BUPDATE employees SET first_name = 'John', SET last_name = 'Smoth' WHERE employee_id = 180;CUPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;DUPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180;

单选题Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()ASORT BY age ASC, last_nameBSORT BY age DESC, last_nameCORDER BY age DESC, last_nameDORDER BY age ASC, last_name

单选题Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE Which UPDATE statement is valid?()AUPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;BUPDATE employees SET first_name = 'John', SET last_name = 'Smoth' WHERE employee_id = 180;CUPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;DUPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180;

多选题Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements inserts a row into the table? ()AINSERT INTO employees VALUES (NULL, 'JOHN','Smith');BINSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');CINSERT INTO employees VALUES ('1000','JOHN','NULL');DINSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');EINSERT INTO employees (employee_id) VALUES (1000);FINSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'john',);

单选题评估此CREATE VIEW 语句: CREATE VIEW pt_view AS (SELECT first_name, last_name, status, courseid, subject, term FROM faculty f, course c WHERE f.facultyid = c.facultyid); 此语句将创建什么类型的视图()A嵌套B简单C内嵌D复杂

单选题Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE Which INSERT statement is valid? ()AINSERT INTO employees (employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01/01/01);BINSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01 january 01');CINSERT INTO employees(employee_id, first_name, last_name, Hire_date) VALUES (1000, 'John', 'smith', To_ date ('01/01/01));DINSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01-Jan-01');

单选题A user named Arren is executing this query:   select table_name,operation,undo_sql  from  flashback_transaction_query t,  (select versions_xid as xid  from employees versions between scn minvalue and maxvalue  where employee_id = 123) e  where t.xid = e.xid;   When the query runs,he receives an ORA-01031: insufficient privileges error. Since the user owns the employees table,you know that it is not the problem.  Which of the following SQL statements will correct this problem?()A GRANT SELECT ANY TRANSACTION TO ARRENB GRANT SELECT ON FLASHBACK_TRANSACTION_QUERY TO ARRENC GRANT SELECT_ANY_TRANSACTION TO ARREND GRANT FLASHBACK TO ARRENE GRANT SELECT ANY VIEW TO ARREN

单选题Examine the structure of the EMPLOYEES table: Column name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key LAST_NAME VARCNAR2(30) FIRST_NAME VARCNAR2(30) JOB_ID NUMBER SAL NUMBER MGR_ID NUMBER References EMPLOYEE_ID column DEPARTMENT_ID NUMBER You need to create an index called NAME_IDX on the first name and last name fields of the EMPLOYEES table. Which SQL statement would you use to perform this task?()ACREATE INDEX NAME _IDX (first_name, last_name);BCREATE INDEX NAME _IDX (first_name, AND last_name)CCREATE INDEX NAME_IDX ON (First_name, last_name);DCREATE INDEX NAME_IDX ON employees (First_name, AND last_name);ECREATE INDEX NAME_IDX ON employees (First_name, last_name);FCREATE INDEX NAME_IDX FOR employees (First_name, last_name);

单选题Exhibit: Examine the data in the EMPLOYEES table. Examine the subquery: SELECT last_name FROM employees WHERE salary IN (SELECT MAX(salary) FROM employees GROUP BY department_id); Which statement is true?()A The SELECT statement is syntactically accurate.B The SELECT statement does not work because there is no HAVING clause.C The SELECT statement does not work because the column specified in the GROUP BY clause is not in the SELECT list.D The SELECT statement does not work because the GROUP BY clause should be in the main query and not in the subquery.

单选题Review the definition of the phone_list view. CHEATE OR REPLACE ALGORITHM=MERGE DEFINER= 'root'@localhost' SQL SECURITY DEFINER VIEW 'phone_list' AS SELECT e . id as id 'e . first_name AS 'first_name' 'e . last_name AS 'last_name' 'coalesce ( ph1.phone_no, ' – ') AS 'office_no' 'coalesce (ph2 .phone_no, ' – ') AS 'cell_no' FROM employees e LEFT JOIN employee_phone ph1 ON ph1.emp_id = e.id AND ph1.type = 'office' LEFT JOIN employee_phone ph2 ON ph2 .emp_id = e.id AND ph2 .type = 'mobile' The tables employees and employee_phone are InnoDB tables; all columns are used in this view. The contents of the phone_list view are as follows: Mysql select * from phone_list; 1 row in set (0.00 sec) Which method can you use to change the cell_no value to '555-8888' for John Doe?()AINSERT INTO employee_phone (emp_id, phone_no, type) VALUES (1, '555-8888','mobile')BUPDATE phone_list SET cell_name '555-8888' WHERE first_name= 'John' and last_name= 'Doe'CDELETE FROM phone_list WHERE first_name= 'John' and last_name= 'Doe'; INSERT INTO phone_list (first_name, last_name, office_no, cell_no) VALUES ('John' , 'Doe' , 'x1234' , '555-8888)DUPDATE employee_phone SET phone_no= '555-8888' where emp_id=1