itgle.com

单选题Given the following table definition: STOCK: item VARCHAR(30) status CHAR(1) quantity INT price DEC(7,2) If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero, which of the following statements would be used

题目
单选题
Given the following table definition: STOCK: item VARCHAR(30) status CHAR(1) quantity INT price DEC(7,2) If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero, which of the following statements would be used to update the STOCK table to indicate that all the items whose description begins with the letter "S" are out of stock?()
A

UPDATE stock SET (status = NULL; quantity, price = 0) WHERE item LIKE S%

B

UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE item LIKE S%

C

UPDATE stock SET status = NULL, SET quantity = 0, SET price = 0 WHERE item LIKE 'S%'

D

UPDATE stock SET (status = NULL), (quantity = 0), (price = 0) WHERE item LIKE S%


相似考题

3.Given the following requirements:Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values ‘C‘, ‘H‘ and ‘N‘, and permits inserts only when a corresponding value for the employee‘s department exists in the DEPARTMENT table.Which of the following CREATE statements will successfully create this table?()A.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN (‘C‘,‘H‘,‘N‘)), );B.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES (‘C‘,‘H‘,‘N‘) );C.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN (‘C‘,‘H‘,‘N‘)), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );D.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN (‘C‘,‘H‘,‘N‘)) );

