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
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
sql
  1. asterisk (*); percent sign (%)

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

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

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


Correct Option: D
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.

- Hide questions