Tag: databases

Questions Related to databases

  1. UPDATE

  2. SELECT

  3. INSERT

  4. INVERT


Correct Option: D
Explanation:

To solve this question, the user needs to have basic knowledge of SQL keywords and clauses. SQL (Structured Query Language) is a standard language for managing relational databases. It is important to know which words and clauses are part of SQL and which are not.

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

A. UPDATE: This is a SQL keyword that is used to modify existing records in a table.

B. SELECT: This is a SQL keyword that is used to query data from a table.

C. INSERT: This is a SQL keyword that is used to insert new records into a table.

D. INVERT: This is not a SQL keyword or SQL clause. It is not used in SQL to perform any operation.

Therefore, the answer is: D. INVERT.

  1. insert and delete only

  2. update and delete only

  3. update, delete and insert

  4. insert and update only


Correct Option: C
  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