Logo courtesy Wordclouds.com
California State University Stanislaus
CS 4250: Database Management Systems
3:00 - 3:50 pm, M W F, Science 137, Dr. Megan Thomas
Welcome to CS4250, an introduction to database management systems.
Modeling, development, and implementation of database systems using storage structures,
data definition languages, and data manipulation languages for the relational approach
to database management. Database integrity and security problems. Historical development
of database systems.
Prerequisite: CS 3100.
Announcements and Upcoming Events
||One reason why you should be doing backups: "City Pays $2K in Ransomware, Stirs 'Never Pay' Debate" (threatpost.com, Oct 23, 2018)
Here is one small chunk and
here is a second chunk of the midterm
you will take on Friday.
Earthquake (qname, date, latitude, longitude, magnitude, fault)
Damage(cityID, qname, cost, liveslost)
Cities(cID, cname, latitude, longitude, population) [city names may not be unique]
Questions (in SQL, and relational algebra where possible):
The slides contain these questions, but this might be more readable.
- Find the names and dates of earthquakes whose magnitude was greater than 7.0.
- Find the average population of cities whose names start with "San".
- List the lives lost, quake names and city names for all quakes that occurred before 1960.
- Find the names of earthquakes that have occurred in cities with a bigger population than that of some city named Vancouver. (Query should be written so can "swap in" name of a different city easily.)
- List the city names and total cost, per city, of all quakes with magnitude greater than 7.0.
- List the average magnitude of quakes for each fault (grouped by fault).
- List all earthquakes and, where applicable, also list city names and lives lost in that city for quakes that affected cities.
- List the names of cities whose populations are greater than the average city population.
To help students practice SQL syntax, you may log in (using SSH or a similar tool) to hopper.csustan.edu and use your local MySQL account to try SQL queries at the MySQL command line.
After you log in to hopper, then
That will set up sample Doctor, Patient and Department tables, with schemas like in Hwk 2.(Note: for simplification, no foreign keys are set up. And real data is likely to have many more duplicates in human name fields, which a good DBA would think about carefully when writing queries.)
- start the MySQL command line (#2 on the account paper you are given)
- copy and paste the text from createHW2tables.txt into the MySQL prompt
- then download and edit loadHW2data.txt so that it refers to whatever location you plan to put the files of sample data (you may need to edit on your local machine, then copy the file onto hopper.csustan.edu
- put doctor.txt, patient.txt, department.txt at the location you specified in loadHW2data.txt
- then copy and paste the text from loadHW2data.txt into the MySQL prompt
The counseling center is offering some interesting workshops this semester, on topics like succeeding (and stuff) as a first generation college student, wellness, mindfulness, anxiety, etc, etc. Check them out!
Stress Management workshop on 9/19!
|| LinkedIn August 2018 Workforce Report -- what skills are employers looking for? How is hiring going? Interesting quotation: "Demand for data scientists is off the charts"
|| Welcome to CS 4250!
At the CSU Stanislaus library:
- Database Systems: The Complete Book by Garcia-Molina, Ullman and Widom,
three extremely well-respected database researchers and professors at Stanford University.
- Database Management Systems by Raghu Ramakrishnan and Johannes Gherke,
excellent, systems-oriented introduction to the field of database management.
- Database Tuning by Dennis Sasha and Philippe Bonet. A clear
presentation of how database design decisions impact database performance.
Also discusses IBM, Oracle and Microsoft systems and how design choices can impact them.
- MySQL and mSQL by Randy Yarger.
- MySQL by Paul DuBois (electronic).
- Readings in Database Systems by M. Stonebraker. A collection of
influential papers in DBMS research history.
The Ramakrishnan and Garcia-Molina/Ullman/Widom textbooks are both
available at the university library.
CSU Stanislaus Dreamers: Resources
for AB540 and undocumented students
- IBM's DB2, etc
- Microsoft SQL Server
'cd' (Unix/Mac) or 'chdir' (Windows/ Command Prompt) your command line window into
whatever folder you put the files you downloaded and unzipped, and type ./sqlite3
(Unix/Mac) or .\sqlite3 (Windows) and the SQLite command line tool should start up.
- I've put the start-up file of SQL commands here.
I usually copy-and-paste the ch5-demo.sql file's contents into the sqlite3 command
prompt. (There is an import command, but it has occasionally behaved oddly for me.)
- Basic instructions for the command line SQLite are here.
- SQL for Web Nerds by Philip
Greenspun, a free, on-line only database textbook with a focus on Oracle DBMSs
- SQLFiddle.com appears to be a web site
that allows uers to "fiddle around" with SQL.
- JDBC Tutorial,
courtesy Jeff Ullman
- JDBC Tutorial,
- Execute PHP
MySQL On-line, a PHP testing facility provided by http://www.tutorialspoint.com/
- XML Tutorial, courtesy w3schools.com
- XML Tutorial, courtesy zvon.com
- Phlonx's Third Normal Form Tutorial,
with numerous illustrative diagrams
- Lynda.com's databases-related courses --
all videos. You would need to authenticate yourself as a CSU Stanislaus student to
view the videos.
- XKCD on SQL
- "Hard drive teardown", EngineerGuy video
Fun News Items
- "Looking for a tech job? These 8 industries pay the most" (TechRepublic, Feb 2018) (Beware annoying auto-play video at the top of the page.)
- "https://www.fastcompany.com/40420383/i-review-thousands-of-resumes-heres-what-im-really-looking-for" (Fast Company, May 2017)
- "Software Engineering Jobs Dominate List of Best Careers for 2017" (IEEE Spectrum, 22 March 2017)
- "Data Scientist, DevOps Engineer and DBA Among Top IT Jobs for 2017" (Datamation.com, Jan 2017)
Center Love: Tech Chiefs Show Off the Gear That Keeps Everything Humming"
by CIO Journal Staff, of the Wall Street Journal, on Dec. 31, 2015.
"Top secret Visa data center banks on security, even has moat", (USA Today, 3/2012)
Security guards, power back-ups, earthquake and hurricane protection... credit
card companies take protecting data seriously.
- "Data Modeling for Analytical Data Warehouses,"
an interview with Michael Blaha (3/3/2012) ODBMS Industry Watch.
- "Under the Hood at Google and Facebook:
A peek at the data centers, servers, and software that keep us feeling connected"
IEEE Spectrum, June 2011.
Normalization for the Real World: nice article walking
one through the steps of database normalization, with larger- than- can- fit- on- a-
PowerPoint- slide relation examples.