JDATALAB
dbs guide
General Information
0.1
Course Description
0.2
Duration & Important Dates
0.3
Learning Outcomes
1
Required Books
1.1
Book
1.2
Book Resources
2
Quick Links & References
2.1
Book materials
2.2
Normalization
2.3
The Cape-codd Schema
2.3.1
The diagram with 6.3
2.3.2
The diagram with 8.0
2.3.3
MySQL INT(n)
2.3.4
MySQL DECIMAL
2.4
Prepare the cape_codd Database
Part 1 Setting up the Database Environment
3
Week 1
Part 2 Intro. & Database Query
4
Week 2
4.1
Learning Objectives
4.2
Task list
4.2.1
Read Chapter 1
4.2.2
Book review questions
4.2.3
Practice test
4.2.4
Class discussion
4.2.5
Review Questions Presentation & Test
5
Week 3
5.1
Learning Objectives
5.2
Practice Homework
5.3
Important Facts about SQL
Task list
5.4
Read Text Pages 59-60
5.5
(Monday)Run a test query
5.6
(Monday)Understand the cape_codd database
5.7
(Wednesday)The SQL SELECT/FROM/WHERE framework
5.7.1
(QUIZ)
5.7.2
(Hands-on)Run the queries on the slides 29-56
6
Week 3 Lab SQL Query Statements
The SELECT FROM Framework
6.1
slide #29
6.2
slide #30
6.3
slide #31
6.4
slide #32
6.5
slide #33
6.6
slide #34
The WHERE Clause
6.7
slide #35
The ORDER BY Clause
6.8
slide #36
6.9
slide #37
SQL Logical Operators
6.10
slide #38
6.11
slide #39
6.12
slide #40
6.13
slide #41
SQL Numerical Comparison Operators
6.14
slide #42
6.15
slide #43
SQL String Pattern Operator
6.16
slide #44, 45
6.17
slide #46
6.18
slide #47
SQL Built-in Functions:
6.19
slide #46
6.20
slide #51
6.21
Slide #52
6.22
Slide #53
SQL Arithmetic Operators in SELECT Clause
6.23
Slide #55
Other String functions: Concatenation, Length, TRIM
6.24
Slide #56
6.25
Slide #58
7
Week 4
7.1
Learning Objectives
Task list
7.1.1
Week 4 Monday:
7.1.2
Week 4 Wednesday:
7.1.3
Practice Homework:
8
Week 4 (Monday)
8.1
Sample Questions
8.2
Run Queries
8.3
DIY:
8.4
Having Clause
8.5
Where and Having
9
Week 4 (Wednesday)
9.1
Sample Query
9.2
Subquery Workout 1
9.3
Subquery Workout 2
10
Week 5
10.1
Learning Objectives
10.2
Task list
10.2.1
Monday:
10.2.2
Wednesday:
10.3
Implict JOIN
10.4
JOIN ON
10.4.1
Explicit join by the keywords JOIN and ON
10.4.2
Combine JOIN ON and WHERE
10.4.3
Example
10.4.4
Workout
10.5
Outer JOIN
10.6
Set Operators
10.6.1
SQL Set Keywords
10.6.2
UNION
Exam 1
11
Week 6
Part 2 Database Design
12
Week 7
12.1
KEY POINTS
12.2
Learning Objectives
12.3
Learning outcomes
12.4
Exercises
12.5
Wedneday
13
Week 8
13.1
KEY POINTS
13.2
Wedneday
14
Week 9
14.1
KEY POINTS
14.2
Design Patterns
14.3
Assignment
15
Week 10
15.1
Transformation
15.2
Actions
15.3
View Ridge Gallery Data Model
15.4
Assignment
16
Week 11-1
16.1
VRG Model
16.2
CREATE and DROP SCHEMA
16.3
Order of Creating Tables
16.4
CREATE and DROP TABLE
16.4.1
DROP TABLE
16.4.2
TRUNCATE Table
16.5
Create ARTIST Table
16.5.1
Create Table
16.5.2
Run Reverse Engineer
16.5.3
(not run) INSERT INTO ARTIST
16.6
Create the CUSTOMER Table
16.6.1
(not run) Insert INTO Customer
16.7
Create WORK Table with FK Constraint
16.7.1
Create the WORK table with FK
16.7.2
Run Reverse Engineer
16.8
Create CUSTOMER_ARTIST_INT with FKs
16.8.1
Run Reverse Engineer
16.9
Create TRANS and its Constraints
16.9.1
Create Trans without constraints
16.9.2
Constraints with ALTER TABLE
16.9.3
Primary Key
16.9.4
Two foreign keys
16.9.5
Check if SalesPrice is between 0 and 500,000
16.9.6
Check if DateAcquired is less than DateSold
16.10
Run Reverse Engineer
16.11
Add/Drop a Table Column
16.12
Character Set Encoding
17
Week 11-2
17.1
INSERT Data
17.1.1
INSERT INTO & DELETE FROM
17.1.2
INSERT MULTIPLE ROWS IN ONE STATEMENT
17.1.3
ENCRYPT IN
CUSTOMER TABLE
17.1.4
Insert a new interest between a customer and an artist
17.2
Populate VRG Database
17.2.1
Populate CUSTOMER Table
17.2.2
Populate ARTIST Table
17.2.3
Populate CUSTOMER_ARTIST_INT Table
17.2.4
Populate WORK Table
17.2.5
Populate TRANS Table
18
Week 11-3
18.1
E1
18.2
E2
18.3
E3
18.4
E4
18.5
E5
Exam 2
19
Week 12
19.1
UPDATE Rows
19.2
VIEW
19.2.1
DROP VIEW
19.2.2
CREATE VIEW
19.2.3
Generate a report from VIEW
19.2.4
Export the Report to CSV
19.2.5
ALTER VIEW
19.2.6
Combine Columns
19.2.7
Use JOIN in View
19.2.8
Exercise
19.3
TRIGGER
19.3.1
Overview
19.3.2
Use
19.3.3
Syntax
19.3.4
Prefixing
19.3.5
Provide Default Values
19.3.6
TODO-Provide Default with simple expressions
Appendix
A
Appendix 1
B
Appendix 2
References
2017-2019 jDataLab
JDATALAB | DBS Guide
6.23
Slide #55
/* slide#55 COUNT distinct rows */
SELECT
quantity * price
AS
EP, extendedprice
FROM
ORDER_ITEM ;
TABLE6.29:
7 records
EP
extendedprice
300
300
200
200
100
100
100
100
50
50
300
300
130
130