Save
Database Management
SQL
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Spongebob
Visit profile
Cards (45)
What is the main focus of Chapter 7 in the book?
Introduction to
Structured Query Language
(
SQL
)
View source
What will students learn in this chapter about SQL?
Basic
commands
and
functions
of SQL
SQL for data administration (creating
tables
and
indexes
)
SQL for
data manipulation
(adding, modifying, deleting, retrieving data)
SQL for
querying databases
for useful information
View source
What are the two broad categories of SQL functions?
Data
definition
language and data manipulation language
View source
How many words does the basic SQL command set have?
Fewer than
100
words
View source
Who prescribes the standard SQL?
American National Standards Institute (
ANSI
)
View source
What is the purpose of the CREATE TABLE command in SQL?
To
create
a new
table
in the database
View source
What are the two tasks involved in creating a database?
Create database
structure
Create
tables
to hold end-user data
View source
What dictates the selection of data types in SQL?
Nature of data and
intended
use
View source
What are some supported data types in SQL?
Number
(L,D),
Integer
, Smallint,
Decimal
(L,D)
Char
(L),
Varchar
(L), Varchar2(L)
Date,
Time
,
Timestamp
Real
, Double, Float
Interval
day to hour
View source
What is the syntax for the CREATE TABLE command?
CREATE TABLE
tablename
( column1
data type
[
constraint
], ... );
View source
What does the NOT NULL specification ensure in a table?
Data entry
will be
made
and
not
left
empty
View source
What does the UNIQUE specification do in a table?
Creates a unique
index
to avoid duplicates
View source
What is the purpose of the PRIMARY KEY specification?
Enforces
entity integrity
requirements
View source
What does the ON UPDATE CASCADE specification ensure?
Changes in
VENDOR’s
V_CODE
apply to all references
View source
What are the SQL constraints mentioned in the material?
NOT NULL
: Ensures column does not accept nulls
UNIQUE
: Ensures all values in column are unique
DEFAULT
: Assigns value when a new row is added
CHECK
: Validates data when attribute value is entered
View source
What does the CHECK constraint validate in the CUSTOMER table?
Ensures
CUS_AREACODE
is within specified values
View source
What does the DEFAULT constraint do in the INVOICE table?
Assigns a default
date
to a new
invoice
View source
What are the basic data manipulation commands in SQL?
INSERT
SELECT
UPDATE
DELETE
COMMIT
ROLLBACK
View source
What is the purpose of the INSERT command?
To enter data into a
table
View source
What is the syntax for the INSERT command?
INSERT INTO
tablename
VALUES
(value1, ...);
View source
What must be done to save changes made to table contents?
Use the
COMMIT
command
View source
What does the SELECT command do?
Lists contents of a
table
View source
What is the syntax for the SELECT command?
SELECT
columnlist
FROM
tablename
;
View source
What does the UPDATE command do?
Modifies
data in a
table
View source
What is the syntax for the DELETE command?
DELETE FROM
tablename
[
WHERE
conditionlist];
View source
What does the ROLLBACK command do?
Undoes changes since last
COMMIT
View source
What is the purpose of the INSERT command with a SELECT subquery?
Inserts multiple
rows
from another table
View source
What can be used to fine-tune a SELECT command?
Conditional
restrictions,
arithmetic operators
,
logical operators
View source
What does the WHERE clause do in a SELECT statement?
Adds restrictions to rows included in
output
View source
What is the rule of precedence for arithmetic operators?
Operations within
parentheses
first
View source
What are the logical operators used in SQL?
AND
,
OR
, and
NOT
View source
What does the BETWEEN operator check?
Whether
attribute
value
is
within
a
range
View source
What does the EXISTS operator check?
If
subquery
returns any rows
View source
What are the options available with the ALTER command?
ADD
: Adds a column
MODIFY
: Changes column characteristics
DROP: Deletes a column
View source
What does the ALTER command do?
Makes
changes
in
table
structure
View source
What happens when you use ALTER to change a column's data type?
Some
RDBMSs
may not permit changes if column is not empty
View source
What does the ORDER BY clause do in a SELECT statement?
Sorts output by specified
columns
View source
What does the DISTINCT clause do in a SELECT statement?
Produces a list of
unique
values
View source
What does the COUNT function do in SQL?
Tallies number of non-null values of an
attribute
View source
What does the GROUP BY clause do in SQL?
Creates
frequency
distributions
View source
See all 45 cards