单选题You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()AALTER TABLE students ADD PRIMARY KEY student_id;BALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);CALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;DALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);EALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

单选题
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()
A

ALTER TABLE students ADD PRIMARY KEY student_id;

B

ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);

C

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;

D

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

E

ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);


参考解析

解析: 暂无解析

相关考题:

单选题Which syntax turns an existing constraint on?()AALTER TABLE table_name ENABLE constraint_name;BALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint _ name;CALTER TABLE table_name ENABLE CONSTRAINT constraint _ name;DALTER TABLE table_name TURN ON CONSTRAINT constraint _ name;

多选题Which are DML statements?()ACOMMITBMERGECUPDATEDDELETEECREATEFDROP...

单选题EMPLOYEES and DEPARTMENTS data: EMPLOYEES DEMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_I 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA_DIR 6500 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Admin 20 Education 30 IT 40 Human Resources On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID. On the DEPARTMENTS table DEPARTMENT_ID is the primary key. Evaluate this UPDATE statement. UPDATE employees SET mgr_id = (SELECT mgr_id FROM employees WHERE dept_id= (SELECT department_id FROM departments WHERE department_name = 'Administration')), Salary = (SELECT salary FROM employees WHERE emp_name = 'Smith') WHERE job_id = 'IT_ADMIN'; What happens when the statement is executed?()AThe statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.BThe statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.CThe statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.DThe statement fails because there is more than one row matching the employee name Smith.EThe statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table.FThe statement fails because there is no 'Administration' department in the DEPARTMENTS table.

单选题The EMPLOYEES table contains these columns: LAST_NAME VARCHAR2 (25) SALARY NUMBER (6,2) COMMISSION_PCT NUMBER (6) You need to write a query that will produce these results: 1.Display the salary multiplied by the commission_pct. 2.Exclude employees with a zero commission_pct. 3.Display a zero for employees with a null commission value. Evaluate the SQL statement: SELECT LAST_NAME, SALARY*COMMISSION_PCT FROM EMPLOYEES WHERE COMMISSION_PCT IS NOT NULL; What does the statement provide?()Aall of the desired resultsBtwo of the desired resultsCone of the desired resultsDan error statement

单选题Which constraint can be defined only at the column level?()AUNIQUEBNOT NULLCCHECKDPRIMARY KEYEFOREIGN KEY

单选题You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()AALTER TABLE students ADD PRIMARY KEY _ id;BALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);CALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;DALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);EALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

单选题The DBA issues this SQL command: CREATE USER scott IDENTIFIES by tiger; What privileges does the user Scott have at this point?()ANo privileges.BOnly the SELECT privilege.COnly the CONNECT privilege.DAll the privileges of a default user.

多选题Evaluate this SQL statement: SELECT e.emp_name, d.dept_name FROM employees e JOIN departments d USING (department_id) WHERE d.department_id NOT IN (10,40) ORSER BY dept_name; The statement fails when executed. Which change fixes the error?()Aremove the ORDER BY clauseBremove the table alias prefix from the WHERE clauseCremove the table alias from the SELECT clauseDprefix the column in the USING clause with the table aliasEprefix the column in the ORDER BY clause with the table aliasFreplace the condition d.department_id NOT IN (10,40) in the WHERE clause with d.department_id 10 AND d.department_id 40

单选题You need to give the MANAGER role the ability to select from, insert into, and modify existing rows in the STUDENT_GRADES table. Anyone given this MANAGER role should be able to pass those privileges on to others.Which statement accomplishes this?()AGRANT select, insert, update ON student_grades TO managerBGRANT select, insert, update ON student_grades TO ROLE managerCGRANT select, insert, modify ON student_grades TO manager WITH GRANT OPTION;DGRANT select, insert, update ON student_grades TO manager WITH GRANT OPTION;EGRANT select, insert, update ON student_grades TO ROLE manager WITH GRANT OPTION;FGRANT select, insert, modify ON student_grades TO ROLE manager WITH GRANT OPTION;

