1.
What does SQL stands for?
Correct Answer
A. Structure query language
Explanation
SQL stands for Structured Query Language. It is a programming language used for managing and manipulating relational databases. SQL allows users to create, retrieve, update, and delete data from databases. It is widely used in database management systems and plays a crucial role in data analysis and reporting.
2.
What is the use of SQL?
Correct Answer
D. All of the above
Explanation
SQL (Structured Query Language) is a programming language used for managing and manipulating relational databases. It is used for various purposes such as storing data in databases, manipulating data by performing operations like inserting, updating, and deleting records, and retrieving data by querying the database using SELECT statements. Therefore, the correct answer is "All of the above" as SQL is used for all these purposes in database management.
3.
Which SQL statement is used to extract data from the database?
Correct Answer
A. SELECT
Explanation
The SELECT statement is used in SQL to extract or retrieve data from a database. It allows you to specify the columns and tables you want to retrieve data from, as well as any filters or conditions for the data. The SELECT statement is one of the fundamental and most commonly used statements in SQL for querying and retrieving data.
4.
Which SQL statement is used to return only different values?
Correct Answer
B. DISTINCT
Explanation
The correct answer is DISTINCT. The DISTINCT keyword is used in SQL to retrieve only unique values from a column or set of columns in a table. It eliminates duplicate values and returns a result set with distinct values. Therefore, the DISTINCT keyword is the appropriate SQL statement to use when you want to return only different values.
5.
Which of the right syntax for DISTINCT SQL statement?
Correct Answer
C. SELECT DISTINCT column1, column2, ... FROM table_name;
Explanation
The correct answer is "SELECT DISTINCT column1, column2, ... FROM table_name;". This is the correct syntax for using the DISTINCT keyword in an SQL statement. It allows you to retrieve unique values from the specified columns in the table_name.
6.
You can add a row using SQL in a database with which of the following?
Correct Answer
C. INSERT
Explanation
In SQL, the INSERT statement is used to add a new row or multiple rows into a table in a database. It allows you to specify the values for each column in the new row(s) being added. The INSERT statement is commonly used to add data into an existing table. Therefore, the correct answer is INSERT.
7.
The command to remove rows from a table 'CUSTOMER' is:
Correct Answer
C. DELETE FROM CUSTOMER WHERE
Explanation
The correct answer is "DELETE FROM CUSTOMER WHERE." This command is used to remove rows from a table called 'CUSTOMER' based on certain conditions specified in the WHERE clause. It allows for selective removal of rows, making it a suitable command for deleting specific data from the table.
8.
Which command is used to specify the number of records to return?
Correct Answer
B. SELECT TOP
Explanation
The command "SELECT TOP" is used to specify the number of records to return in a SQL query. It allows you to limit the result set to a specific number of rows, which can be useful when you only need a certain number of records from a large table. By using the "SELECT TOP" command, you can easily retrieve a specific number of records based on your requirements.
9.
The SQL WHERE clause?
Correct Answer
B. Limits the row data are returned
Explanation
The correct answer is "Limits the row data that are returned". The WHERE clause in SQL is used to filter rows based on specified conditions. It allows you to specify a condition that must be met for a row to be included in the result set. By using the WHERE clause, you can limit the rows that are returned from a table based on certain criteria, such as a specific column value or a combination of column values. Therefore, the WHERE clause limits the row data that is returned, not the column data.
10.
The wildcard in a WHERE clause is useful when?
Correct Answer
B. An exact match is not possible in a SELECT statement.
Explanation
The wildcard in a WHERE clause is useful when an exact match is not possible in a SELECT statement. The wildcard, represented by the "%" symbol in SQL, allows for pattern matching and searching for partial matches or unknown values in a column. It can be used with the LIKE operator to find records that match a specific pattern or contain a certain substring. This is especially helpful when searching for records that have similar characteristics but may not have an exact match in the database.
11.
Which command is used to insert a new records in the table?
Correct Answer
B. INSERT INTO
Explanation
The correct answer is "INSERT INTO". This command is used to insert new records into a table in a database. It allows you to specify the table name and the values that should be inserted into the corresponding columns. By using the "INSERT INTO" command, you can add new data to your table and expand your database with additional records.
12.
Which command is used to modify column name or table structure?
Correct Answer
D. ALTER
Explanation
The ALTER command is used to modify the column name or table structure in a database. It allows for changes to be made to the existing structure of a table, such as adding or deleting columns, modifying column data types, or renaming columns. This command provides flexibility in altering the structure of a table without having to recreate it entirely.
13.
Which command is used to change or update data in a table?
Correct Answer
C. UPDATE
Explanation
The correct answer is UPDATE. The UPDATE command is used to modify or change data in a table. It allows you to update specific columns or rows in the table based on specified conditions. This command is commonly used in SQL to make changes to existing data in a database table.
14.
Which keyword is used with UPDATE command to change the value?
Correct Answer
D. SET
Explanation
The keyword used with the UPDATE command to change the value is SET. This keyword is followed by the column name and the new value that we want to update in the database table. Using the SET keyword allows us to specify exactly which column we want to update and what value we want to change it to.
15.
Which keyword is used with ALTER command to delete a column?
Correct Answer
A. DROP
Explanation
The keyword used with the ALTER command to delete a column is DROP. This keyword is used to remove a specific column from a table in a database. Using the DROP keyword allows for the deletion of the column and all associated data within it.