参考答案和解析
正确答案: A
解析: 暂无解析
更多“单选题Given the following table definition: STOCK: item VARCHAR(30) status CHAR(1) quantity INT price DEC(7,2) If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero, which of the following statements would be used”相关问题
  • 第1题:

    Given the following requirements:Create a table named TESTTAB, which has an identity column named ACTIVITYNO. Define the identity column to generate the values for the column by default. Start the values at 10 and increment by 10. Make the identity column unique. Which of the following CREATE statements will successfully create this table?()

    A.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

    B.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTNO))

    C.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 1), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

    D.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))


    参考答案:D

  • 第2题:

    阅读以下说明和 Java 代码,填补代码中的空缺,将解答填入答题纸的对应栏内。 【说明】 在股票交易中,股票代理根据客户发出的股票操作指示进行股票的买卖操作。其类图如图 6-1 所示。相应的Java 代码附后。图6-1 类图

    【 Java 代码】 import java.util.ArrayList; import java.util.List; class Stock { private String name; private int quantity; public Stock(String name ,int quantity) { this.name = name; this.quantity = quantity; } public void buy() { System.out.println("[ 买进]: " + name + ",数量. " + quantity);} public void sell() { System.out.println("[ 卖出]: " + name + ",数量. " + quantity);} } interface Order { void execute(); } class BuyStock (1) Order { private Stock stock; public BuyStock(Stock stock) { (2) = stock; } public void execute() { stock.buy();} } //类SellStock实现和BuyStock 类似,略 class Broker { private List<Order> orderList = new ArrayList<Order>(); public void takeOrder( (3) order) { orderList.add(order); } public void placeOrders() { for ( (4) order : orderList) { order.execute(); } orderList.clear(); } } public class StockCommand { public static void main(String[] args) { Stock aStock = new Stock("股票 A" ,10); Stock bStock = new Stock("股票 B" ,20); Order buyStockOrder = new BuyStock(aStock); Order sellStockOrder = new SellStock(bStock ); Broker broker = new Broker(); broker.takeOrder(buyStockOrder); broker.takeOrder(sellStockOrder); broker. (5) ; } }


    正确答案:(1) implements
    (2) this.stock
    (3) Order
    (4) Order
    (5) placeOrders()

  • 第3题:

    Given the following table definition: STOCK: item VARCHAR(30) status CHAR(1) quantity INT price DEC(7,2) If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero, which of the following statements would be used to update the STOCK table to indicate that all the items whose description begins with the letter "S" are out of stock?()

    • A、UPDATE stock SET (status = NULL; quantity, price = 0) WHERE item LIKE S%
    • B、UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE item LIKE S%
    • C、UPDATE stock SET status = NULL, SET quantity = 0, SET price = 0 WHERE item LIKE 'S%'
    • D、UPDATE stock SET (status = NULL), (quantity = 0), (price = 0) WHERE item LIKE S%

    正确答案:B

  • 第4题:

    An application needs a table for each connection that tracks the ID and Name of all items previously ordered and committed within the connection. The table also needs to be cleaned up and automatically removed each time a connection is ended. Assuming the ITEMS table was created with the following SQL statement: CREATE TABLE items item_no INT, item_name CHAR(5), item_qty INT) Which of the following SQL statements will provide the table definition that meets the specified requirements?()

    • A、DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE
    • B、DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS
    • C、CREATE TABLE systmp.tracker AS (SELECT item_num, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS
    • D、CREATE TABLE tracker AS (SELECT item_num, item_name FROM items) ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE

    正确答案:B

  • 第5题:

    Given the following code:     public class Person{     int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1]);     }     }  Which statement is correct?() 

    • A、 When compilation some error will occur.
    • B、 It is correct when compilation but will cause error when running.
    • C、 The output is zero.
    • D、 The output is null.

    正确答案:A

  • 第6题:

    You are creating a DataTable. You use the following code segment to create the DataTable. (Line numbers are included for reference only.) 01 Dim dt As New DataTable("Products") 02 dt.Columns.Add(New DataColumn("Price", _ GetType(Decimal))) 03 dt.Columns.Add(New DataColumn("Quantity", _ GetType(Int32))) 04 Dim dc As DataColumn = New DataColumn("Total", _ GetType(Decimal)) 05 dt.Columns.Add(dc) You need to ensure that the Total column is set to the value of the Price column multiplied by the Quantity column when new rows are added or changed. What should you do? ()

    • A、Add the following code segment after line 05. dc.ExtendedProperties("Total") = "Price * Quantity"
    • B、Add the following code segment after line 05. dc.Expression = "Price * Quantity"
    • C、Write an event handler for the DataTable's TableNewRow event that updates the row's Total.
    • D、Write an event handler for the DataTable's ColumnChanged event that updates the row's Total.

    正确答案:B

  • 第7题:

    单选题
    Evaluate the following SQL statements that are issued in the given order: What would be the status of the foreign key EMP_MGR_FK?()
    A

     It would be automatically enabled and deferred.

    B

     It would be automatically enabled and immediate.

    C

     It would remain disabled and has to be enabled manually using the ALTER TABLE command.

    D

     It would remain disabled and can be enabled only by dropping the foreign key constraint and re-creating it.


    正确答案: B
    解析: 暂无解析

  • 第8题:

    单选题
    Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()
    A

    CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );

    B

    CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );

    C

    CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );

    D

    CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );


    正确答案: A
    解析: 暂无解析

  • 第9题:

    单选题
    You are trying to alter the initial segment size given to a table in a dictionary-managed tablespace. Which of the following keywords would be used as part of this process?()
    A

    DROP TABLE 

    B

    ALTER TABLE 

    C

    RESIZE 

    D

    COALESCE


    正确答案: B
    解析: 暂无解析

  • 第10题:

    单选题
    You are creating a DataTable. You use the following code segment to create the DataTable. (Line numbers are included for reference only.) 01 DataTable dt = new DataTable(“Products”); 02 dt.Columns.Add(new DataColumn(“Price”, typeof(decimal))); 03 dt.Columns.Add(new DataColumn(“Quantity”, typeof(Int32))); 04 DataColumn dc = new DataColumn(“Total”, typeof(decimal)); 05 dt.Columns.Add(dc); You need to ensure that the Total column is set to the value of the Price column multiplied by the Quantity column when new rows are added or changed. What should you do? ()
    A

    Add the following code segment after line 05. dc.ExtendedProperties[Total] = Price * Quantity”;

    B

    Add the following code segment after line 05. dc.Expression = “Prince * Quantity”;

    C

    Write an event handler for the DataTable's TableNewRow event that updates the row's Total.

    D

    Write an event handler for the DataTable's ColumnChanged event that updates the row's Total.


    正确答案: B
    解析: 暂无解析

  • 第11题:

    单选题
    Given the following requirements:Create a table named TESTTAB, which has an identity column named ACTIVITYNO. Define the identity column to generate the values for the column by default. Start the values at 10 and increment by 10. Make the identity column unique. Which of the following CREATE statements will successfully create this table?()
    A

    CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

    B

    CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTNO))

    C

    CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 1), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

    D

    CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))


    正确答案: C
    解析: 暂无解析

  • 第12题:

    问答题
    What was the percent decrease in the price of MegaTek (MGTK) stock during the market decline of March 1, 2001, to March 1, 2002?  (1) The price of MGTK was $56.20 on March 1, 2001.  (2) The price of the stock on January 1, 2002, was only one-quarter of its price as of March 1, 2001.

    正确答案: E
    解析:
    两个条件无法计算出MGTK的股票下降率,故本题选E项。

  • 第13题:

    阅读以下说明和 C++代码,填补代码中的空缺,将解答填入答题纸的对应栏内。 【说明】 在股票交易中,股票代理根据客户发出的股票操作指示进行股票的买卖操作。其类图如图5-1所示,相应的c++代码附后。图5-1 类图

    【C++代码】 include <iostream> include <string> include <vector> using namespace std; class Stock { private: string name; int quantity; public: Stock(string name ,int quantity) { this->name= name;this->quantity = quantity; } void buy() { cout<<" [买进]股票名称: "<< name << ",数量: "<< quantity << endl;} void sell() { cout<<" [卖出]股票名称: " << name << ",数量:"<< quantity <<endl; } }; class Order { public: virtual void execute() = 0; }; classBuyStock: (1) { private: Stock* stock; public: BuyStock(Stock* stock) { (2) = stock; } void execute() { stock->buy () ; } }; //类SellStock的实现与BuyStock类似,此处略 c1ass Broker { private: vector < Order*> orderList; pub1ic: void takeOrder( (3) order) { orderList.push_back(order);} void p1aceOrders() { for (inti=O; i<orderList.size(); i++) { (4) -> execute () ; } orderList.c1ear(); } }; c1ass StockCommand { pub1ic: void main () { Stock* aStock = new Stock("股票 A" ,10); Stock* bStock = new Stock("股票 B" ,20); Order* buyStockOrder = new BuyStock(aStock); Order* se11StockOrder = new Se11Stock(bStock); Broker* broker = new Broker(); broker->takeOrder(buyStockOrder); broker->takeOrder(se11StockOrder); broker-> (5) () ; } }; int main() { StockCommand* stockCommand = new StockCommand(); stockCommand->main(); de1ete stockCommand; }


    正确答案:(1) public Order
    (2) this->stock或(*this)stock
    (3) Order*
    (4) orderList[i]或*(orderList+i)
    (5) placeOrders

  • 第14题:

    阅读以下说明和C++代码,填补代码中的空缺,将解答填入答题纸的对应栏内。
    [说明]
    在股票交易中,股票代理根据客户发出的股票操作指示进行股票的买卖操作。其类图如下图所示,相应的C++代码附后。

    类图

    [C++代码] #include<iostream> #include<string> #include<vector> using namespacestd; class Stock { private: string name; int quantity; public: Stock(stringname,int quantity) {this->name=name;this->quantity =quantity;} void buy() {cout<<"[买进]股票名称:"<<name<<",数量:"<<quantity<< endl;} void sell() {cout<<"[卖出]股票名称:"<<name<<",数量:"<<quantity <<endl;} }; clasS order{ public: virtual voidexecute()=0; }; classBuyStock:______ { private: Stock* stock; public: BuyStock(Stock*stock){______ =stock; } void execute(){ stock一>buy(); } }; //类SellStock的实现与BuyStock类似,此处略 class Broker{ private: vector<Order*> orderList; public: voidtakeOrder(______ order)( orderLiSt.push back(order);} void placeorders() { for(int i=0;i<orderList.Size(); i++){______ ->execute();} 0rderLiSt.clear(); } }; classStockCommand{ public: VOid main(){ Stock* aStock=newStock("股票A",10); Stock*bStock=newStock("股票B",20); Order*buyStockOrder=new BuyStock(aStock); Order*sellStockOrder=new SellStock(bStock); Broker* broker=newBroker(); broker->takeOrder(buyStockorder); broker->takeOrder(sellStockOrder); broker-> ______ (); } }; int main(){ StockCommand*stockCommand=new StockCommand(); StockCommand->main(); deleteStoCkCommand; }


    答案:
    解析:
    publicOrder
    this->stock 或(*this).stock
    Order*
    orderList[i] 或 *(orderList+i)
    placeOrders


    【解析】

    本题考查C++语言程序设计能力,涉及类、对象、函数的定义和相关操作。要求考生根据给出的案例和代码说明,认真阅读理清程序思路,然后完成题目。
    先考查题目说明,在股票交易中,股票代理根据客户发出的股票操作指示进行股票的买卖操作。根据说明进行设计,题目说明中给出了类图。涉及到股票(Stock)、股票代理(Broker)、股票操作指示(StockCommand)、买卖股票(Order接口、BuyStock与SellStock类)等类以及相关操作。
    Stock类定义了两个函数buy()和sell(),分别实现买和卖的操作。在构造函数中接收参数name和quantity,分别表示买卖股票的名称和数量,对当前所创建对象中的name和quantity赋值,用this表示区别当前对象,所以构造函数为:Stock(String name,int quantity){
    thiS->name=name;
    thiS->quantity=quantity;
    }
    Order虚类声明纯虚函数execute():virtual void execute()=0;表示执行股票交易(即买和卖)的函数原型。
    BuyStock继承Order,构造函数接收参数stock,实现函数execute(),进行股票买入,stock->buy()。SellStock和BuyStock类似,继承Order,构造函数接收参数stock,实现函数execute(),进行股票卖出,stock->sell()。
    Broker类实现接受客户的买卖指示tackOrder(),接收BuyStock或者SellStock的实例,BuyStock和SellStock均是Order的子类,所以BuyStock和SellStock的实例也是Order,因此tackOrder0所接收的参数用Order类型。接收到买卖指示之后,存入vector<Order*>类型的orderList中,即orderList.push_back(order)。placeOrders()函数是实现将所有买卖股票的指示进行实际买入和卖出操作,即采用for循环,对每个orderList中的Stock实例,调用在BuyStock和SellStock中实现的execute()加以执行。for(int i=0; i<orderList.Size();i++) {orderList[i]->execute();}
    StockCommand主要是根据操作指示进行股票交易,实现为一个函数main(),其中创建欲进行交易的股票对象aStock和bStock,创建买aStock卖bStock股票的对象buyStockOrder和sellStockOrder对象:Order*buyStockorder=new BuyStock(aStock);
    Order* sellStockOrder=new SellStock(bStock);
    再创建股票代理Broker类的对象broker,并接收买卖股票的指示:broker->takeOrder(buyStockOrder);
    broker->takeOrder(sellStockOrder);
    最后将所有买卖指示用placeOrders()下执行命令:broker->placeOrders();
    主控逻辑代码在main()函数中实现。在main()函数中,先初始化StockCommand类的对象指针stockCommand,代码为:StockCommand* stockCommand=new StockCommand();
    即生成一个股票指示,并调用其main()函数启动股票交易,即调用stockCommand的main()函数,实现股票的买卖指示的创建和执行。主控main()函数中,使用完数组对象之后,需要用delete操作释放对象,对stockCommand对象进行删除,即delete StockCommand;
    因此,空(1)需要表示继承Order类的"public Order";空(2)需要表示当前对象的stock属性,填入"this->stock"或"(*this).stock";空(3)需要填入BuyStock和SellStock均能表示的父类"Order*";空(4)需要orderList中每个对象指针调用execute(),即填入"orderList[i]"或"*(orderList+i)";空(5)处为调用"placeOrders()"来下达执行命令。

  • 第15题:

    A table was created using the following DDL: CREATE TABLE employee (id SMALLINT NOT NULL, name VARCHAR(9), dept SMALLINT CHECK (dept BETWEEN 10 AND 100), job CHAR(10) CHECK (job IN ('Sales','Mgr','Clerk')), hiredate DATE, salary DECIMAL(7,2), comm DECIMAL(7,2), PRIMARY KEY (id), CONSTRAINT yearsal CHECK (YEAR(hiredate) > 2004 OR salary > 80500) ); Which of the following INSERT statements will fail?()

    • A、INSERT INTO employee VALUES (2, 'Smith', 80, 'Mgr', '09/03/2006', 80000, NULL)
    • B、INSERT INTO employee VALUES (4, 'Smith', 86, 'Mgr', '07/14/2003', 90000, NULL)
    • C、INSERT INTO employee VALUES (1, 'Smith', 55, 'Sales', '07/14/2003', NULL, NULL)
    • D、INSERT INTO employee VALUES (3, 'Smith', 33, 'Analyst', '11/26/2006', 90000, NULL)

    正确答案:D

  • 第16题:

    Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()

    • A、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );
    • B、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );
    • C、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );
    • D、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );

    正确答案:D

  • 第17题:

    You execute the following PL/SQL:Which two statements are true?()

    • A、Fine-Grained Auditing (FGA) is enabled for the PRICE column in the PRODUCTS table for SELECT statements only when a row with PRICE > 10000 is accessed.
    • B、FGA is enabled for the PRODUCTS.PRICE column and an audit record is written whenever a row with PRICE > 10000 is accessed.
    • C、FGA is enabled for all DML operations by JIM on the PRODUCTS.PRICE column.
    • D、FGA is enabled for the PRICE column of the PRODUCTS table and the SQL statements is captured in the FGA audit trial.

    正确答案:A,B

  • 第18题:

    Given the following requirements:Create a table named TESTTAB, which has an identity column named ACTIVITYNO. Define the identity column to generate the values for the column by default. Start the values at 10 and increment by 10. Make the identity column unique. Which of the following CREATE statements will successfully create this table?()

    • A、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))
    • B、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTNO))
    • C、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 1), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))
    • D、CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

    正确答案:D

  • 第19题:

    多选题
    View the Exhibit and examine the data in the PRODUCT INFORMATION table. Which two tasks would require subqueries? ()
    A

    displaying the minimum list price for each product status

    B

    displaying all supplier IDs whose average list price is more than 500

    C

    displaying the number of products whose list prices are more than the average list price

    D

    displaying all the products whose minimum list prices are more than the average list price of products having the product status orderable

    E

    displaying the total number of products supplied by supplier 102071 and having product status OBSOLETE


    正确答案: A,E
    解析: 暂无解析

  • 第20题:

    单选题
    Given the following code:     public class Person{     int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1]);     }     }  Which statement is correct?()
    A

     When compilation some error will occur.

    B

     It is correct when compilation but will cause error when running.

    C

     The output is zero.

    D

     The output is null.


    正确答案: D
    解析: 实例变量在类的一个实例构造时完成初始化,而且在类的静态方法中不能直接访问类的非静态成员而只能访问类成员(像上题中一样),类的普通方法可以访问类的所有成员和方法,而静态方法只能访问类的静态成员和方法,因为静态方法属于类,而普通方法及成员变量属于类的实例,类方法(静态方法)不能使用属于某个不确定的类的实例的方法和变量,在静态方法里面没有隐含的this,而普通方法有。

  • 第21题:

    单选题
    At the beginning of the day, the prices of stocks X and Y are the same. At the end of the day, the price of stock X has increased by 1/20 of its original price and the price of stock Y has decreased by 1/20 of its original price. The new price of stock X is what fraction of the new price of stock Y?
    A

    2/20

    B

    19/21

    C

    21/19

    D

    18/20

    E

    20/18


    正确答案: B
    解析:
    Plugging in. Suppose the prices of stocks X and Y were each $100 at the beginning of the day. Then:The new price of stock X is $105. The new price of stock Y is $95. stock X/stock Y =l05/95= 21/19.

  • 第22题:

    单选题
    A table was created using the following DDL: CREATE TABLE employee (id SMALLINT NOT NULL, name VARCHAR(9), dept SMALLINT CHECK (dept BETWEEN 10 AND 100), job CHAR(10) CHECK (job IN ('Sales','Mgr','Clerk')), hiredate DATE, salary DECIMAL(7,2), comm DECIMAL(7,2), PRIMARY KEY (id), CONSTRAINT yearsal CHECK (YEAR(hiredate) > 2004 OR salary > 80500) ); Which of the following INSERT statements will fail?()
    A

    INSERT INTO employee VALUES (2, 'Smith', 80, 'Mgr', '09/03/2006', 80000, NULL)

    B

    INSERT INTO employee VALUES (4, 'Smith', 86, 'Mgr', '07/14/2003', 90000, NULL)

    C

    INSERT INTO employee VALUES (1, 'Smith', 55, 'Sales', '07/14/2003', NULL, NULL)

    D

    INSERT INTO employee VALUES (3, 'Smith', 33, 'Analyst', '11/26/2006', 90000, NULL)


    正确答案: B
    解析: 暂无解析

  • 第23题:

    单选题
    An application needs a table for each connection that tracks the ID and Name of all items previously ordered and committed within the connection. The table also needs to be cleaned up and automatically removed each time a connection is ended. Assuming the ITEMS table was created with the following SQL statement: CREATE TABLE items item_no INT, item_name CHAR(5), item_qty INT) Which of the following SQL statements will provide the table definition that meets the specified requirements?()
    A

    DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE

    B

    DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS

    C

    CREATE TABLE systmp.tracker AS (SELECT item_num, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS

    D

    CREATE TABLE tracker AS (SELECT item_num, item_name FROM items) ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE


    正确答案: D
    解析: 暂无解析