单选题You need to change the definition of an existing table. The COMMERCIALS table needs its DESCRIPTION column changed to hold varying length characters up to 2000 bytes. The column can currently hold 1000 bytes per value. The table contains 20000 rows. Which statement is valid?()AALTER TABLE commercials MODIFY (description CHAR2(2000));BALTER TABLE commercials CHANGE (description CHAR2(2000));CALTER TABLE commercials CHANGE (description VARCHAR2 (2000));DALTER TABLE commercials MODIFY (description VARCHAR2 (2000));EYou cannot increase the size of a column if the table has rows.

单选题The EMPLOYEES table has these columns: LAST NAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management 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); What is true about your ALTER statement?()AColumn definitions cannot be altered to add DEFAULT values.BA change to the DEFAULT value affects only subsequent insertions to the table.CColumn definitions cannot be altered at add DEFAULT values for columns with a NUMBER data type.DAll the rows that have a NULL value for the SALARY column will be updated with the value 5000.

单选题Which view should a user query to display the columns associated with the constraints on a table owned by the user?()AUSER_CONSTRAINTSBUSER_OBJECTSCALL_CONSTRAINTSDUSER_CONS_COLUMNSEUSER_COLUMNS

单选题Which clause would you use in a SELECT statement to limit the display to those employees whose salary is greater then 5000?()AORDER BY SALARY 5000BGROUP BY SALARY 5000CHAVING SALARY 5000DWHERE SALARY 5000

单选题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?()ASELECT last_name, department_name FROM employees , departments(+);BSELECT last_name, department_name FROM employees JOIN departments(+);CSELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments dDSELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);ESELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);FSELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e. department _ id = d. department _id);

多选题Which three statements about subqueries are true?()AA single row subquery can retrieve only one column and one row.BA single row subquery can retrieve only one row but many columns.CA multiple row subquery can retrieve multiple rows and multiple columns.DA multiple row subquery can be compared by using the operator.EA single row subquery can use the IN operator.FA multiple row subquery can use the = operator.

单选题Examine the structure of the STUDENTS table: STUDENT_ID NUMBER NOT NULL, Primary Key STUDENT_NAME VARCHAR2(30) COURSE_ID VARCHAR2(10) NOT NULL MARKS NUMBER START_DATE DATE FINISH_DATE DATE You need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999. Which SQL statement accomplishes this task? ()ASELECT student_ id, marks, ROWNUM Rank FROM students WHERE ROWNUM = 10 AND finish_date BETWEEN '01-JAN-99' AND '31-DEC-99 AND course_id = 'INT_SQL' ORDER BY mark DESC;BSELECT student_id, marks, ROWID Rank FROM students WHERE ROWID = 10 AND finish_date BETWEEN '01-JAN-99' AND '31-DEC-99' AND course_id = 'INT_SQL' ORDER BY mark;CSELECT student_id, marks, ROWNUM Rank FROM (SELECT student_id, marks FROM students WHERE ROWNUM = 10 AND finish_date BETWEEN '01-JAN-99' AND '31-DEC- 99' AND course_id = 'INT_SQL' ORDER BY mark DESC;DSELECT student_id, marks, ROWNUM Rank FROM (SELECT student_id, marks FROM students WHERE (finish_date BETWEEN '01-JAN-99 AND '31-DEC-99' AND course_id = 'INT_SQL' ORDER BY marks DESC) WHERE ROWNUM = 10;ESELECT student id, marks, ROWNUM Rank FROM (SELECT student_id, marks FROM students ORDER BY marks) WHERE ROWNUM = 10 AND finish date BETWEEN '01-JAN-99' AND '31-DEC-99' AND course _ id 'INT_SQL';

多选题From SQL*Plus, you issue this SELECT statement: SELECT* FROM order; You use this statement to retrieve data from a data table for ().AUpdatingBViewingCDeletingDInsertingETruncating

单选题Which SELECT statement should you use to extract the year from the system date and display it in the format "1998"?()ASELECT TO_CHAR(SYSDATE,'yyyy') FROM dual;BSELECT TO_DATE(SYSDATE,'yyyy') FROM dual;CSELECT DECODE(SUBSTR(SYSDATE, 8), 'YYYY') FROM dual;DSELECT DECODE(SUBSTR(SYSDATE, 8), 'year') FROM dual;ESELECT TO_CHAR(SUBSTR(SYSDATE, 8,2),'yyyy') FROM dual;

