CS122A Spring 2019: Introduction to Data Management
Course Personnel
Instructor:
- Mike Carey
E-Mail: mjcarey@ics.uci.edu
Office: Bren Hall 2091
Office hours: Piazza and by appointment
TAs:
- Shiva Jahangiri
E-mail: shivaj@uci.edu
Office hours: Piazza and by appointment - Mikhail Dmitriyevich Lychagin
E-mail: mlychagi@uci.edu
Office hours: Piazza and by appointment - Xikui Wang
E-mail: xikuiw@uci.edu
Office hours: Piazza and by appointment
Readers:
- Rui Guo
E-mail: ruig2@uci.edu
- Bahareh Harandizadeh
E-mail: bharandi@uci.edu
- Hang Nguyen
E-mail: hangn5@uci.edu
Meeting Times & Places
Lecture:
Time: Mon/Wed/Fri 5-5:50 PM
Place: PSLH 100
Instructor: Mike
Discussion 1:
Time: Tue 5-5:50 PM
Place: PSCB 140
Instructor: Shiva Jahangiri
Discussion 2:
Time: Tue 6-6:50 PM
Place: PSCB 140
Instructor: Xikui Wang
Discussion 3:
Time: Tue 7-7:50 PM
Place: PSCB 140
Instructor: Xikui Wang
Discussion 4:
Time: Thu 5-5:50 PM
Place: PSCB 140
Instructor: Shiva Jahangiri
Discussion 5:
Time: Thu 6-6:50 PM
Place: PSCB 140
Instructor: Mikhail Dmitriyevich Lychagin
Discussion 6:
Time: Thu 8-8:50 PM
Place: PSCB 140
Instructor: Mikhail Dmitriyevich Lychagin
Course Objectives
This course provides students with an introduction to the design of databases and the use of database management systems in support of applications. It covers the entity-relationship (E-R) approach to logical database design. It then covers the relational data model, mapping of E/R designs to relations, relational database design principles, abstract query languages such as the relational algebra and relational calculus, and the industry-standard query language, SQL. It also covers indexing and physical database design, Students will gain exposure to how relational database management systems are used to manage an actual database. Time permitting, the course will also touch briefly on advanced database management topics such as semi-structured data management and/or transactions.
This course is aimed at database design and the use of database management systems in building database applications. It feeds into a follow-on project course, CS122B, whose focus is data-centric Web applications. The CS122A/B course sequence does NOT cover the internal workings of database systems; that material is covered in the undergraduate course CS122C (or its graduate equivalent, CS222) and the graduate-level follow-on course CS223. (The course textbook also delves further into that material for those students who are curious about what goes on under the hood.) Interested students are strongly encouraged to take one, two, or all of these courses; CS122B and CS122C/CS222 are independent, as each one requires only CS122A as their required database background.
Prerequisites
Students should ideally have some experience programming in Python, Java, C++, or C#.
Required Textbooks
Database Management Systems (3rd Edition) by Raghu Ramakrishnan and Johannes Gehrke (a.k.a. "the Cow book"). (Note: Older editions are probably okay too, as long as you do the section number remapping.)
Topic Coverage and Exam Schedule
Syllabus
| Topic | Reading |
| Databases and DB Systems | Ch. 1 |
| Entity-Relationship (E-R) Data Model | Ch. 2.1-2.5, 2.8 |
| Relational Data Model | Ch. 3.1-3.2 |
| E-R to Relational Translation | 3.5 |
| Relational Design Theory | Ch. 19.1-19.6, 20.8 |
| Midterm Exam 1 | Mon, Apr 29 (in class) |
| Relational Algebra | Ch. 4.1-4.2 |
| Relational Calculus | Ch. 4.3-4.4 |
| SQL Basics (SPJ and Nested Queries) | Ch. 3.4, 5.1-5.3 |
| SQL Analytics (Aggregation, Nulls, and Outer Joins) | Ch. 5.4-5.6 |
| Advanced SQL Goodies (Constraints, Triggers, Views, and Security) | Ch. 3.3, 3.6, 5.7-5.9, 21.1-21.3, 21.7 |
| Midterm Exam 2 | Wed, May 22 (in class) |
| Tree-Based Indexing | Ch. 9.1, 8.1-8.3, 10.1-10.2 |
| Hash-Based Indexing | Ch. 10.3-10.8, 11.1 |
| Physical DB Design | Ch. 8.5, 20.1-20.7 |
| Semistructured Data Management (a.k.a. NoSQL) | AsterixDB SQL++ Primer, Couchbase SQL++ Book |
| Basics of Transactions | Ch. 16 and Lecture Notes |
| Endterm Exam | Fri, Jun 7 (in class) |
Midterm Exam 1
Time: Mon, Apr 29, 5-5:50 PM
Place: PSLH 100
VersionA Solution VersionA
VersionB Solution VersionB
Midterm Exam 2
Time: Wed, May 22, 5-5:50 PM
Place: PSLH 100
VersionA Solution VersionA
VersionB Solution VersionB
Endterm Exam
Time: Fri, Jun 7, 5-5:50 PM
Place: PSLH 100
VersionA Solution VersionA
VersionB Solution VersionB
Helpful Exam Resources
(Example midterm 1)
(Solution to example midterm 1)
(Example midterm 2)
(Solution to example midterm 2)
(Example endterm)
(Solution to example endterm)
Exams, Assignments, and Grading
Grading Critera
Exams: 55%
Homework: 40%
Quizzes: 3%
Piazza: 2%
Homework and Participation
Homework assignments must be turned in by the assigned due dates/times. Details of how to turn in a given assignment will be included in each assignment's handout. The 40% of your grade attributed to homework will be based on your top 7 out of 8 homework scores. (You can spend the 8th one however you like, but if you decide to skip an assignment, do keep in mind that the material will still be on the exams and that the homework is intended to be a useful study/practice tool for those -- you will still be responsible for mastering all "skipped" material.) There will also be short weekly quizzes in the discussion sections to give you further practice with the course material; those will count very little towards your final grade (they will contribute 3%), and they're just there for your benefit (to give you another chance to check your understanding of things and see what questions you might want to ask the TA).
Grade Change Policy
For all of the graded assignments as well as the midterm exams, if you disagree with the grading, you may discuss your concerns with the relevant instructor (professor, TA, or reader) within two weeks after they are returned. After that, all grades will be considered final. Instructors' office hours are the best time/place to handle these issues (or you can make a separate appointment). Do not wait until the end of the term to raise issues, as two weeks means two weeks.
Collaboration Policy
All homework assignments are to be completed individually. It is okay to discuss assignments with your peers, e.g., to clarify details of an assignment or to compare thoughts on rough approaches, but the bulk of your work is to be done solo. See http://www.ics.uci.edu/ugrad/policies/index.php#academic_honesty for a good discussion of what is/isn't considered honest collaboration. The exams are also to be done solo. :-) This policy applies both to person-to-person and social media interactions (more on this below).
Late Policy
Due dates will be clearly indicated on all HW assignments. Assignments will still be accepted for up to one day (24 hours) after the due date, but you will lose 20 points per day (out of the 100-point total per assignment) for lateness. We will not accept assignments in any form whatsoever after that time. "Stuff happens" sometimes, as we all know, so you should anticipate that reality and avoid working up until the very last minute. Assignments MUST be turned in per the assignment's instructions by the indicated deadline date/time in order to get full credit. (Note: The best-7-out-of-8 grading policy is another fallback plan for what would otherwise be late homework assignments; that will work once, but obviously only once.)
Exam Attendance Policy
The exam dates are provided at the start of the term. These dates are not flexible and makeup exams will not be offered, so please avoid scheduling interviews, mini-vacations, or any other activities in ways that will interfere with exam-taking. All students are required to take the exam on the same date in the same time window in order to ensure that we can give, grade, and fairly curve the entire class on a single exam. Note that we are avoiding Friday exam dates this quarter to make this policy easy to adhere to.
Academic Honesty Policy
Cheating is the one area where the instructor for this course has zero patience or sympathy. You are here at UCI to learn, and cheating totally defeats that purpose. All students will be expected to adhere to the UCI and ICS Academic Honesty policies (see http://www.editor.uci.edu/catalogue/appx/appx.2.htm#academic and http://www.ics.uci.edu/ugrad/policies/index.php#academic_honesty to read their details). Any student found to be involved in cheating or aiding others in doing so will be academically prosecuted to the maximum extent possible: that means you will most probably fail this course in its entirety. (Ask around - it's happened.) Just say no to cheating!!!
DBMS Platform
This class will use an industrial-strength relational database management system (RDBMS) for the hands-on homework assignments. In some past terms we have allowed students to choose between MySQL (an open source DBMS), DB2 (from IBM), and/or another RDBMS of their choosing. This quarter we will be suggesting that everyone use the same system, namely MySQL.
For info on how to set up and use MySQL, please see: [MySQL Installation Guide for Mac], [MySQL Installation Guide for Windows], [MySQL Installation Guide for Linux], [Sample SQL Script used in the guide].
For info on how to MySQL's Command-Line Tool, please see: [MySQL Command-Line Tool Guide for Mac], [MySQL Command-Line Tool Guide for Windows] [Sample SQL Script used in the guide].
For further info on how to use the MySQL DBMS, you can look here: https://dev.mysql.com/doc/.
If you have a strong preference for using another database system for the course project, e.g., because you are working elsewhere on- or off-campus with a different RDBMS (e.g., PostgreSQL), you may e-mail the Instructor with a request for permission to do so. If you opt to do this, you will then be on your own to make sure everything works right within the prescribed timeframes (i.e., DBMS difficulties will not be accepted as a lateness excuse).
Discussion Forums for All Things CS122A
We will be using Piazza (heavily!) for online class discussions. The system is catered to getting you the help you need fast and efficiently from classmates, the TAs, the Reader, and the Instructor. Rather than emailing your course or HW content questions to the teaching staff, you will be expected to post your questions on Piazza. (If you have any problems or feedback for the Piazza developers, email team@piazza.com.) We've used Piazza for this class multiple times before, and it seems to work remarkably well. You can find our class Piazza page at http://piazza.com/uci/spring2019/cs122a/home. With over 400 students enrolled the course this term, Piazza is essentially our only hope for managing the class and getting everyone's questions answered -- office hours become hopeless/worthless at this scale, unfortunately. Your Piazza activity will also contribute 2% to your overall grade -- in particular, note that misbehavior on Piazza may lead to loss of points.
When using Piazza, there are a couple of things to keep in mind. Firstly, despite an unfortunate national trend towards the acceptance of nastiness in social media, hurtful Piazza behavior will not be tolerated - try to be kind to your classmates. Secondly, Piazza is a wonderful resource for asking and answering questions - as long as it is used thoughtfully. Please avoid re-asking questions that have already been asked and answered - you are responsible for reading others' questions and not re-asking them. With 400+ eyes on each message, lazy question-asking on Piazza is costly and inconsiderate, and such behavior can lead to loss of participation points. Finally, Piazza is not a place to discuss the finer details of answers to HW problems - i.e., it is not a place to post, request, or compare your answers to specific problems! (Doing so would actually risk your violating the Academic Honesty Policy, as everyone is expected to ultimately do their own work.)
As you are aware, there is also a weekly Discussion session meeting, and attendance of those is highly encouraged. The encouragement will be provided via the quiz portion of your final grade (3%), as quizzes can only be taken in person during the Discussion session. If for some reason you have to miss your session during one week, you can request special permission (in advance!) to attend a different one - but please try to avoid that for load-balancing reasons. You will be held fully responsible for all material discussed in the Discussion sessions, so if you do opt out or miss one, be sure to ask a trusted classmate who's been to theirs what you might need to know. The Discussion sessions will also serve (importantly!!) as "group office hours" - we will leave ample time for questions most weeks, so come armed with things you'd like to have clarified or expanded on.
HW Due Dates & Links
Homework Assignments
| Due Date | Topic | Assignment | Solution | Notes |
| Fri, Apr 12 (5 PM) | E-R Modeling | HW1 TMPL | HW1 Solution | |
| Fri, Apr 19 (5 PM) | E-R to Relational Translation | HW2 TMPL Sample Script | HW2 Solution | |
| Fri, Apr 26 (5 PM) | Relational Design Theory | HW3 TMPL | HW3 Solution | |
| Mon, May 6 (5 PM) | Relational Algebra | HW4 TMPL | HW4 Solution | |
| Mon, May 13 (5 PM) | SQL (Hands-on) | HW5 TMPL INST SCRIPT | HW5 Solution | |
| Mon, May 20 (7 PM) | More SQL (Hands-on) | HW6 TMPL INST SCRIPT | HW6 Solution | (Late cutoff on May 21 will be 5 PM) |
| Thu, May 30 (5 PM) | SQL Design and Indexing | HW7 TMPL | HW7 Solution | |
| Thu, Jun 6 (5 PM) | NoSQL (Hands-on) | HW8 TMPL INST SCRIPTS | HW8 Solution | (No lateness permitted) |
Discussion Section Quizzes
| Week | Topic | Quiz | Solution |
| Week 1 | Academic Honesty | Quiz1 | Quiz1-Solution |
| Week 2 | E-R Modeling | Quiz2 | Quiz2-Solution |
| Week 3 | E-R to Relational Translation | Quiz3 | Quiz3-Solution |
| Week 4 | Relational DB Design Theory | Quiz4 | Quiz4-Solution |
| Week 5 | Relational Algebra | Quiz5 | Quiz5-Solution |
| Week 6 | SQL & TRC | Quiz6 | Quiz6-Solution |
| Week 7 | Advanced SQL (Triggers & Views) | Quiz7 | Quiz7-Solution |
| Week 8 | ISAM & Indexing | Quiz8 | Quiz8-Solution |
| Week 9 | Indexing & Physical DB design | Quiz9 | Quiz9-Solution |
| Week 10 | Physical DB design & NoSQL | Quiz10 | Quiz10-Solution |
Attachments (100)
-
CS122aLecture1.pdf
(3.3 MB
) - added by 7 years ago.
Lecture 1 slides
-
CS122aLecture2.pdf
(1.0 MB
) - added by 7 years ago.
Lecture 2 slides
- Quiz1.pdf (59.8 KB ) - added by 7 years ago.
- Quiz1-Solution.pdf (59.8 KB ) - added by 7 years ago.
- Homework1.pdf (1.3 MB ) - added by 7 years ago.
-
CS122aLecture3.pdf
(1.4 MB
) - added by 7 years ago.
Lecture 3 slides
- Quiz2.pdf (127.3 KB ) - added by 7 years ago.
- Quiz2-Solution.pdf (127.2 KB ) - added by 7 years ago.
- 2019s-cs122a-mysql-installation-guide-for-mac.pdf (1.6 MB ) - added by 7 years ago.
- 2019s-cs122a-mysql-installation-guide-for-windows.pdf (1.5 MB ) - added by 7 years ago.
- sample_script.sql (3.7 KB ) - added by 7 years ago.
- 2019s-cs122a-mysql-installation-guide-for-linux.pdf (682.5 KB ) - added by 7 years ago.
- 2019s-cs122a-mysql-cmdtool-guide-for-mac.pdf (618.3 KB ) - added by 7 years ago.
- 2019s-cs122a-mysql-cmdtool-guide-for-windows.pdf (129.7 KB ) - added by 7 years ago.
- createscript.sql (407 bytes ) - added by 7 years ago.
- Homework2.pdf (105.2 KB ) - added by 7 years ago.
- example.sql (1.4 KB ) - added by 7 years ago.
-
CS122aLecture5.pdf
(1.7 MB
) - added by 7 years ago.
Lecture 5 slides
-
CS122aLecture6.pdf
(2.7 MB
) - added by 7 years ago.
Lecture 6 slides
-
CS122aLecture4.pdf
(957.2 KB
) - added by 7 years ago.
Lecture 4 slides
- Homework1-Solution.pdf (38.1 KB ) - added by 7 years ago.
-
CS122aLecture7.pdf
(1023.1 KB
) - added by 7 years ago.
Lecture 7 slides
-
CS122aLecture8.pdf
(560.1 KB
) - added by 7 years ago.
Lecture 8 slides
- Quiz3-Solution.pdf (84.1 KB ) - added by 7 years ago.
- Quiz3.pdf (71.3 KB ) - added by 7 years ago.
- Homework3.pdf (184.9 KB ) - added by 7 years ago.
- CS122aMidterm1ASpring18.pdf (618.5 KB ) - added by 7 years ago.
- Solution-CS122aMidterm1ASpring18.pdf (624.0 KB ) - added by 7 years ago.
- Homework2Solution.pdf (54.2 KB ) - added by 7 years ago.
-
CS122aLecture9.pdf
(2.0 MB
) - added by 7 years ago.
Lecture 9 slides
-
CS122aLecture10.pdf
(1.2 MB
) - added by 7 years ago.
Lecture 10 slides
- CS122aLecture11.pdf (1.1 MB ) - added by 7 years ago.
- Quiz4.pdf (66.8 KB ) - added by 7 years ago.
- Quiz4-Solution.pdf (75.4 KB ) - added by 7 years ago.
- Homework3-Solution.pdf (88.5 KB ) - added by 7 years ago.
-
CS122aLecture12.pdf
(3.6 MB
) - added by 7 years ago.
Lecture 12 slides
- Hw4.pdf (354.8 KB ) - added by 7 years ago.
-
CS122aLecture13.pdf
(1.7 MB
) - added by 7 years ago.
Lecture 13 slides
- Quiz5.pdf (362.7 KB ) - added by 7 years ago.
- Quiz5-Solution.pdf (385.4 KB ) - added by 7 years ago.
-
CS122aLecture14.pdf
(2.0 MB
) - added by 7 years ago.
Lecture 14 slides
- Homework5Dump.sql (430.1 KB ) - added by 7 years ago.
- Homework5.pdf (87.2 KB ) - added by 7 years ago.
-
CS122aLecture15.pdf
(1.7 MB
) - added by 7 years ago.
Lecture 15 slides
- Hw5-LoadInstructions.pdf (419.1 KB ) - added by 7 years ago.
- CompatibleHomework5Data.sql (652.6 KB ) - added by 7 years ago.
-
CS122aLecture16.pdf
(1.1 MB
) - added by 7 years ago.
Lecture 16 slides
- Homework4-Solution.pdf (295.7 KB ) - added by 7 years ago.
- Quiz6.pdf (72.9 KB ) - added by 7 years ago.
- Quiz6-Solution.pdf (155.7 KB ) - added by 7 years ago.
-
CS122aLecture17.pdf
(1.2 MB
) - added by 7 years ago.
Lecture 17 slides
-
CS122aMidterm2aSpring18.pdf
(628.6 KB
) - added by 7 years ago.
Midterm #2 from Spring 2018
-
SolutionA-122aMidterm2aSpring18.pdf
(616.3 KB
) - added by 7 years ago.
Midterm #2 solution from Spring 2018
- CS122aMidterm1Spring19-B-Solution.pdf (524.2 KB ) - added by 7 years ago.
- CS122aMidterm1Spring19-B.pdf (645.7 KB ) - added by 7 years ago.
- CS122aMidterm1Spring19-A-Solution.pdf (524.8 KB ) - added by 7 years ago.
- CS122aMidterm1Spring19-A.pdf (649.4 KB ) - added by 7 years ago.
- CompatibleHomework6Dump.sql (652.8 KB ) - added by 7 years ago.
- 2019s-cs122a-hw6-template.docx (19.8 KB ) - added by 7 years ago.
-
CS122aLecture18.pdf
(3.5 MB
) - added by 7 years ago.
Lecture 18 slides
- 2019s-cs122a-hw6-instruction.pdf (197.0 KB ) - added by 7 years ago.
- 2019s-cs122a-hw6.pdf (133.5 KB ) - added by 7 years ago.
-
CS122aLecture19.pdf
(1.3 MB
) - added by 7 years ago.
Lecture 19 slides
- Quiz7-Solution.pdf (107.2 KB ) - added by 7 years ago.
- Quiz7.pdf (81.5 KB ) - added by 7 years ago.
- Homework5-Solution.pdf (162.2 KB ) - added by 7 years ago.
-
CS122aLecture20.pdf
(1010.8 KB
) - added by 7 years ago.
Lecture 20 slides
-
CS122aLecture21.pdf
(1.1 MB
) - added by 7 years ago.
Lecture 21 slides
- 2019s-cs122a-hw6-solution.pdf (197.9 KB ) - added by 7 years ago.
- Quiz8.pdf (166.0 KB ) - added by 7 years ago.
- Quiz8-Solution.pdf (320.3 KB ) - added by 7 years ago.
-
CS122aLecture22.pdf
(856.7 KB
) - added by 7 years ago.
Lecture 22 slides
- Assignment7.pdf (116.0 KB ) - added by 7 years ago.
-
CS122aEndterm-S18-VersionA.pdf
(973.4 KB
) - added by 7 years ago.
Sample endterm
-
Solution-CS122aEndterm-S18-VersionA.pdf
(533.5 KB
) - added by 7 years ago.
Sample endterm solution
- Assignment7-tmpl.docx (15.5 KB ) - added by 7 years ago.
-
CS122aLecture23.pdf
(966.1 KB
) - added by 7 years ago.
Lecture 23 slides
- RunAsterixDB.pdf (556.5 KB ) - added by 7 years ago.
- HW8.zip (78.7 KB ) - added by 7 years ago.
- Quiz9.pdf (112.5 KB ) - added by 7 years ago.
- Quiz9-Solution.pdf (181.5 KB ) - added by 7 years ago.
- Assignment8-tmpl.docx (8.9 KB ) - added by 7 years ago.
- Assignment8.pdf (590.8 KB ) - added by 7 years ago.
-
Lecture24.pdf
(1.6 MB
) - added by 7 years ago.
Lecture 24 slides
-
Lecture25.pdf
(522.0 KB
) - added by 7 years ago.
Lecture 25 slides
- Assignment7-Solution.pdf (191.4 KB ) - added by 7 years ago.
-
CS122aLecture26.pdf
(1.9 MB
) - added by 7 years ago.
Lecture 26 slides (updated)
- Quiz 10 solution.pdf (121.0 KB ) - added by 7 years ago.
- Quiz 10.pdf (112.6 KB ) - added by 7 years ago.
-
CS122aLecture26.2.pdf
(2.2 MB
) - added by 7 years ago.
Lecture 26 slides (updated)
- CS122aMidterm2aSpring19-Solution.pdf (727.3 KB ) - added by 7 years ago.
- CS122aMidterm2aSpring19.pdf (609.2 KB ) - added by 7 years ago.
- CS122aMidterm2bSpring19.pdf (635.8 KB ) - added by 7 years ago.
- CS122aMidterm2bSpring19-Solution.pdf (669.9 KB ) - added by 7 years ago.
- Solution-Assignment8.pdf (186.1 KB ) - added by 7 years ago.
-
EndtermExamDataScripts.zip
(3.2 KB
) - added by 7 years ago.
SQL and NoSQL Endterm data scripts (for the truly curious)
- CS122aEndtermS19VersionB.pdf (740.9 KB ) - added by 7 years ago.
- CS122aEndtermS19VersionA.pdf (727.4 KB ) - added by 7 years ago.
- CS122aEndtermS19VersionASolution.pdf (728.9 KB ) - added by 7 years ago.
- CS122aEndtermS19VersionBSolution.pdf (742.3 KB ) - added by 7 years ago.
