GoConqr has a new look! Let us know what you think.

Quiz

database final

Duncan Levings 72 questions

Take the quiz

This quiz has question types that open in the usual player.

Questions in this quiz (72)

  1. 1Create a table with column constraints, two attributes; vendor_id (number, is primary key) and vendor_name (varchar2(50) and not null, is unique):
    CREATE [blank_start]TABLE[blank_end] vendors
    (
    [blank_start]vendor_id NUMBER PRIMARY KEY[blank_end],
    [blank_start]vendor_name VARCHAR2(50) NOT NULL UNIQUE[blank_end]
    )
    1. ATABLE
    2. Bvendor_id NUMBER PRIMARY KEY
    3. Cvendor_name VARCHAR2(50) NOT NULL UNIQUE
  2. 2vendor_id NUMBER PRIMARY KEY - [blank_start]unnamed constraint[blank_end]


    vendor_id NUMBER CONSTRAINT vendors_pk PRIMARY KEY - [blank_start]named constraint[blank_end]
    1. Aunnamed constraint
    2. Bnamed constraint
    3. Cconstraint
  3. 3composite primary key constraints are written as:
    CONSTRAINT value PRIMARY KEY (value1, value2)
    1. ATrue
    2. BFalse
  4. 4foreign key constraint is also known as reference constraint
    1. ATrue
    2. BFalse
  5. 5create table with foreign key constraint for vendors table (vendor_id value):
    CREATE TABLE invoices(
    invoice_id NUMBER PRIMARY KEY,
    vendor_id NUMBER [blank_start]REFERENCES vendors[blank_end] ([blank_start]vendor_id[blank_end]),
    invoice_number VARCHAR2(50) NOT NULL UNIQUE
    );
    1. AREFERENCES vendors
    2. Bvendor_id
  6. 6table level foreign key constraints are written as:

    CONSTRAINT named_foreign_key FOREIGN KEY (value) REFERENCES table (value)
    1. ATrue
    2. BFalse
  7. 7Check constraints are used to restrict values, add two checks to the table, check if invoice_total is >= 0 and payment_total is >= 0

    CREATE TABLE invoices(
    invoice_id NUMBER PRIMARY KEY,
    invoice_total NUMBER(9,2) NOT NULL
    [blank_start]CHECK[blank_end] ([blank_start]invoice_total >= 0[blank_end]),
    payment_total NUMBER(9,2) DEFAULT 0
    CHECK ([blank_start]payment_total >= 0[blank_end])
    )
    1. ACHECK
    2. Binvoice_total >= 0
    3. Cpayment_total >= 0
  8. 8What are the following commands:

    Rename a table: [blank_start]rename[blank_end] vendors to vendor
    delete all data from a table: [blank_start]truncate[blank_end] table vendor
    delete a table from the database: [blank_start]drop[blank_end] table vendor
    check table structure: [blank_start]desc[blank_end] vendor
    1. Arename
    2. Btruncate
    3. Cdrop
    4. Ddesc
  9. 9Insert command is as follows:

    INSERT INTO members (value1, value2, value3)
    VALUES (‘value1', 'value2', 'value3');
    1. ATrue
    2. BFalse
  10. 10Update table options to change ocost to 115.00 and olist to 200.00 where the ocode is 'CD2'

    UPDATE options
    [blank_start]SET ocost[blank_end] = 115.00,
    [blank_start]olist[blank_end] = 200.00 [blank_start]WHERE ocode[blank_end] = ‘[blank_start]CD2[blank_end]’;
    (1 rows updated)
    1. ASET ocost
    2. Bolist
    3. CWHERE ocode
    4. DCD2

Information

Description
Computer Science Quiz on database final, created by Duncan Levings on 09/08/2018.
Language
English
Views
11
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?