Professional Documents
Culture Documents
CSIS 115 Database Design and Applications For Business: Dr. Meg Fryling "Dr. Meg" Fall 2012
CSIS 115 Database Design and Applications For Business: Dr. Meg Fryling "Dr. Meg" Fall 2012
1-3
Misc.
• Lecture slides are available in Piazza under
‘Course Page > Resources > Lecture Notes’
• Review lecture slides in ‘Normal’ view instead of
‘Slide Show’ view
• Questions posted in Piazza are eligible for
participation credit!
• You may change your notification frequency to
daily digest (vs. every 4 hours)
– Click on your name (top right) then Account Settings
Let’s do some review from last
week
Get those clickers ready!
1-5
Microsoft Access uses which
type of database model?
a) Relational
b) Hierarchical
c) Object-Oriented
d) Object-Relational
e) XML
1-6
When was this DB model
invented?
a) 1960s
b) 1970s
c) 1980s
d) 1990s
e) 2000+
1-7
Who invented it?
a) E. F. Fryling
b) E. F. Moore
c) E. F. Ratliff
d) E. F. Smith
e) E. F. Codd
1-8
Microsoft Access includes…
A) a DBMS
B) an application generator
C) a Web server
D) A and B
E) A, B and C
1-10
A database stores…
A) data
B) relationships
C) Metadata
D) A and B
E) A, B and C
1-11
SQL Basics
In-Class Activity
Finish Part I Only
Open “SQL Basics.docx”
1-15
The SQL SELECT Statement
• The fundamental framework for SQL query
states is the SQL SELECT statement.
– SELECT {ColumnName(s)}
– FROM {TableName(s)}
• All SQL statements end with a semi-colon
(;).
1-19
Specifying Column Order
SELECT Buyer, Department
FROM SKU_DATA;
What do you notice about the data returned that’s kind of weird?
1-21
Modify Query…
1-22
Modify Query…
1-23
Selecting All Columns:
The Asterisk (*) Keyword
SELECT *
FROM SKU_DATA;
In-Class Activity
Part II
1-25
The WHERE Clause
• A query Must have SELECT and FROM
clauses
– Not a super interesting query though
• We can add a WHERE clause to restrict
the rows (records/tuples) that are returned
– Add conditions
1-26
The WHERE Clause
• SQL SELECT statement.
– SELECT {ColumnName(s)}
– FROM {TableName(s)}
– WHERE {Conditions};
1-27
SQL for Data Retrieval:
Comparison Criteria
• The WHERE clause match criteria may
include
– Equals “=“
– Not Equals “<>”
– Greater than “>”
– Less than “<“
– Greater than or Equal to “>=“
– Less than or Equal to “<=“
3-28
Modify Query…
1-29
Specific Rows from One Table
SELECT *
FROM SKU_DATA
WHERE Department = 'Water Sports';
NOTE: SQL wants a plain ASCII single quote: ' NOT ‘ !
1-31
Specific Columns and Rows from
One Table
SELECT SKU_Description, Buyer
FROM SKU_DATA
WHERE Department = 'Climbing';
SELECT *
FROM ORDER_ITEM;
1-34