单选题Evaluate this SQL statement: SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAME FROM EMP e, DEPARTMENT d WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID; In the statement, which capabilities of a SELECT statement are performed?()ASelection, projection, joinBDifference, projection, joinCSelection, intersection, joinDIntersection, projection, joinEDifference, projection, product

单选题The CUSTOMERS table has these columns: CUSTOMER_ID NUMBER(4) NOT NULL CUSTOMER_NAME VARCHAR2(100) NOT NULL STREET_ADDRESS VARCHAR2(150) CITY_ADDRESS VARCHAR2(50) STATE_ADDRESS VARCHAR2(50) PROVINCE_ADDRESS VARCHAR2(50) COUNTRY_ADDRESS VARCHAR2(50) POSTAL_CODE VARCHAR2(12) CUSTOMER_PHONE VARCHAR2(20) A promotional sale is being advertised to the customers in France. Which WHERE clause identifies customers that are located in France?()AWHERE lower(country_address) = franceBWHERE lower(country_address) = 'france'CWHERE lower(country_address) IS 'france'DWHERE lower(country_address) = '%france%'EWHERE lower(country_address) LIKE %france%

单选题Which syntax turns an existing constraint on? ()AALTER TABLE table_name ENABLE constraint_name;BALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint _ name;CALTER TABLE table_name ENABLE CONSTRAINT constraint _ name;DALTER TABLE table_name TURN ON CONSTRAINT constraint _ name;

单选题Which SQL statement generates the alias Annual Salary for the calculated column SALARY*12?()ASELECT ename, salary*12 ‘Annual Salary’ FROM employees;BSELECT ename, salary*12 “Annual Salary” FROM employees;CSELECT ename, salary*12 AS Annual Salary FROM employees;DSELECT ename, salary*12 AS INITCAP(“ANNUAL SALARY”) FROM employees

多选题Which four are correct guidelines for naming database tables? ()AMust begin with either a number or a letter.BMust be 1-30 characters long.CShould not be an Oracle Server reserved word.DMust contain only A-Z, a-z, 0-+, _, *, and #.EMust contain only A-Z, a-z, 0-9, _, $, and #.FMust begin with a letter.

单选题The database administrator of your company created a public synonym called HR for the HUMAN_RESOURCES table of the GENERAL schema, because many users frequently use this table. As a user of the database, you created a table called HR in your schema. What happens when you execute this query? SELECT * FROM HR; ()AYou obtain the results retrieved from the public synonym HR created by the database administrator.BYou obtain the results retrieved from the HR table that belongs to your schema.CYou get an error message because you cannot retrieve from a table that has the same name as a public synonym.DYou obtain the results retrieved from both the public synonym HR and the HR table that belongs to your schema, as a Cartesian product.EYou obtain the results retrieved from both the public synonym HR and the HR table that belongs to your schema, as a FULL JOIN.

多选题Which two statements complete a transaction?()ADELETE employees;BDESCRIBE employees;CROLLBACK TO SAVEPOINT C;DGRANT SELECT ON employees TO SCOTT;EALTER TABLE employees SET UNUSED COLUMN sal;FSelect MAX(sal) FROM employees WHERE department_id = 20;

单选题In which scenario would TOP N analysis be the best solution?()AYou want to identify the most senior employee in the company.BYou want to find the manager supervising the largest number of employees.CYou want to identify the person who makes the highest salary for all employees.DYou want to rank the top three sales representatives who have sold the maximum number of products.

多选题Which three are DATETIME data types that can be used when specifying column definitions? ()ATIMESTAMPBINTERVAL MONTH TO DAYCINTERVAL DAY TO SECONDDINTERVAL YEAR TO MONTHETIMESTAMP WITH DATABASE TIMEZONE

单选题The EMPLOYEES table contains these columns: EMPLOYEE_ID NUMBER(4) LAST_NAME VARCHAR2 (25) JOB_ID VARCHAR2(10) You want to search for strings that contain 'SA_' in the JOB_ID column. Which SQL statement do you use?()ASELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA/_%'ESCAPE'/';BSELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_';CSELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_'ESCAPE'/';DSELECT employee_id, last_name, job_id FROM employees WHERE job_id '%SA_';