0

databases Online Quiz - 145

Description: databases Online Quiz - 145
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0
  1. SELECT * FROM Products ORDER BY ProductID

  2. SELECT * FROM Products WHERE ProductID > 200

  3. SELECT * FROM Products ORDERED BY ProductID

  4. SELECT ProductID FROM Products


Correct Option: A
  1. Selects all Customers from the Sales table

  2. Selects all customers from table Sales that have made more than 5 orders.

  3. Selects the total number of orders from the Sales table, if this number is greater than 5

  4. Selects no records


Correct Option: B
  1. The foreign key is a column that can have NULL values.

  2. The foreign key is a SQL locking mechanism.

  3. A foreign key is a key field (column) in a database table, which relates the table to another table where the key is a primary key. The primary - foreign key relations are used to cross-reference database tables.

  4. The foreign key is a column that should be primary key for that table.


Correct Option: C
Explanation:

To understand what a foreign key is, the user needs to have a basic understanding of database design.

The correct answer is:

C. A foreign key is a key field (column) in a database table, which relates the table to another table where the key is a primary key. The primary-foreign key relations are used to cross-reference database tables.

Explanation of options:

A. This option is incorrect because a foreign key cannot have NULL values. A foreign key must reference a valid primary key in another table.

B. This option is incorrect because a foreign key is not related to SQL locking mechanisms. SQL locking mechanisms are used to manage concurrent access to data.

D. This option is incorrect because a foreign key cannot be a primary key for that table. A primary key is a unique identifier for a table, while a foreign key is used to reference a primary key in another table.

  1. INSERT Projects VALUES ('Content Development', 'Website content development project')

  2. INSERT Projects ('Content Development', 'Website content development project')

  3. INSERT INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project')

  4. SAVE INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project')


Correct Option: C
  1. SELECT FROM Sales WHERE Date BETWEEN ('10/12/2005', '01/01/2006')

  2. SELECT * FROM Sales WHERE Date BETWEEN '10/12/2005' AND '01/01/2006'

  3. SELECT FROM Sales WHERE Date BETWEEN '10/12/2005' AND '01/01/2006'

  4. SELECT * FROM Sales WHERE Date BETWEEN ('10/12/2005', '01/01/2006')


Correct Option: B
  1. Self Join

  2. Selective Join.

  3. Outer Join

  4. You can't join a table to itself.


Correct Option: A
  1. GROWN

  2. FROM

  3. UPDATING

  4. DELETING


Correct Option: B
Explanation:

To solve this question, the user needs to know what a reserved SQL keyword is. A reserved SQL keyword is a word that has a special meaning in SQL and cannot be used as a name for a table, column, or other database object.

Now, let's go through each option and explain why it is right or wrong:

A. GROWN: This option is incorrect because "GROWN" is not a reserved SQL keyword. It is not a commonly used SQL keyword and can be used as a name for a table, column, or other database object.

B. FROM: This option is correct. "FROM" is a reserved SQL keyword that is used to specify the table or tables from which to retrieve data in a SELECT statement. It is a commonly used SQL keyword and cannot be used as a name for a table, column, or other database object.

C. UPDATING: This option is incorrect because "UPDATING" is not a reserved SQL keyword. While "UPDATE" is a reserved SQL keyword that is used to modify data in a table, "UPDATING" is not a commonly used SQL keyword and can be used as a name for a table, column, or other database object.

D. DELETING: This option is incorrect because "DELETING" is not a reserved SQL keyword. While "DELETE" is a reserved SQL keyword that is used to remove rows from a table, "DELETING" is not a commonly used SQL keyword and can be used as a name for a table, column, or other database object.

The Answer is: B

  1. Use SELECT COUNT(*)...in db2 query

  2. Use SELECT DISTINCT...in db2 query

  3. Use SELECT MAX(...)...in db2 query

  4. Use SELECT ROWNUM(*)...in db2 query


Correct Option: A
  1. 8 bytes, 6 bytes, 26 bytes

  2. 4 bytes, 3 bytes, 13 bytes

  3. 4 bytes, 3 bytes, 10 bytes

  4. 10 bytes, 8 bytes, 26 bytes


Correct Option: D

How do you eliminate duplicate values in DB2 SELECT?

  1. Use SELECT UNION(*)...in db2 query

  2. Use SELECT DISTINCT...in db2 query

  3. Use SELECT UNION ALL(...)...in db2 query

  4. Use SELECT DISTINCT ALL(*)...in db2 query


Correct Option: B

OLEDB Command can be used to call Store Procedure from Database in data Flow Task.

  1. True

  2. False


Correct Option: A
- Hide questions