LEARN WITH ABDOU / DATABASE TEAM LAB
Rick & Morty: ask your first questions
Choose columns, rename results, and explain what a query changed.
Team: __________________________ Date: ______________
Dataset: Rick & Morty · Worksheet version: 2026-09-09
Open this exact lab: https://learnwithabdou.com/courses/mis3220/labs/rick-morty-select
Practice companion. Confirm official assignment and submission instructions in Canvas. Rotate query writer, evidence checker, and explainer. Record SQL, evidence, and reasoning.
Before class
P1. Know the row
Inspect the schema. What does one row represent in the table you will query? Which column identifies it?
P2. Read before you run
Read the matching lecture. Explain the difference between selecting columns and filtering rows. For a JOIN lab, also predict the number of matches.
P3. Bring a question
Run a small preview. Record one result you predicted and one point you want to discuss in class.
Database schema
scripts · 1905 rows
| Column | Type | Key / required |
|---|---|---|
| id | INTEGER | PK |
| lineIndex | INTEGER | |
| seasonNumber | INTEGER | NOT NULL |
| episodeNumber | INTEGER | NOT NULL |
| episodeName | TEXT | NOT NULL |
| characterName | TEXT | NOT NULL |
| dialogue | TEXT | NOT NULL |
| dialogueLength | INTEGER | |
| wordCount | INTEGER |
Types and declared keys reflect the original teaching database. Check business meanings and logical relationships in the lecture.
Team investigation
1. Investigate 1
Return id, characterName, and episodeName for the first four records ordered by id. Record the row and column counts.
SQL / evidence / explanation:
2. Investigate 2
Return characterName as speaker and episodeName as episode for the first six records ordered by id. Does AS change the stored column?
SQL / evidence / explanation:
3. Investigate 3
List every distinct characterName, sorted alphabetically. How many speakers are listed?
SQL / evidence / explanation:
4. Investigate 4
For the first eight records ordered by id, return id, wordCount, and wordCount + 5 as five_more_words. Does this update the database?
SQL / evidence / explanation:
5. Investigate 5
Return characterName joined to ' in ' and episodeName as scene_label, for the first five records ordered by id.
SQL / evidence / explanation:
6. Investigate 6
List id and characterName for records spoken by Rick, ordered by id. Explain the difference between selecting columns and filtering rows.
SQL / evidence / explanation:
7. Repair a syntax error
This query should find Rick's records. Run it, explain the error, and repair it without changing the intended question.
SELECT id, characterName FROM scripts WHERE characterName = Rick ORDER BY id;
SQL / evidence / explanation:
8. A query runs but the claim fails
A team calls these the five longest records. Explain why the evidence is insufficient, repair the query, and describe your tie policy.
SELECT id, wordCount FROM scripts LIMIT 5;
SQL / evidence / explanation:
9. Compare two questions
Compare SELECT DISTINCT characterName FROM scripts with SELECT DISTINCT characterName, episodeName FROM scripts. What does one row mean in each? Give a question each can answer.
SQL / evidence / explanation:
Reflect and submit
Choose your strongest answer and one revision. Explain the evidence behind each. Export your SQL and notes, then follow Canvas for the assigned report, grading, and submission requirements.