SQL Practice Test
To delete data from a table, which SQL statement is used?
Explanation:
In SQL, the TRUNCATE TABLE statement is a Data Definition Language operation that marks the extents of
a table for deallocation. The result of this operation quickly removes all data from a table, typically bypassing
a number of integrity enforcing mechanisms.
To update data in a database, which SQL statement is used?
Explanation:
The correct answer is
Update
How do you select all of the columns from the "Persons" table in SQL?
Explanation:
The correct answer is
SELECT * FROM Persons
How do you get a column called "FirstName" from a table called "Persons" in SQL?
Explanation:
The correct answer is
SELECT FirstName FROM Persons
To extract data from a database, which SQL statement is used?
Explanation:
The correct answer is
SELECT
(T/F) When AUTOCOMMIT is enabled, updates are made at the end of each SQL query automatically.
Explanation:
If autocommit mode is enabled, each SQL statement forms a single transaction on its own.
The AVG SQL function returns the following
Explanation:
SQL Server AVG () function is an aggregate function that returns the average value of a group.
What does a TRUNCATE TABLE do?
Explanation:
The SQL TRUNCATE TABLE command is used to delete complete data from an existing table. You can
also use DROP TABLE command to delete complete table but it would remove complete table structure
form the database and you would need to re-create this table once again if you wish you store some data.
The primary - foreign key relations are utilized to
Explanation:
Primary and foreign keys help create structure in relational databases. A primary key ensures unique row
identification. This results in faster sorting, searching, and querying operations. A foreign key creates a
link between two tables.
Which of the following statements about system information in an RDBMS is correct?
Explanation:
A relational database management system (RDBMS) is a program that allows you to create, update, and
administer a relational database. Most relational database management systems use the SQL language to
access the database.
Which of the following statements regarding embedded SQL is correct?
Explanation:
Embedded SQL is a method of combining the computing power of a programming language and the
database manipulation capabilities of SQL. Embedded SQL statements are SQL statements written
inline with the program source code, of the host language.
Table columns are also referred to as
Explanation:
The correct answer is
Fields
Which of the SQL commands below deletes all rows in the SalesData table?
Explanation:
The correct answer is
DELETE FROM SalesData
Which of the following statements regarding the CASE SQL statement is correct?
Explanation:
The SQL CASE Statement. The CASE statement goes through conditions and returns a value when the first
condition is met (like an if-then-else statement).
This form of database, which may be used to mine data for business patterns, does not require SQL queries and
instead allows users to ask questions like
"How many Aptivas have been sold in Nebraska this year?"
Explanation:
A multi-dimensional database is structured by a combination of data from various sources that work amongst
databases simultaneously and that offer networks, hierarchies, arrays, and other data formatting methods. In
a multidimensional database, the data is presented to its users through multidimensional arrays, and each
individual value of data is contained within a cell which can be accessed by multiple indexes.
IBM's cross-platform relational database management system is part of this family of products.
Explanation:
DB2 is a database product from IBM. It is a Relational Database Management System (RDBMS). DB2 is
designed to store, analyze and retrieve the data efficiently. DB2 product is extended with the support of
Object-Oriented features and non-relational structures with XML.
Which of the following is a group of formally-described tables from which data can be accessed or reassembled in a variety of ways without having to restructure the database tables?
Explanation:
A relational database is a collection of data items with pre-defined relationships between them. These items
are organized as a set of tables with columns and rows. Tables are used to hold information about the objects
to be represented in the database.
This is the process of organizing a database into tables in such a way that the database's results are always clear.
Explanation:
Normalization is the process of organizing data in a database. This includes creating tables and establishing
relationships between those tables according to rules designed both to protect the data and to make the
database more flexible by eliminating redundancy and inconsistent dependency.
This company was founded in 1977 with the goal of proving that the popular belief that relationship databases were not commercially viable was incorrect.
Explanation:
Oracle database is a relational database management system. It is also called OracleDB, or simply Oracle.
It is produced and marketed by Oracle Corporation. It was created in 1977 by Lawrence Ellison and other
engineers. It is one of the most popular relational database engines in the IT market for storing, organizing,
and retrieving data.
This phrase refers to the process of forecasting, or simply identifying patterns in data that can lead to future predictions.
Explanation:
Data mining is a process of extracting and discovering patterns in large data sets involving methods at the
intersection of machine learning, statistics, and database systems. Data mining is an interdisciplinary subfield
of computer science and statistics with an overall goal to extract information (with intelligent methods) from
a data set and transform the information into a comprehensible structure for further use.
Which of the following is a standard interactive and programming language for retrieving and changing data from a database?
Explanation:
SQL, or Structured Query Language is the set of instructions used to interact with databases. An
incredibly simple definition for such a complex subject. SQL is a special purpose programming
language designed for managing data stored in a relational database management system.
This word refers to a database that takes up terabytes of magnetic storage and has billions of table rows.
Explanation:
A very large database (VLDB) is a type of database that consists of a very high number of database records,
rows and entries, which are spanned across a wide file system. VLDB is similar to a standard database but
contains a very large amount of data. As such, it requires special management, maintenance and technologies
to operate.
This is a collection of data object descriptions provided for the convenience of programmers and others who may need to refer to them.
Explanation:
A Data Dictionary is a collection of names, definitions, and attributes about data elements that are being used
or captured in a database, information system, or part of a research project. It describes the meanings and
purposes of data elements within the context of a project, and provides guidance on interpretation, accepted
meanings and representation.
This is an open-source database access application programming interface (API).
Explanation:
Open Database Connectivity (ODBC) is an open standard application programming interface that allows
application programmers to access any database. The main proponent and supplier of ODBC programming
support is Microsoft, but ODBC is based on and closely aligned with The Open Group standard Structured
Query Language ( SQL ) Call-Level Interface (CLI).
Which of the following functions does not belong in the SQL Aggregate category?
Explanation:
COUNT() - returns the number of items in a set.
SUM() - returns the sum of all or distinct values in a set
AVG() - returns the average of a set.
ABS() - Acrylonitrile butadiene styrene