Help shape GoConqr. What should we add next?

Quiz

Week 5 and 6

Dani Nunns 13 questions

Take the quiz

Questions in this quiz (13)

  1. 1Consider two cases:

    (1) r join s on r.A=s.B, and

    (2) r left join s on r.A=s.B.

    Which of the following statements best describes the two cases?
    1. A(1) may produce the same number of columns and the same number of tuples as those by (2).
    2. B(2) produces less tuples as it concerns dangling tuples.
    3. Cc. (2) is used because the user wants to see more null values in the output.
    4. Dd. (1) produces less columns than (2).
  2. 2What is true about the NOT JOIN in the following query:

    SELECT *
    FROM CHARACTERS C1 NOT JOIN CHARACTERS C2

    ON C1.characterID = C2.characterID
    1. AIt is the equivalent to an INNER JOIN ON C1.characterID <> C2.characterID.
    2. BIt is a JOIN which restricts how the normal INNER JOIN works.
    3. CIt is one of the several types of JOINs in SQL Server.
    4. DNone of these are correct. NOT JOIN is not a valid JOIN.
  3. 3Consider the table tblStaff(name, position, department, salary).

    Write SQL statement to increase the salary by 10% for those having salary at most 50K, and by 5% for those having salary over 50K.

    Which of the following statements is correct in terms of correct syntax and having no possibility of incorrect outcome?
    1. AUPDATE tblStaff
      SET salary = salary * 1.1
      WHERE salary <= 50000;

      UPDATE tblStaff
      SET salary = salary * 1.05
      WHERE salary > 50000;
    2. BUPDATE tblStaff
      SET salary = salary * 1.1
      WHERE salary <= 50000
      SET salary = salary * 1.05
      WHERE salary > 50000;
    3. CUPDATE tblStaff
      SET salary = salary * 1.05
      WHERE salary > 50000
      SET salary = salary * 1.1
      WHERE salary <= 50000;
    4. DUPDATE tblStaff
      SET salary = salary * 1.05
      WHERE salary > 50000;

      UPDATE tblStaff
      SET salary = salary * 1.1
      WHERE salary <= 50000;
  4. 4Consider the following SQL DDL for a table tblPerson:

    CREATE TABLE tblPerson(
    PersonID INTEGER(5) NOT NULL,
    FirstName VARCHAR(30) NOT NULL,
    LastName VARCHAR(30),
    BirthDate DATE NOT NULL,
    Salary FLOAT(8,2),
    PRIMARY KEY (PersonID)
    );

    Again, consider an instance of the table tblPerson looks as follows:

    Which of the following statements will not fail to execute?
    Image for question 4
    1. AINSERT INTO tblPerson
      VALUES(30003, 'Carol', 'Danvers', '1980-07-08', 200K);
    2. BINSERT INTO tblPerson
      VALUES(30002, 'Bruce', 'Banner', '1970-07-04', 100000.00);
    3. CINSERT INTO tblPerson
      VALUES(30033, 'Thor', , '1370-12-21', );
    4. DINSERT INTO tblPerson
      VALUES(30067, 'Natasha', 'Romanof', , 70000.00);
  5. 5[True/False]: Consider the table tblProduct(ProductCode, ProductName, Price).

    The SQL statement

    DELETE FROM tblProduct;

    will not be executed as there is no WHERE clause added.
    1. ATrue
    2. BFalse
  6. 6Which of the followings is a basic key word from SQL Data Manipulation Language?
    1. AALTER
    2. BCREATE
    3. CINSERT
    4. DDROP
  7. 7Which of the followings is NOT a common SQL data types?
    1. Adecimal(m,n)
    2. Bint
    3. CString
    4. Ddatetime
  8. 8Consider the table tblStudent(name, age, address).

    Which of the following INSERT statements is not correct?
    1. AINSERT INTO tblStudent(name, address, age) VALUES ('Sam', 'Sydney', 21);
    2. BINSERT INTO tblStudent VALUES ('Bob', 27, 'Brisbane');
    3. CINSERT INTO tblStudent VALUES ('Morris, 'Melbourne', 45);
    4. DINSERT INTO tblStudent(name, age, address) VALUES ('Adam', 32, 'Adelaide');
  9. 9Given the following tables, if you want to return all employees with or without a matching department, which query would you use?



    Departments
    departmentID department
    1 Sewing
    2 Sales
    3 Beanies
    4 Boogie Boards
    5 Parties


    Employees
    name department salary
    Jess 10 5000
    Nathan 5 12000
    Peter 3 6000
    Jennifer 2 8000
    1. ASELECT e.name, d.department
      FROM employees e LEFT OUTER JOIN departments d
      ON (e.department = d.departmentID);
    2. BSELECT e.name, d.department
      FROM employees e INNER JOIN departments d
      ON (e.department = d.departmentID);
    3. CSELECT e.name, d.department
      FROM employees e RIGHT OUTER JOIN departments d
      ON (e.department = d.departmentID);
    4. DSELECT name, department
      FROM employees LEFT OUTER JOIN departments
      ON (department = departmentID);
  10. 10Consider the table tblCourse(courseCode, courseTitle, creditPoint).

    In order to view all the records in the table, which of the following statements need to be executed?
    1. ASELECT ALL-RECORDS
      FROM tblCourse;
    2. BSELECT *
      FROM tblCourse;
    3. CSELECT ALL-ATTRIBUTES
      FROM tblCourse;
    4. DSELECT ALL
      FROM tblCourse;

Information

Description
Quiz on Week 5 and 6, created by Dani Nunns on 06/11/2020.
Language
English
Views
1
Rating
No ratings yet
Rate this quiz
Rate this quiz

More on SQL Joins

Feedback

What is it about?

What should we add next?