The EMPLOYEES table has these columns:LAST NAME VARCHAR2(35)SALARY NUMBER(8,2)HIRE_DATE DATEManagement wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement:ALTER TABLE EMPLOYEESMODIFY ( SALARY DEFAULT 5000);What is true about your ALTER statement?()A. Column definitions cannot be altered to add DEFAULT values.B. A change to the DEFAULT value affects only subsequent insertions to the table.C. Column definitions cannot be altered at add DEFAULT values for columns with a NUMBER data type.D. All the rows that have a NULL value for the SALARY column will be updated with the value 5000.

The EMPLOYEES table has these columns:LAST NAME VARCHAR2(35)SALARY NUMBER(8,2)HIRE_DATE DATEManagement wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement:ALTER TABLE EMPLOYEESMODIFY ( SALARY DEFAULT 5000);What is true about your ALTER statement?()

A. Column definitions cannot be altered to add DEFAULT values.

B. A change to the DEFAULT value affects only subsequent insertions to the table.

C. Column definitions cannot be altered at add DEFAULT values for columns with a NUMBER data type.

D. All the rows that have a NULL value for the SALARY column will be updated with the value 5000.


相关考题:

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2(25)LAST_NAME VARCHAR2(25)DEPARTMENT_ID NUMBERSALARY NUMBERWhat is the correct syntax for an inline view? ()A. SELECT a.last_name, a.salary, a.department_id, b.maxsal FROM employees a, (SELECT department_id, max(salary)maxsal FROM employees GROUP BY department_id) b WHERE a.department_id = b.department_id AND a.salary b.maxsal;B. SELECT a.last name, a.salary, a.department_id FROM employees a WHERE a.department_id IN (SELECT department_id FROM employees b GROUP BY department_id having salary = (SELECT max(salary) from employees))C. SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE a.salary = (SELECT max(salary) FROM employees b WHERE a.department _ id = b.department _ id);D. SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE (a.department_id, a.salary) IN (SELECT department_id, a.salary) IN (SELECT department_id max(salary) FROM employees b GROUP BY department_id ORDER BY department _ id);

The EMPLOYEE tables has these columns:LAST_NAME VARCHAR2(35)SALARY NUMBER(8,2)COMMISSION_PCT NUMBER(5,2)You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero must be displayed against the calculated column.Which SQL statement displays the desired results? ()A. SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES;B. SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0) FROM EMPLOYEES;C. SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES;D. SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES;

Management has asked you to calculate the value 12*salary* commission_pct for all the employees in the EMP table. The EMP table contains these columns:LAST NAME VARCNAR2(35) NOT NULLSALARY NUMBER(9,2) NOT NULLCOMMISION_PCT NUMBER(4,2)Which statement ensures that a value is displayed in the calculated columns for all employees? ()A. SELECT last_name, 12*salary* commission_pct FROM emp;B. SELECT last_name, 12*salary* (commission_pct,0) FROM emp;C. SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp;D. SELECT last_name, 12*salary*(decode(commission_pct,0)) FROM emp;

YouneedtogeneratealistofallcustomerlastnameswiththeircreditlimitsfromtheCUSTOMERStable.Thosecustomerswhodonothaveacreditlimitshouldappearlastinthelist.Whichtwoquerieswouldachievetherequiredresult?() A.SELECTcust_last_name,cust_credit_limitFROMcustomersORDERBYcust_credit_limitDESCB.SELECTcust_last_name,cust_credit_limitFROMcustomersORDERBYcust_credit_limitC.SELECTcust_last_name,cust_credit_limitFROMcustomersORDERBYcust_credit_limitNULLSLASTD.SELECTcust_last_name,cust_credit_limitFROMcustomersORDERBYcust_last_name,cust_credit_limitNULLSLAST

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:EMPLOYEESEMPLOYEE_ID NUMBERDEPARTMENT_ID NUMBERMANAGER_ID NUMBERLAST_NAME VARCHAR2(25)DEPARTMENTSDEPARTMENT_ID NUMBERMANAGER_ID NUMBERDEPARTMENT_NAME VARCHAR2(35)LOCATION_ID NUMBERYou want to create a report displaying employee last names, department names, and locations. Which query should you use to create an equi-join?()A. SELECT last_name, department_name, location_id FROM employees , department ;B. SELECT employees.last_name, departments.department_name, departments.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;C. SELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE manager_id = manager_id;D. SELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;

Examine the data in the EMPLOYEES and EMP_HIST tables:EMPLOYEESNAME DEPT_ID MGR_ID JOB_ID SALARYEMPLOYEE_ID101 Smith 20 120 SA_REP 4000102 Martin 10 105 CLERK 2500103 Chris 20 120 IT_ADMIN 4200104 John 30 108 HR_CLERK 2500105 Diana 30 108 IT_ADMIN 5000106 Smith 40 110 AD_ASST 3000108 Jennifer 30 110 HR_DIR 6500110 Bob 40 EX_DIR 8000120 Ravi 20 110 SA_DIR 6500EMP HISTEMPLOYEE_ID NAME JOB_ID SALARY101 Smith SA_CLERK 2000103 Chris IT_CLERK 2200104 John HR_CLERK 2000106 Smith AD_ASST 3000108 Jennifer HR_MGR 4500The EMP_HIST table is updated at the end of every year. The employee ID, name, job ID, and salary of each existing employee are modified with the latest data. New employee details are added to the table.Which statement accomplishes this task?()A. UPDATE emp_hist SET employee_id, name, job_id, salary = (SELECT employee_id, name, job_id, salary FROM employees) WHERE employee_id IN (SELECT employee_id FROM employees);B. MERGE INTO emp_hist eh USING employees e ON (eh.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT VALUES (e.employee id, e.name, job id, e.salary);C. MERGE INTO emp_hist eh USING employees e ON (eh.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE emp hist SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT INTO emp_hist VALUES (e.employees_id, e.name, e.job_id, e.salary);D. MERGE INTO emp_hist eh USING employees e WHEN MATCHED THEN UPDATE emp_hist SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT INTO emp_hist VALUES (e.employees_id, e.name, e.job_id, e.salary);

The EMPLOYEES table has these columns:LAST_NAME VARCHAR2(35) SALARYNUMBER(8,2) HIRE_DATE DATEManagement wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement:ALTER TABLE EMPLOYEES MODIFY (SALARY DEFAULT 5000);Which is true about your ALTER statement?()A.Column definitions cannot be altered to add DEFAULT values.B.A change to the DEFAULT value affects only subsequent insertions to the table.C.Column definitions cannot be altered to add DEFAULT values for columns with a NUMBER data type.D.All the rows that have a NULL value for the SALARY column will be updated with the value 5000.

在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(______)

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_nameB.SORT BY age DESC, last_nameC.ORDER BY age DESC, last_nameD.ORDER BY age ASC, last_name

The EMP table contains these columns:LAST_NAME VARCHAR2 (25)SALARY NUMBER (6,2)DEPARTMENT_ID NUMBER (6)You need to display the employees who have not been assigned to any department. You write the SELECT statement:SELECT LAST_NAME, SALARY, DEPARTMENT_IDFROM EMPWHERE DEPARTMENT_ID = NULL;What is true about this SQL statement ?()A.The SQL statement displays the desired results.B.The column in the WHERE clause should be changed to display the desired results.C.The operator in the WHERE clause should be changed to display the desired results.D.The WHERE clause should be changed to use an outer join to display the desired results.