Tag: databases

Questions Related to databases

Which of the following SQL statements does count the rows in the 'Sales' table?

  1. SELECT COUNT(*) IN Sales

  2. SELECT NUM() FROM Sales

  3. SELECT COUNTER(*) FROM Sales

  4. SELECT COUNT(*) FROM Sales


Correct Option: D
  1. INSERT Projects ('Content Development', 'Website content development project')

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

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

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


Correct Option: B
  1. ORDER BY clause

  2. GROUP BY clause.

  3. JOIN clause.

  4. WHERE clause.


Correct Option: D
Explanation:

To solve this question, the user needs to know the basic syntax and usage of the LIKE keyword in SQL.

The LIKE keyword is used in SQL along with the WHERE clause to search for a specific pattern in a column of a table. The LIKE keyword is used to perform partial matching of strings and can be used with wildcard characters, such as % to represent any number of characters or _ to represent a single character.

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

A. ORDER BY clause: This option is incorrect because the ORDER BY clause is used to sort the result set in ascending or descending order based on one or more columns. It does not have any relation to the LIKE keyword.

B. GROUP BY clause: This option is incorrect because the GROUP BY clause is used to group the result set based on one or more columns. It also does not have any relation to the LIKE keyword.

C. JOIN clause: This option is incorrect because the JOIN clause is used to combine rows from two or more tables based on a related column between them. It also does not have any relation to the LIKE keyword.

D. WHERE clause: This option is correct. The LIKE keyword is used along with the WHERE clause to filter the rows in a table based on a specific pattern in a column. The WHERE clause is used to specify the condition that must be met for a row to be included in the result set.

Therefore, the correct answer is: D. WHERE clause.

  1. update database table.

  2. verify that the inserted data is correct.

  3. select data from 2 or more tables related by common attribute (table column).

  4. delete data from database table.


Correct Option: C
  1. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'

  2. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'

  3. SELECT * FROM Contest WHERE ContestDate < '05/25/2006'

  4. SELECT * FROM Contest IN ContestDate < '05/25/2006'


Correct Option: B
  1. You can if you use nested SQL statements

  2. You can use UPDATE and SELECT clauses together, even if you don’t have nested SQL statements.

  3. You can if you use WITH clause.

  4. You can't


Correct Option: A
  1. The FROM SQL keyword specifies a column list

  2. The FROM SQL keyword specifies a search condition.

  3. The FROM SQL keyword specifies the tables, views, and joined tables used in SELECT, UPDATE and DELETE SQL statements.

  4. The FROM SQL keyword specifies a find condition.


Correct Option: C