mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
feat(curriculum): Added Bash and SQL Quiz (#56974)
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
parent
4c176d1ccb
commit
5d546447f5
@ -17,439 +17,439 @@ To pass the quiz, you must correctly answer at least 17 of the 20 of the questio
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What does SQL stand for?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Standard Query Language.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Simple Quantum Language.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Sophisticated Query Language.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Structured Query Language.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which SQL command is used to create a new database?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
`BUILD DATABASE`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
`GENERATE DATABASE`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
`NEW DATABASE`
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
`CREATE DATABASE`
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is First Normal Form (1NF)?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
No redundant data.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
No partial dependencies.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
No transitive dependencies.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Atomic values in columns.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
How do you select all columns from a table?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
`SELECT []`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
`SELECT ALL`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
`SELECT COLUMNS`
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
`SELECT *`
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What does `FOREIGN KEY` establish?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
A unique identifier key.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
A primary key.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
A null constraint.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
A relationship between tables.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is the purpose of normalization in SQL?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Speed up queries.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Increase storage space.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Add more indexes.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Reduce data redundancy.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is the best defense against SQL injection?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Remove all user input.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Disable SQL access.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Remove database access.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Use prepared statements.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which command modifies existing table data?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
`MODIFY`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
`CHANGE`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
`ALTER`
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
`UPDATE`
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
In a junction table, what do you typically include?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Only foreign keys.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Only timestamps.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Only primary keys.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Foreign keys and additional data.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What command adds new data to a table?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
`ADD`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
`PUT`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
`NEW DATA`
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
`INSERT`
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
Which key can have duplicate values?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Primary Key.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Unique Key.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Composite Key.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Foreign Key.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What does Third Normal Form (3NF) eliminate?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Multi-Valued Dependencies.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Partial Dependencies.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
All Dependencies.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Transitive Dependencies.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
How do you filter SQL results?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
`FILTER`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
`SORT`
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
`TAGS`
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
`WHERE`
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What happens to child records when implementing `ON DELETE CASCADE`?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
They become null.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
They are archived.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
They are orphaned.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
They are automatically deleted.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What is the `COALESCE` function used for?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Removing duplicates.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Counting Null Values.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Combining Tables.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Returning first non-null value.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
When normalizing, what do we call data that depends on only part of a composite key?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Transitive Dependency.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Multi-Valued Dependency.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Functional Dependency.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Partial Dependency.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What's the main risk of using `SELECT *` in production code?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
SQL injection vulnerability.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Slower query performance.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Database crashes.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Breaking code when columns change.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
How do you typically store a password in a database?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
As an encrypted string.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
As base64 encoded text.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
As a plain text.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
As a salted hash.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
What's the purpose of an index on a foreign key?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Ensure data integrity.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Save Storage Space.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Prevent Null Values.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Speed Up Join Operations.
|
||||
|
||||
### --question--
|
||||
|
||||
#### --text--
|
||||
|
||||
Placeholder question
|
||||
In a many-to-many relationship between students and courses, what does the junction table contain?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
Placeholder distractor 1
|
||||
Only student IDs.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 2
|
||||
Only Course IDs.
|
||||
|
||||
---
|
||||
|
||||
Placeholder distractor 3
|
||||
Full student and course details.
|
||||
|
||||
#### --answer--
|
||||
|
||||
Placeholder answer
|
||||
Both IDs and Enrollment date.
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user