1.
The DBMS acts as an interface between what two components of an enterprise-class database system?
Correct Answer
A. Database application and the database
Explanation
The DBMS acts as an interface between the database application and the database. The database application is responsible for interacting with the user and performing various operations on the database. The DBMS provides a layer of abstraction between the application and the database, allowing the application to access and manipulate the data stored in the database without having to worry about the underlying data structures and storage mechanisms. The DBMS also ensures data integrity, security, and concurrency control, making it a crucial component of an enterprise-class database system.
2.
An application where only one user accesses the database at a given time is an example ofa(n)?
Correct Answer
A. Single-user database application
Explanation
A single-user database application refers to an application where only one user can access the database at a given time. This means that the database is designed to handle the needs of a single user, and it is not intended to support multiple users accessing the database simultaneously. In such applications, the database can be accessed and modified by only one user at a time, ensuring data integrity and avoiding conflicts that may arise when multiple users try to access or modify the same data concurrently.
3.
SQL stands for
Correct Answer
A. Structured Query Language
Explanation
SQL stands for Structured Query Language. It is a programming language that is used to manage and manipulate relational databases. SQL allows users to define, retrieve, and manipulate data in a database. It is a standardized language that is widely used in the field of database management systems.
4.
You have run SQL statement that asked the DBMS to display data in a table named USER_TABLES. The results include columns of data labeled “TableName,” “NumberofColumns” and “PrimaryKey.” You are looking at
Correct Answer
B. Metadata
Explanation
The correct answer is "metadata" because the table named USER_TABLES is a system table that stores metadata about all the tables in the database. The columns "TableName," "NumberofColumns," and "PrimaryKey" provide information about the tables in the database, such as their names, the number of columns they have, and whether they have a primary key defined or not. Therefore, the results of the SQL statement are displaying metadata about the tables in the database.
5.
Which of the following is not considered to be a basic element of an enterprise-class database system?
Correct Answer
D. COBOL programs
Explanation
COBOL programs are not considered to be a basic element of an enterprise-class database system. COBOL is a programming language that was commonly used in the past for business applications, including data processing. However, in modern enterprise-class database systems, COBOL programs are not a fundamental component. Instead, the basic elements typically include users, database applications, and the database management system (DBMS). These components work together to provide functionality and manage data within the database system.
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 ADD, CREATE, and MAKE keywords are not used for adding rows in SQL databases. ADD is used to add a column to an existing table, CREATE is used to create a new table, and MAKE does not exist as a keyword in SQL. Therefore, the correct keyword to add a row in SQL 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 is because the DELETE command is used to remove rows from a table, and the WHERE clause is used to specify the condition that determines which rows should be deleted. Therefore, the correct syntax to remove rows from the "Customer" table is to use the DELETE FROM CUSTOMER WHERE... statement.
8.
The SQL WHERE clause:
Correct Answer
B. Limits the row data are returned
Explanation
The SQL WHERE clause is used to filter rows based on a specified condition. It allows you to specify a condition that must be met for a row to be included in the result set. Therefore, the correct answer is "limits the row data that are returned." The WHERE clause does not have any effect on the columns that are returned, only on the rows.
9.
Which of the following is the original purpose of SQL?
Correct Answer
D. All of the above
Explanation
The original purpose of SQL was to specify the syntax and semantics of both the SQL data definition language and the SQL manipulation language. Additionally, SQL was also designed to define the data structures used in databases. Therefore, the correct answer is "All of the above" as all three options accurately describe the original purpose of SQL.
10.
The wildcard is 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. This means that when we want to search for records that partially match a specific criteria or have unknown values, we can use wildcards such as "%" or "_" to represent unknown characters or patterns in the search. This allows for more flexible and broader searches in the database, where exact matches may not be possible or necessary.
11.
A view is which of the following?
Correct Answer
A. A virtual table that can be accessed via SQL commands.
Explanation
A view is a virtual table that can be accessed via SQL commands. It is a logical representation of data from one or more tables in a database. Views are created by querying the underlying tables and can be used to simplify complex queries, provide security by restricting access to certain columns or rows, and present data in a different format or with calculated values. Users can interact with views just like they would with regular tables, querying, updating, or deleting data using SQL commands.
12.
SQL data definition commands make up a(n)
Correct Answer
A. DDL
Explanation
SQL data definition commands make up a DDL (Data Definition Language). DDL is a set of SQL commands used to define and manage the structure of a database. It includes commands such as CREATE, ALTER, and DROP, which are used to create, modify, and delete database objects like tables, views, and indexes. DDL commands are used to define the schema of a database and specify the data types, constraints, and relationships between the tables. DDL is different from DML (Data Manipulation Language), which is used to retrieve, insert, update, and delete data from a database.
13.
Which of the following is the correct order of keywords for SQL SELECT statements?
Correct Answer
A. SELECT, FROM, WHERE
Explanation
The correct order of keywords for SQL SELECT statements is SELECT, FROM, WHERE. This is because the SELECT keyword is used to specify the columns to retrieve, the FROM keyword is used to specify the table from which to retrieve the data, and the WHERE keyword is used to specify the conditions for retrieving the data.
14.
A subquery in an SQL SELECT statement is enclosed in:
Correct Answer
C. Parenthesis -- (...).
Explanation
A subquery in an SQL SELECT statement is enclosed in parenthesis. This is because the subquery is used as a separate query within the main query, and the parenthesis help to clearly separate and define the subquery. The use of parenthesis also helps in maintaining the logical structure of the SQL statement and ensures proper execution of the subquery.
15.
The result of a SQL SELECT statement is a(n)
Correct Answer
D. Table
Explanation
The result of a SQL SELECT statement is a table. When a SELECT statement is executed in SQL, it retrieves data from one or more database tables and returns the result as a table-like structure. This table consists of rows and columns, where each row represents a record and each column represents a field or attribute of the record. The table can be further manipulated or used for analysis by applying additional SQL operations or queries.
16.
Which of the following are the five built-in functions provided by SQL?
Correct Answer
A. COUNT, SUM, AVG, MAX, MIN
Explanation
The correct answer is COUNT, SUM, AVG, MAX, MIN. These are the five built-in functions provided by SQL. COUNT is used to count the number of rows in a table, SUM is used to calculate the sum of a column, AVG is used to calculate the average of a column, MAX is used to find the maximum value in a column, and MIN is used to find the minimum value in a column. These functions are commonly used in SQL queries to perform calculations and retrieve specific data from a database.
17.
The HAVING clause does which of the following?
Correct Answer
A. Acts like a WHERE clause but is used for groups rather than rows.
Explanation
The HAVING clause is used to filter the results of a GROUP BY query based on a condition that applies to groups, rather than individual rows. It is similar to the WHERE clause, but while the WHERE clause filters rows before they are grouped, the HAVING clause filters groups after they have been formed. Therefore, the correct answer is "Acts like a WHERE clause but is used for groups rather than rows."
18.
The SQL-92 wildcards are
Correct Answer
B. Percent sign(%); underscore(_)
Explanation
The SQL-92 wildcards are the percent sign (%) and the underscore (_). These wildcards are used in SQL queries to represent any sequence of characters or a single character, respectively. The percent sign represents zero or more characters, while the underscore represents exactly one character. These wildcards are useful when searching for patterns or matching specific criteria in a database query.
19.
To remove duplicate rows from the results of an SQL select statement, the ___qualifier specified must be included.
Correct Answer
C. DISTINCT
Explanation
To remove duplicate rows from the results of an SQL select statement, the DISTINCT qualifier specified must be included. The DISTINCT keyword is used in the SELECT statement to retrieve only unique values from a column or a combination of columns. It eliminates duplicate rows and returns only distinct rows in the result set. By including the DISTINCT qualifier, the query will filter out any duplicate rows and display only unique rows in the output.
20.
SQL query and modification commands make up a(n)
Correct Answer
B. DML
Explanation
The correct answer is DML, which stands for Data Manipulation Language. DML is a subset of SQL that includes commands like SELECT, INSERT, UPDATE, and DELETE. These commands are used to manipulate data stored in a database, such as retrieving data, inserting new records, updating existing records, and deleting records. DDL, on the other hand, stands for Data Definition Language and includes commands for creating, altering, and dropping database objects like tables, indexes, and views. HTML and XML are markup languages used for creating web pages and storing data, respectively, and are not directly related to SQL queries and modifications.
21.
Find the SQL statement below that is equal to the following:SELECT NAME FROM CUSTOMER WHERE STATE = 'VA';
Correct Answer
D. SELECT NAME FROM CUSTOMER WHERE STATE IN ('VA');
Explanation
The correct answer is "SELECT NAME FROM CUSTOMER WHERE STATE IN ('VA');". This statement retrieves the names of customers from the "CUSTOMER" table where the state is equal to 'VA'. The "IN" keyword is used to specify multiple values for the "STATE" column, and in this case, it is only a single value ('VA').
22.
Which of the following sorts rows in SQL?
Correct Answer
C. ORDER BY
Explanation
ORDER BY is used in SQL to sort the rows in a result set based on one or more columns. It arranges the rows in ascending or descending order, depending on the specified criteria. This allows for easier data analysis and retrieval, as the desired order can be specified in the query. SORT BY, ALIGN BY, and GROUP BY are not valid SQL keywords for sorting rows.
23.
To define what columns should be displayed in an SQL SELECT statement:
Correct Answer
A. Use FROM to name the source table(s) and list the columns to be shown after SELECT.
Explanation
The correct answer is to use FROM to name the source table(s) and list the columns to be shown after SELECT. This is because in an SQL SELECT statement, the FROM clause is used to specify the table(s) from which the data is being retrieved. The SELECT clause is then used to list the columns that should be displayed in the result set.
24.
The SQL statement that queries or reads data from a table is
Correct Answer
A. SELECT
Explanation
The correct answer is "SELECT" because in SQL, the SELECT statement is used to retrieve data from a database table. It allows you to specify the columns you want to retrieve and the conditions for filtering the data. The SELECT statement is one of the most commonly used SQL statements and is essential for querying and retrieving data from a table.
25.
The SQL keyword BETWEEN in used:
Correct Answer
A. For ranges.
Explanation
The SQL keyword BETWEEN is used for ranges. It allows you to specify a range of values to be included in a query result. It is commonly used in conjunction with the WHERE clause to filter data within a specific range. For example, you can use BETWEEN to retrieve all records where a certain column value falls within a specified range of values.
26.
___ was adopted as a national standard by ANSI in 1992
Correct Answer
B. SQL
Explanation
SQL (Structured Query Language) was adopted as a national standard by ANSI (American National Standards Institute) in 1992. SQL is a programming language used for managing and manipulating relational databases. Its adoption as a national standard by ANSI signifies its widespread acceptance and recognition in the industry. This standardization ensures consistency and compatibility across different database systems and allows developers to write SQL code that can be executed on various platforms.
27.
What type of join is needed when you wish to include rows that do not have matching values?
Correct Answer
C. Outer join
Explanation
An outer join is needed when you wish to include rows that do not have matching values. Unlike an equi-join or a natural join, which only include rows with matching values, an outer join includes all the rows from one table and the matching rows from the other table. If there is no match, null values are included for the columns of the table that does not have a matching row. Therefore, an outer join is the correct type of join to use in this scenario.
28.
The following SQL is which type of join:SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM, CUSTOMER_T, ORDER_T.CUSTOMER_ID=ORDER_T.CUSTOMER_ID
Correct Answer
A. Equi-join
Explanation
The given SQL statement is an example of an equi-join. This is because it uses the "=" operator to join the CUSTOMER_T and ORDER_T tables on the CUSTOMER_ID column. In an equi-join, the join condition is based on the equality of values in the specified columns, resulting in the combination of rows from both tables that have matching values.
29.
Which of the following statements is true concerning subqueries?
Correct Answer
A. Involves the use of an inner and outer query.
Explanation
Subqueries involve the use of an inner and outer query. A subquery is a query that is nested within another query, where the result of the inner query is used in the outer query. This allows for more complex and specific queries to be performed. By using an inner and outer query, data can be filtered, sorted, or aggregated based on the result of the subquery. Therefore, the statement that "Involves the use of an inner and outer query" is true.
30.
Which SQL statement is used to update data in a database?
Correct Answer
B. UPDATE
Explanation
The correct answer is UPDATE. The UPDATE statement is used in SQL to modify or update existing data in a database. It allows users to change the values of specific columns in one or more rows of a table. This statement is essential for making changes to the data stored in a database, such as updating records, correcting errors, or implementing new information.
31.
Which SQL statement us used in insert new data in a database?
Correct Answer
B. INSERT INTO
Explanation
The correct answer is INSERT INTO. This SQL statement is used to insert new data into a database. It allows you to specify the table name and the values that you want to insert into the table. It is a commonly used statement in SQL for adding new records to a database.
32.
With SQL, how do you select a column named “FirstName” from a table named “Persons”?
Correct Answer
A. SELECT FirstName FROM Persons
Explanation
The correct answer is "SELECT FirstName FROM Persons". This is the correct SQL syntax to select a column named "FirstName" from a table named "Persons". The SELECT statement is used to retrieve data from a database, and in this case, it specifies the column "FirstName" that should be selected from the table "Persons".
33.
With SQL, how do you select a column named “FirstName” from a table named “Persons”?
Correct Answer
C. SELECT * FROM Persons
Explanation
The correct answer is "SELECT * FROM Persons". This is the correct SQL syntax to select all columns from the "Persons" table. The "*" symbol is used to represent all columns, and the "FROM" keyword is used to specify the table name.
34.
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” is “Peter”?
Correct Answer
B. SELECT*FROM Persons WHERE FirstName='Peter'
Explanation
The correct answer is "SELECT*FROM Persons WHERE FirstName='Peter'". This SQL query selects all records from the table named "Persons" where the value of the column "FirstName" is "Peter". The asterisk (*) represents all columns in the table, and the WHERE clause filters the results based on the specified condition.
35.
With SQL, how do you select all the records from a table named “Persons where the “FirstName” is “Peter” and the “LastName” is “Jackson”?
Correct Answer
C. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
Explanation
The correct answer is "SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'". This query uses the SELECT statement to retrieve all columns ("*") from the table named "Persons" where the "FirstName" column is equal to "Peter" and the "LastName" column is equal to "Jackson".
36.
With SQL, how can you return all the records from a table named “Person” sorted descending by “FirstName”?
Correct Answer
B. SELECT * FROM Persons ORDER BY FirstName DESC
Explanation
The correct answer is "SELECT * FROM Persons ORDER BY FirstName DESC". This query uses the ORDER BY clause in SQL to sort the records in the "Person" table in descending order based on the "FirstName" column. The "*" symbol is used to select all columns from the table.
37.
With SQL, how can you insert a new record into the “Persons” table?
Correct Answer
B. INSERT INTO Person VALUES ('Jimmy', 'Jackson')
Explanation
The correct answer is "INSERT INTO Person VALUES ('Jimmy', 'Jackson')". This is the correct syntax for inserting a new record into the "Persons" table in SQL. The keyword "INSERT" is used to specify that a new record is being inserted, followed by the keyword "INTO" to specify the table name. The keyword "VALUES" is used to specify the values that will be inserted into the table, in this case 'Jimmy' and 'Jackson'.
38.
With SQL, how can you delete the records where the “FirstName” is “Peter” in the Persons Table?
Correct Answer
A. DELETE FROM Persons WHERE FirstName = 'Peter'
Explanation
The correct answer is "DELETE FROM Persons WHERE FirstName = 'Peter'". This SQL statement uses the DELETE command to remove records from the "Persons" table where the "FirstName" column has the value "Peter". This statement follows the syntax of the DELETE command and specifies the table name "Persons" and the condition "FirstName = 'Peter'" to identify the records to be deleted.
39.
With SQL, how can you return the number of records in the “Persons” table?
Correct Answer
A. SELECT COUNT(*) FROM Persons
Explanation
The correct answer is "SELECT COUNT(*) FROM Persons". This query uses the COUNT() function in SQL to return the number of records in the "Persons" table. The asterisk (*) inside the COUNT function is a wildcard that represents all columns in the table, so it counts all the records regardless of the specific columns.
40.
In a database, student registration information is stored as a C++ structure. This information is at
Correct Answer
C. Internal level
Explanation
The student registration information being stored as a C++ structure suggests that it is at the internal level of the database. The internal level deals with the physical representation of data in the database system, including how it is stored and accessed. Storing the information as a C++ structure indicates that it is being stored in a specific format and organization that is optimized for efficient storage and retrieval within the database system.