Overview
Fall 2024: First half-semester: 9/4/2024 - 10/21/2024
TECH-UB 26 004 Monday-Wednesday 3:30-4:45 PM Tisch 2-100
Undergrad concentration: Computing and Data Science
Undergrad tracks:
- Business Analytics
- Asset Pricing
This course is the recommended first course for undergrads who 1) want to work in the rapidly growing fields of data science and data analytics or 2) want to acquire the technical and data analysis skills needed in other disciplines, such as finance and marketing. The course covers data organization, storage, and retrieval of structured (record-based) data using SQL.
Course Objectives
The course will teach you SQL at a very high level. After this course, you should be able to:
- Understand how data should be organized for efficient storage and retrieval
- Store and query data in relational databases
Topics
Module 1: Entity-Relationship Model and Relational Databases
-
Entities, Primary Keys, and Attributes
-
Relations
-
Cardinality: One-to-One, One-to-Many, Many-to-Many
-
From ER Diagram to a Relational Schema
-
(Optional) SQL Statements for Creating Tables
-
(Optional) Populating a Database with Data
Module 2: Selection Queries
-
Understand the design of our example databases
-
Navigating a Database: USE, SHOW TABLES, DESCRIBE
-
Selection queries: SELECT *, SELECT column, column AS,
-
Selection queries: DISTINCT, ORDER BY, LIMIT
Module 3: Filtering Queries
-
WHERE clause
-
Boolean conditions: AND, OR, NOT, BETWEEN
-
Containment condition: IN,
-
Approximate matches: LIKE
-
NULL values
-
CASE WHEN clause
-
Attribute-level functions: NULL functions, date functions, etc.
Module 4: JOIN queries
-
Inner Joins
-
Self Joins
-
Outer Joins
-
Antijoins and Semijoins
Module 5: Aggregate queries
-
Aggregation functions (COUNT, COUNT DISTINCT, SUM, AVG, MAX, MIN, STDEV, CONCAT)
-
(Optional) GROUP_CONCAT (e.g., for movie genres)
-
GROUP BY on a single attribute
-
GROUP BY on multiple attributes
-
HAVING clause
-
Integrated JOIN and GROUP BY queries
Module 6: Subqueries
-
Subqueries with single-value results
-
Semijoins and Antijoins using subqueries with the IN clause
-
Subqueries with derived tables
-
Comparison of WITH, temporary tables, views, and tables
-
Examples with subqueries
Module 7: Window queries
-
Window definition: OVER(ORDER BY)
-
Ranking window functions: RANK, DENSE_RANK, etc
-
Aggregation functions and windows OVER (PARTITION BY ORDER BY)
-
Offset window functions: LEAD, LAG, etc
-
Aggregation functions and windows
-
Frame definitions and rolling aggregations
Projects follow-up course
There is a follow-up course titled “Projects in Programming for Data Science”, which covers the topics covered here in more depth as well as additional topics, such as web crawling, text analysis, regular expressions, background processing, visualizations, network analysis, etc. Those interested in deepening and broadening their programming experience are highly encouraged to take the follow on course.
Prerequisites
None
Important Information
Since this is a hands-on course, you must bring your laptop to every class with sufficient battery charge. Make sure you can connect to NYU wi-fi.
Grading
- Homeworks (60%)
- Final exam (40%)
- Attendance: Please read about the penalty for missing classes below.
Late Assignment Submission Policy
Late submissions (even by 1 minute) will get a zero score because the answers will be posted immediately after the due date and time. No extensions will be granted except for medical or family emergencies. If you have any religious or personal conflicts, please submit the assignments beforehand since the related material will be covered well in advance of the due dates.
Penalty for missing classes and unapproved use of devices in class
Paper and pencil
Please bring paper and pen/pencil to take notes in class.
Unapproved device usage
Most of us are now addicted to devices, which impedes learning. You are allowed to use devices only when I ask you to use your computer in class. Otherwise, ALL device use is strictly prohibited, unless you have a qualified disability which allows you to use devices in class. Students using devices when not approved will be asked to leave the classroom. Each time you are asked to leave the class, you will be marked absent. This is very painful, awkward, and disruptive, and I hope I never have to do this, but I will not hesitate to enforce this policy.
Reasons for requiring attendance
Attendance is required for several reasons. First, you incorrectly assume you can catch up on a missed class by watching a recording (if available). Videos do not engage your brain as much as a live class. Second, less than 20% of you watch the recording (if available). You are then lost in class, which provides the wrong signals to me as an instructor. Third, your absence hurts class discussions. Fourth, you miss out on feedback if you do not work through the questions I pose in class. Fifth, I lose the feedback since there are fewer questions.
Attendance policy enforced after the add/drop period
The attendance policy below will be in effect only after the add/drop period.
Attendance sheet
After entering the class, please mark yourself present on the OneDrive sheet within the first 20 minutes (link posted on Brightspace after the add/drop period). You will be marked absent if you are more than 20 minutes late, unless it is due to factors beyond your control (traffic, subway delays, or interviews running late). You will also be marked absent if you leave the class early unless you have my permission or get it afterward. You will get an F in the course if you are caught cheating on the attendance sheet.
Mark yourself excused on the attendance sheet for excused absences
Without mandatory attendance, attendance is often below 50%. Therefore, though I dislike doing this, I penalize absences. If you anticipate being absent for good reasons, please email me well in advance. Please enter Excused on the attendance sheet described below to avoid the penalty if approved. You must update it; I will not mark you excused. If you miss a class due to emergencies and cannot tell me in advance, do not panic. Take care of the emergency first, and then email me. I will permit you to change the Absent to Excused. But if you miss a class without a valid reason, there is a penalty, as stated below.
Penalty for missing classes
For sections meeting in 150-190 minute sessions, you will lose one grade (A to A-, A- to B+, B+ to B, B to B-, and so on) for EVERY missed session unless you were explicitly excused via email. Thus, if you miss two class sessions, you will lose two grades, and so on.
For sections meeting in 75-80 minute sessions, you will lose one grade (A to A-, A- to B+, B+ to B, B to B-, and so on) for EVERY TWO missed sessions unless you were explicitly excused via email. Thus, if you miss four class sessions, you will lose two grades, and so on.
Seating and name tags
Please sit in the same seat in every class and display your name tags. For Zoom classes, you must keep your video on AT ALL TIMES. You must also have a good working headset or mic, as it is extremely rude to be inaudible and force me to ask you to repeat yourself.
NYU Stern Policies
Please read the NYU Stern Policies for this course.
Help and Office
- Me: dgode@stern.nyu.edu, 212-998-0021, Office: KMC 10-86.
- Teaching assistant: Please check NYU Brightspace.
Administrative and System Requirements
Videotaping
Classes are normally not videotaped, except for EMBA classes. If the class is videotaped, the link is posted to Brightspace by NYU Stern IT within a day.
Registered Students Only
Only registered students can attend classes. I cannot override this NYU Stern rule. We do not allow unregistered students to "audit" a class.
Albert and NYU Brightspace
You must be in Albert and NYU Brightspace before starting the first class. If you register late, there might be a delay of a day before you appear in these systems. If you cannot access these systems after a day, please contact the relevant REGISTRAR. I cannot add you to these systems regardless of what someone in IT tells you.
Computer Requirements
You need to bring a computer to every class. If you have any technical questions, please contact Stern IT at (212-998-0180) or servicedesk@stern.nyu.edu, or NYU IT at +1 (212) 998-3333 or askit@nyu.edu. I cannot help you with your computer issues.
Materials
- I use my materials. Therefore, no textbook is required, and you need not purchase anything.