Intro to SQL Flashcards
SQL can be used to:
create database structures and modify & query database data
Find the SQL statement below that is equal to the following: SELECT NAME FROM CUSTOMER WHERE STATE =’VA’;
SELECT NAME FROM CUSTOMER WHERE STATE IN (‘VA’);
A subquery in an SQL SELECT statement is enclosed in:
parenthesis – (…)
The SQL keyword(s) ______ is used with wildcards.
LIKE only
To define what columns should be displayed in an SQL SELECT statement:
use FROM to name the source table(s) and list the columns to be shown after SELECT
What does the HAVING clause do?
Acts like a WHERE clause but is used for groups rather than rows
In an SQL SELECT statement querying a single table, according to the SQL-92 standard the asterisk (*) means that:
All columns of the table are to be returned
A subquery in an SQL SELECT statement:
has a distinct form that cannot be duplicated by a join
Which of the following is valid SQL for an Index?
CREATE INDEX ID;
SQL is:
a data sublanguage
What is a view?
A virtual table that can be accessed via SQL commands
The SQL statement that queries or reads data from a table is ____.
SELECT
The result of a SQL SELECT statment is a(n) _____.
table
The SELECT command, with its various clauses, allows users to query the data contained in the tables and ask many different questions or ad hoc queries. T/F
True
To establish a range of values, can be used. T/F
True
Most companies keep at least two versions of any database they are using. T/F
True
If you are going to use a combination of of three or more AND and OR conditions, it is often easier to use the NOT and NOT IN operators.
True
SQL is a data sublanguage. T/F
True
The HAVING clause acts like a WHERE clause, but it identifies groups that meet a criterion, rather than rows. T/F
True
Indexes may be created or dropped at any t ime. T/F
True
SQL provides five built-in functions: COUNT, SUM, AVG, MAX, MIN. T/F
True
The keyword BETWEEN can be used in a WHERE clause to refer to a range of values. T/F
True
The qualifier DISTINCT must be used in an SQL statement when we want to eliminate duplicate rows. T/F
True
The format SELECT-FROM-WHERE is the fundamental framework of SQL SELECT statements. T/F
True
The result of every SQL query is a table. T/F
True
The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column. T/F
True
A dynamic view is one whose contents materialize when referenced. T/F
True
What is the correct order of keywords for SQL SELECT statements?
SELECT, FROM, WHERE
SQL data definition commands make up a(n) _______.
DDL
What is DDL?
Data Definition Language; deals with database schemas and descriptions of how the data should resides in the database
What are examples of DDL commands?
CREATE, ALTER, DROP, TRUNCATE, COMMENT, and RENAME
What is DML?
Data Manipulation Language; deals with data manipulation used to story, modify, retrieve, delete, and update data in database
What are examples of DML commands?
SELECT, INSERT, UPDATE, DELETE, MERGE, LOCK TABLE
What is the original purpose of SQL?
To specify the syntax and semantics of SQL manipulation language, to define the data structures, and to specify the syntax and semantics of SQL data definition language