Week 7 - SQL Flashcards
What’s a lambda function?
It’s an anonymous function (no name)
How does a relational database store data?
In rows and columns, like a spreadsheet
What are the four SQL commands?
- Create, insert
- Select (read)
- Update (find and replace)
- Detele (rows), drop (table)
How strings must be surrounded in SQL?
With single quotes
What are SQL five data types?
- Blob (binary)
- Integer
- Numeric (numbers with other chars. like dates)
- Real (float - decimal points)
- Text (strings)
What are the two SQL constraints keywords?
Not null and Unique
What are primary and foreign keywords used for in SQL?
To teach the database what is related to what
What are Btrees?
Data structs. in SQL that allow us to have more than two children per node
What are Btrees used for?
To create indexes and reduce search time
What’s the downside of Btrees?
Additional memory space is required
Which columns should be indexed in Btrees?
The ones that will probably be used more frequently
When does a “Race condition” happen?
When data is lost because it is being updated by multiple sources simultaneously
How to solve the “Race condition”?
With the TRANSACTION keyword
Why choosing the primary key wisely makes subsequent operations much easier?
Because primary keys enable rows of a table to be uniquely and quickly identified
What will LIKE “% Potter” do?
Find everybody with a “Potter” somewhere on the name