0

SQL Online Quiz - 3

Description: SQL Online Quiz - 3
Number of Questions: 9
Created by:
Tags: sql
Attempted 0/9 Correct 0 Score 0

SELF JOIN not allowed in

sql
  1. Indexed view

  2. procedures

  3. triggers

  4. views


Correct Option: A

Which of the following do you need to consider when you make a table in SQL?

sql
  1. Data types

  2. Primary keys

  3. Default values

  4. All of the above.


Correct Option: D

SQL query and modification commands make up a(n)

sql
  1. DDL

  2. DML

  3. HTML

  4. XML


Correct Option: B
Explanation:

To solve this question, the user needs to have knowledge of SQL and its different components. In particular, the user needs to understand the purpose of SQL query and modification commands.

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

A. DDL: This option is incorrect. DDL stands for Data Definition Language and is used to define and manage the structure of a database. DDL commands include CREATE, ALTER, and DROP. While DDL commands are part of SQL, they are not specifically related to SQL query and modification commands.

B. DML: This option is correct. DML stands for Data Manipulation Language and is used to retrieve, insert, update, and delete data in a database. DML commands include SELECT, INSERT, UPDATE, and DELETE, which are commonly used in SQL queries and modifications.

C. HTML: This option is incorrect. HTML stands for Hypertext Markup Language and is used for creating the structure and presentation of web pages. HTML is not related to SQL query and modification commands.

D. XML: This option is incorrect. XML stands for Extensible Markup Language and is used for storing and transporting data. XML is not directly related to SQL query and modification commands.

The Answer is: B. DML

When three or more AND and OR conditions are combined, it is easier to use the SQL keyword(s

sql
  1. LIKE only.

  2. IN only.

  3. NOT IN only.

  4. Both IN and NOT IN.


Correct Option: D

The Microsoft Access wildcards are ____ and ____

sql
  1. asterisk (*); percent sign (%)

  2. percent sign (%); underscore (_)

  3. underscore(_); question mark (?)

  4. question mark (?); asterisk (*)


Correct Option: D

AI Explanation

To answer this question, you need to understand the concept of wildcards in Microsoft Access.

Wildcards are special characters that are used to represent unknown or variable values in a search pattern. They are used in queries to search for data that matches a specific pattern.

The correct answer is D) question mark (?); asterisk (*).

Option A) asterisk (); percent sign (%) - This option is incorrect because the asterisk () is used to represent any number of characters, while the percent sign (%) is used as a wildcard in SQL, but not in Microsoft Access. Option B) percent sign (%); underscore () - This option is incorrect because the percent sign (%) is used as a wildcard in SQL, but not in Microsoft Access. The underscore () is used as a wildcard in Microsoft Access, but it is not one of the wildcards mentioned in the correct answer. Option C) underscore (); question mark (?) - This option is incorrect because the underscore () is used as a wildcard in Microsoft Access, but it is not one of the wildcards mentioned in the correct answer. The question mark (?) is not a wildcard in Microsoft Access. Option D) question mark (?); asterisk () - This option is correct because the question mark (?) is used to represent a single character, and the asterisk () is used to represent any number of characters in a search pattern in Microsoft Access.

Therefore, the correct answer is D) question mark (?); asterisk (*).

Find the SQL statement below that is equal to the following: SELECT NAME FROM CUSTOMER WHERE STATE = 'VA';

sql
  1. SELECT NAME IN CUSTOMER WHERE STATE IN ('VA');

  2. SELECT NAME IN CUSTOMER WHERE STATE = 'VA';

  3. SELECT NAME IN CUSTOMER WHERE STATE = 'V'

  4. SELECT NAME FROM CUSTOMER WHERE STATE IN ('VA');


Correct Option: D

On UPDATE CASCADE ensures which of the following

sql
  1. Normalization

  2. Data Integrity

  3. Materialized Views

  4. All of the above


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Normalization - UPDATE CASCADE does not directly ensure normalization. Normalization is a process of organizing data in a database to eliminate redundancy and dependency. It helps in improving data integrity and reducing data anomalies, but UPDATE CASCADE itself does not enforce normalization rules.

Option B) Data Integrity - This option is correct because UPDATE CASCADE helps to maintain data integrity. When a foreign key relationship is defined with the UPDATE CASCADE option, it means that if a referenced row in the parent table is updated, the corresponding rows in the child tables will also be automatically updated. This ensures that the foreign key references remain valid and the data integrity is preserved.

Option C) Materialized Views - UPDATE CASCADE is not directly related to materialized views. Materialized views are precomputed views that store the results of complex queries and can be refreshed periodically. They are used to improve query performance. UPDATE CASCADE does not have any impact on materialized views.

Option D) All of the above - This option is incorrect because only option B (Data Integrity) is ensured by UPDATE CASCADE. Options A (Normalization) and C (Materialized Views) are not directly related to UPDATE CASCADE.

The correct answer is B. UPDATE CASCADE ensures data integrity by automatically updating the corresponding rows in child tables when a referenced row in the parent table is updated.

Which of the following statements is false?

sql
  1. Tables contain one or more rows

  2. Rows contain one or more database of information

  3. Databases contain one or more tables


Correct Option: B

AI Explanation

To answer this question, we need to understand the basic components of a database.

Option A) Tables contain one or more rows - This option is correct. In a database, a table is a collection of rows that represent individual records or entries.

Option B) Rows contain one or more database of information - This option is false. Rows in a table contain the actual data or information for each record or entry. They do not contain databases.

Option C) Databases contain one or more tables - This option is correct. A database is a collection of related data. It can contain one or more tables that are used to organize and store the data.

The correct answer is B) Rows contain one or more database of information. This option is false because rows in a table contain data, not databases.

Which portion of a database system contains the actual data elements, such as the name, address, or a phone number for a particular person?

sql
  1. Tables

  2. Columns

  3. Rows

  4. Databases


Correct Option: B
- Hide questions