SQL Class
What is used in SQL statements to retrieve all data rows?
*
What is a built-in function?
A pre-defined program like =SUM in Excel.
What is a subquery?
A query inside a query
Query
A request for information from a database table or tables.
What is a view considered?
A virtual table that does not store data.
What statement is used to drop a column from a table?
ALTER TABLE
What is the difference in the AND and the OR conditional operators used in filtering statements?
AND both sides have to be True; OR only one side is True.
What does the UPDATE...SET statement do?
Adds or modifies data in a column.
Where is the filter statement written in the query?
After the JOIN condition
What SQL query statement is used to create a constraint on an existing table?
Alter Table
What is a base table?
An underlying table where data is saved.
All SQL result-sets will be in blank_________ order as the default sort order.
Ascending
What is an aggregate function?
Built-In Function
What aggregate functions, when in the same query, are used for comparison purposes?
COUNT, MIN, MAX, AVG
What SQL query statement is used to design an index for a database table?
CREATE INDEX
The ________________ command is used to define and make a view.
CREATE VIEW
What command is used to modify a view?
CREATE or ALTER View
Without the ___________ in the INSERT INTO statement, the __________ must be in the right order.
Column List; Value List
( _____________) VALUES (___________) is the second part of this SQL statement.
Column list, value list
The column list definition includes the ________, ________, and ______.
Column name, data type, data size
The WHERE clause is a blank______________ that must be met.
Conditional Statement
A(n) ____________ is a defined rule on the data in a table.
Constraint
How often should database maintenance be performed?
Continuously
What SQL query statement is used to remove an index from a database table?
DROP INDEX
What does the SQL subquery written in the WHERE clause provide?
Data result-set to use as criteria in the outer query.
Data Redundancy
Data that is duplicated in the database. This should be minimized by the design of the tables.
Relational Database Management System (RDBMS)
Database management system designed specifically for relational databases.
What command is used to delete a view?
Drop View
It is __________ to add multiple data rows at one time.
Easy
The blank______________ key creates the relationship between tables.
Foreign
A blank_____________ of one table is related to the blank___________ of another table.
Foreign Key; Primary Key
The __________ of the one table is related to the __________ of the other table.
Foreign Key; Primary Key
Table relationships are considered ____________ in the RDBMS design.
Foundational
The __________________ tablename is the statement used for adding rows to a table.
INSERT INTO
What SQL query statement is used to test a constraint to ensure it is working correctly?
INSERT INTO
A(n) ____________ is defined to help the query process performance.
Index
A database collects data to be transformed into blank_____________ for making decisions.
Information
Which of the following is a numeric data type?
Int
Data blank_________ is enforced by using PKs and FKs in designing the relational database.
Integrity
What does data quality mean?
Integrity, accuracy, and consistency.
What is the purpose of an aggregate function?
It calculates data rows and values for analytical purposes.
Why is database access important?
It limits access to just authorized users.
What does adding a filter to the aggregate function do?
It limits the rows that are calculated.
Why is data integrity important in the database?
It means the data is honest, correct, and always reliable.
A subquery can be used in place of a blank__________ statement.
JOIN
What clause is used to combine rows from two or more tables?
JOIN Clause
Which of the following is the correct JOIN statement in a query?
JOIN Table2 ON Table1.pk = Table2.FK
The ORDER BY clause will be the blank_____ statement in the SQL query.
Last
A table relationship is created to __________ two columns in the tables.
Link
What aggregate functions don't add, average, or count data rows or values?
MIN, MAX
Which of the following is an example of a RDBMS?
MS SQL Server
The PK columns will be automatically set to what constraint?
NOT NULL
The blank____________ SQL clause is used to specify a sort order.
ORDER BY
Which of the following is the statement that sorts by the city column in ascending and then the last name column in descending order?
ORDER BY City, LastName DESC
A basic SELECT aggregate function, without adding other statements, will return ________ value(s). A
One
A query can retrieve blank____________ data columns.
One or All
A data script is ________ to add multiple rows.
One way
To create the relationship, a ________ in the first table is related to the _______ in the second table.
PK;FK
Which of the following is an example of a database of collected related data that is organized and easily accessible?
Phone Book
The blank_______________ key is unique and one-of-a-kind.
Primary
Structured Query Language (SQL)
Pronounced "sequel" or S-Q-L; it is the standard database management language that communicates with a relational database.
The SSMS is used to ________, ________, and ________ the database.
Query, Design, Manage
What is used to connect two tables?
Related Columns
The subquery is usually a ___________ statement embedded in another query.
SELECT
Which of the following is a keyword that begins a query statement written to retrieve data?
SELECT
After a view is created, which command is used to see the view?
SELECT * FROM view_name
What aggregate function statement will return how many rows there are?
SELECT COUNT(*)
In what statement is a conditional operator used?
SELECT column statement
What do relational database management systems use to create, access, and manage data?
SQL
String data requires blank_____________ when being entered in the data row.
Single Quotes
The column list is blank_____________ required in the INSERT row structure.
Sometimes
SQL Server's primary purpose is to blank______________ used by other applications.
Store and Retrieve Data
The SQL blank__________ defines rules and guidelines to follow when writing SQL queries.
Syntax
What completes the CREATE blank____________ tablename (column list definition) SQL statement?
TABLE
When you JOIN tables with a filter, will it affect table2?
Table 1, then table 2
INSERT INTO ____________ is the first part of this SQL statement.
Table name
When you start to write a query, use blank______________ to ensure the result-set returns what is needed.
The Defined Requirements
Foreign Key (FK)
The FOREIGN KEY is a key that is used to connect two tables. The FOREIGN KEY is a column or columns in one table that refers to the PRIMARY KEY column in another table.
Data Integrity
The assurance of the accuracy and consistency of the data.
Relationship
The link that connects relational database tables.
Primary Key (PK)
The primary key is a column or columns that uniquely identifies each row in the table. It cannot be left blank.
What is the result-set of an INNER JOIN clause and a JOIN clause when executed?
The same result-set
What is the ALTER TABLE SQL statement used for in a query?
To add, delete, or modify columns on existing databases.
What are CHECK and DEFAULT constraints used for?
To ensure data integrity rules are followed.
For what SQL maintenance query statement is it critical to have a filter clause?
UPDATE, DELETE
What is database maintenance?
Updating, deleting, and adding data and modifying the database structure when appropriate.
Which of the following describes the data to be inserted into the table?
VALUES
Why are views important?
Views limit data access and secure the data.
What does an inner subquery look like?
WHERE CId NOT IN (SELECT CustID FROM Customer)
Which of the following is the SELECT statement to filter and sort by the CITY = 'Dalton' column?
WHERE City = 'Dalton' ORDER BY City
To limit the data columns, the blank_____________ can be in any order.
WHERE clause
What does a subquery with an ORDER BY look like?
WHERE... (SELECT CID FROM Customer) ORDER BY City