-
Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table? ()
A . CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) NOT NULL CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);
B . CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));
C . CREATE TABLE EMP (empno NUMBER(4) ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));
D . CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp deptno fk REFERENCES dept (deptno))
-
Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()
A . SELECT UNIQUE dept FROM staff
B . SELECT DISTINCT dept FROM staff
C . SELECT (dept) UNIQUE FROM staff
D . SELECT (dept) DISTINCT FROM staff
-
The user Alice wants to grant all users query privileges on her DEPT table. Which SQL statement accomplishes this? ()
A . GRANT select ON dept TO ALL_ USER;
B . GRANT select ON dept TO ALL;
C . GRANT QUERY ON dept TO ALL_USERS
D . GRANT select ON dept TO PUBLIC
-
Evaluate the SQL statement DROP TABLE DEPT: Which four statements are true of the SQL statement? ()
A . You cannot roll back this statement.
B . All pending transactions are committed.
C . All views based on the DEPT table are deleted.
D . All indexes based on the DEPT table are dropped.
E . All data in the table is deleted, and the table structure is also deleted.
F . All data in the table is deleted, but the structure of the table is retained.
G . All synonyms based on the DEPT table are deleted.
-
Evaluate the set of SQL statements: CREATE TABLE dept (deptno NUMBER(2), dname VARCNAR2(14), 1oc VARCNAR2 (13)); ROLLBACK; DESCRIBE DEPT What is true about the set?()
A . The DESCRIBE DEPT statement displays the structure of the DEPT table.
B . The ROLLBACK statement frees the storage space occupies by the DEPT table.
C . The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist.
D . The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is a COMMIT statement introduced before the ROLLBACK statement.
-
Evaluate the set of SQL statements: CREATE TABLE dept (deptno NUMBER(2), dname VARCHAR2(14), loc VARCHAR2(13)); ROLLBACK; DESCRIBE DEPT What is true about the set?()
A . The DESCRIBE DEPT statement displays the structure of the DEPT table.
B . The ROLLBACK statement frees the storage space occupied by the DEPT table.
C . The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist.
D . The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is a COMMIT statement introduced before the ROLLBACK statement.
-
Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP table?()
A . CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);
B . CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));
C . CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));
D . CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp_deptno_fk REFERENCES dept (deptno))
-
默认约束是在CREATE TABLE或ALTER TABLE语句中定义的,删除表的时候默认约束也随之删除了。
A . 正确
B . 错误
-
On Monday, you dropped the DEPT table from your schema and then you re-created the DEPT table in your schema. On Wednesday, you have a requirement to restore the DEPT table from the recycle bin. Which statement is correct?()
A . You can restore the DEPT table by using the Oracle Flashback Drop feature, provided you use the RENAME TO clause.
B . You can restore the DEPT table by using the Oracle Flashback Drop feature and a system-generated name will be assigned to the restored table.
C . You cannot restore the DEPT table by using the Oracle Flashback Drop feature because a table with the name DEPT already exists in your schema.
D . You cannot restore the DEPT table by using the Oracle Flashback Drop feature because the contents of the recycle bin are purged every 12 hours by default.
-
Evaluate the SQL statement: TRUNCATE TABLE DEPT; Which three are true about the SQL statement? ()
A . It releases the storage space used by the table.
B . It does not release the storage space used by the table.
C . You can roll back the deletion of rows after the statement executes.
D . You can NOT roll back the deletion of rows after the statement executes.
E . An attempt to use DESCRIBE on the DEPT table after the TRUNCATE statement executes will display an error.
F . You must be the owner of the table or have DELETE ANY TABLE system privileges to truncate the DEPT table
-
What type of constraint is used to ensure that each row inserted into the EMPLOYEE table with a value in the WORKDEPT column has a row with a corresponding value in the DEPTNO column of the DEPARTMENT table?()
A . A check constraint on the EMPLOYEE table
B . A unique constraint on the EMPLOYEE table WORKDEPT column
C . A foreign key reference from the DEPARTMENT tables DEPTNO column to the WORKDEPT column of the EMPLOYEE table
D . A foreign key reference from the EMPLOYEE tables WORKDEPT column to the DEPTNO column of the DEPARTMENT table
-
On Monday, you dropped the DEPT table from your schema and then you re-created the DEPT table in your schema. On Wednesday, you have a requirement to restore the DEPT table from the recycle bin. Which statement is correct?()
A . You cannot restore the DEPT table by using the Oracle Flashback Drop feature because a table with the name DEPT already exists in your schema.
B . You can restore the DEPT table by using the Oracle Flashback Drop feature, provided you use the RENAME TO clause.
C . You cannot restore the DEPT table by using the Oracle Flashback Drop feature because the contents of the recycle bin are purged every 12 hours by default.
D . You can restore the DEPT table by using the Oracle Flashback Drop feature and a system-generated name will be assigned to the restored table.
-
A user needs to create a trigger that will update table T2 whenever a row is added to table T1. Assuming the user has all appropriate privileges for table T2, which privilege is required on table T1 to create the trigger?()
A . REFERENCES
B . SELECT
C . UPDATE
D . ALTER
-
Scott issues the SQL statements: CREATE TABLE dept (deptno NUMBER(2), dname VARCHAR2(14), loc VARCHAR2(13)}; GRANT SELECT ON DEPT T0 SUE; If Sue needs to select from Scott's DEPT table, which command should she use?()
A . SELECT*FROMDEPT;
B . SELECT*FROMSCOTT.DEPT;
C . SELECT*FROMDBASCOTTDEPT;
D . SELECT*FROMALL_USERSWHEREUSER_NAME=';SCOTT';ANDTABLENAME=';DEPT';;
-
Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table?()
A .https://assets.asklib.com/images/image2/2018080115165365786.jpg
B .https://assets.asklib.com/images/image2/2018080115165818527.jpg
C .https://assets.asklib.com/images/image2/2018080115170192388.jpg
D .https://assets.asklib.com/images/image2/2018080115170459610.jpg
-
Evaluate the CREATE TABLE statement: CREATE TABLE products (product_id NUMBER (6) CONSTRAINT prod_id_pk PRIMARY KEY, product_name VARCHAR2 (15)); Which statement is true regarding the PROD_ID_PK constraint?()
A . It would be created only if a unique index is manually created first.
B . It would be created and would use an automatically created unique index.
C . It would be created and would use an automatically created nonunique index.
D . It would be created and remains in a disabled state because no index is specified in the command.
-
Which is a valid CREATE TABLE statement? ()
A . CREATE TABLE EMP9$# AS (empid number(2));
B . CREATE TABLE EMP*123 AS (empid number(2));
C . CREATE TABLE PACKAGE AS (packid number(2));
D . CREATE TABLE 1EMP_TEST AS (empid number(2))
-
CREATE TABLE是______功能的SQL语句。CREATE TABLE是______功能的SQL语句
-
使用SQL的CREATE TABLE语句建立数据库表时,为了说明主关键字应该使用关键词 KEY。使用SQL的CREATE TABLE语句建立数据库表时,为了说明主关键字应该使用关键词 KEY。
-
The following statements:CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TA
The following statements:CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TABLE t2 (col1 INT NOT NULL, col2 CHAR(1) NOT NULL, PRIMARY KEY (col1, col2), FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE t3 (col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (col1, col2),FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE NO ACTION ON UPDATE RESTRICT);INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1, ‘a‘), (1, ‘b‘), (2,‘c‘); INSERT INTO t3 VALUES (1, 100), (2, 200), (2,300);How many rows will be deleted by the following DELETE statement? DELETE FROM t1 WHERE col1= 1;()
A.4
B.3
C.1
D.0
-
下面是一个sqlload的控制文件,其中INFILE *是什么意思? LOAD DATA INFILE * INTO TABLE DEPT FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' (DEPTNO, DNAME, LOC) BEGINDATA 12,RESEARCH,"SARATOGA" 13,FINANCE,"BOSTON" 21,"SALES",PHILA. 22,"SALES",ROCHESTER 42,"INT'L","SAN FRAN"()
A. 要加载的数据和控制文件在相同的位置
B. 要加载的数据和控制文件在一起
-
以下的SQL 99语句,Dept与Employee之间的关系是(63)。 CREATE TYPE Employee(name string,
以下的SQL 99语句,Dept与Employee之间的关系是(63)。 CREATE TYPE Employee(name string, ssn integer); CREATE TYPE Dept(Name string Head ref(Employee)SCOPE Employee );
A.类型继承
B.类型引用
C.数据引用
D.无任何关系
-
Evaluate the set of SQL statements:CREATE TABLE dept(deptno NUMBER(2),dname VARCNAR2(14),1oc VARCNAR2 (13));ROLLBACK;DESCRIBE DEPTWhat is true about the set?()
A. The DESCRIBE DEPT statement displays the structure of the DEPT table.
B. The ROLLBACK statement frees the storage space occupies by the DEPT table.
C. The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist.
D. The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is a COMMIT statement introduced before the ROLLBACK statement.
-
将各个系教师的平均工资定义为视图average_salary. create view average_salary as select dept_name,max(salary) from instructor; group by dept_name;