O GoConqr está de visual novo! Conte para nós o que você achou.

Quiz

Introduction to SQL

2014068975 14 perguntas

Fazer o quiz

Perguntas do quiz (14)

  1. 1Given the following tables:
    YEAR_2006
    EMPID NAME
    ---------------------------------
    1 Jagger, Mick
    2 Richards, Keith
    3 Wood, Ronnie
    4 Watts, Charlie
    5 Jones, Darryl
    6 Leavell, Chuck
    YEAR_1962
    EMPID NAME
    -------------------------------
    1 Jagger, Mick
    2 Richards, Keith
    3 Jones, Brian
    4 Wyman, Bill
    5 Chapman, Tony
    6 Stewart, Ian
    If the following SQL statement is executed, how many rows will be returned?
    SELECT name FROM year_2006
    UNION
    SELECT name FROM year_1962
    1. A0
    2. B6
    3. C10
    4. D12
  2. 2Given the following table definition:
    SALES
    ---------------------------------------------
    INVOICE_NO CHAR(20) NOT NULL
    SALES_DATE DATE
    SALES_PERSON CHAR(20)
    REGION CHAR(20)
    SALES INTEGER
    If the following SELECT statement is executed, which of the following describes the order of the rows
    in the result data set produced?
    SELECT * FROM sales
    1. AThe rows are sorted by INVOICE_NO in ascending order
    2. BThe rows are sorted by INVOICE_NO in descending order.
    3. CThe rows are ordered based on when they were inserted into the table.
    4. DThe rows are not sorted in any particular order.
  3. 3Given the following table:
    CURRENT_EMPLOYEES
    -----------------------------
    EMPID INTEGER NOT NULL
    NAME CHAR(20)
    SALARY DECIMAL(10,2)
    PAST_EMPLOYEES
    -----------------------------
    EMPID INTEGER NOT NULL
    NAME CHAR(20)
    SALARY DECIMAL(10,2)
    Assuming both tables contain data, which of the following statements will NOT successfully add data to
    table CURRENT_EMPLOYEES?
    1. AINSERT INTO current_employees (empid) VALUES (10)
    2. BINSERT INTO current_employees VALUES (10, 'JAGGER', 85000.00)
    3. CINSERT INTO current_employees SELECT empid, name, salary FROM
      past_employees WHERE empid = 20
    4. DINSERT INTO current_employees (name, salary) VALUES (SELECT name,
      salary FROM past_employees WHERE empid = 20)
  4. 4Given the following table definition:
    SALES
    --------------------------
    SALES_DATE DATE
    SALES_PERSON CHAR(20)
    REGION CHAR(20)
    SALES INTEGER
    Which of the following SQL statements will remove all rows that had a SALES_DATE in the year 1995?
    1. ADELETE * FROM sales WHERE YEAR(sales_date) = 1995
    2. BDELETE FROM sales WHERE YEAR(sales_date) = 1995
    3. CDROP * FROM sales WHERE YEAR(sales_date) = 1995
    4. DDROP FROM sales WHERE YEAR(sales_date) = 1995
  5. 5Given the following two tables:
    NAMES POINTS
    ------------------------ ------------------------
    NAME NUMBER NAME POINTS
    ------------- ------- ------------- -------
    Wayne Gretzky 99 Wayne Gretzky 244
    Jaromir Jagr 68 Jaromir Jagr 168
    Bobby Orr 4 Bobby Orr 129
    Bobby Hull 23 Brett Hull 121
    Brett Hull 16 Mario Lemieux 189
    Mario Lemieux 66 Joe Sakic 94
    Mark Messier 11
    Which of the following statements will display the player name, number, and points for all players that
    have scored points?
    1. ASELECT p.name, n.number, p.points FROM names n
      INNER JOIN points p ON n.name = p.name
    2. BSELECT p.name, n.number, p.points FROM names n
      LEFT OUTER JOIN points p ON n.name = p.name
    3. CSELECT p.name, n.number, p.points FROM names n
      RIGHT OUTER JOIN points p ON n.name = p.name
    4. DSELECT p.name, n.number, p.points FROM names n
      FULL OUTER JOIN points p ON n.name = p.name
  6. 6Given the following two tables:
    NAMES POINTS
    ------------------------ ------------------------
    NAME NUMBER NAME POINTS
    ------------- ------- ------------- -------
    Wayne Gretzky 99 Wayne Gretzky 244
    Jaromir Jagr 68 Bobby Orr 129
    Bobby Orr 4 Brett Hull 121
    Bobby Hull 23 Mario Lemieux 189
    Mario Lemieux 66 Joe Sakic 94
    How many rows would be returned using the following statement?
    SELECT name FROM names, points
    1. A0
    2. B5
    3. C10
    4. D25
  7. 7If the following SQL statements are executed:
    CREATE TABLE make (makeid SMALLINT NOT NULL PRIMARY KEY,
    make VARCHAR(25));
    CREATE TABLE model (modelid SMALLINT,
    model VARCHAR(25),
    makeid SMALLINT,
    CONSTRAINT const1 FOREIGN KEY (makeid)
    REFERENCES make(makeid) ON DELETE RESTRICT);
    And each table created is populated as follows:
    MAKE MODEL
    MAKEID MAKE MODELID MODEL MAKEID
    ------ --------- ------- ------- --------
    1 Ford 1 Mustang 1
    2 Chevrolet 2 Escort 1
    3 Toyota 3 Malibu 2
    4 Camry 3
    If the following SQL statement is executed:
    DELETE FROM make WHERE makeid = 1
    What is the total number of rows that will be deleted?
    1. A0
    2. B1
    3. C2
    4. D3
  8. 8Which of the following allows you to modify records in a table?
    1. ASELECT
    2. BINSERT
    3. CUPDATE
    4. DDELETE
  9. 9Which of the following is TRUE about SQL?
    1. ADDL is used to control access to database and database objects
    2. BDML is used to access data
    3. CDCL is used to group DML statements into transactions
    4. DTCL is used to define properties of data objects
  10. 10Given the following UPDATE statement:
    UPDATE employees SET workdept =
    (SELECT deptno FROM department WHERE deptno = 'A01')
    WHERE workdept IS NULL
    Which of the following describes the result if this statement is executed?
    1. AThe statement will fail because an UPDATE statement cannot contain a subquery.
    2. BThe statement will only succeed if the data retrieved by the subquery does not contain multiple
      records.
    3. CThe statement will succeed; if the data retrieved by the subquery contains multiple records, only the
      first record will be used to perform the update.
    4. DThe statement will only succeed if every record in the EMPLOYEES table has a null value in the
      WORKDEPT column.

Informações

Descrição
Quiz sobre Introduction to SQL, criado por 2014068975 em 08-10-2015.
Idioma
English
Visualizações
2
Avaliação
Ainda sem avaliações
Avalie este quiz
Avalie este quiz

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?