Introduction to SQL - Relational Databases Flashcards
Before writing any SQL queries, it’s important to understand the underlying data. In this chapter, we’ll discover the role of SQL in creating and querying relational databases. Using a database for a local library, we will explore database and table organization, data types and storage, and best practices for database construction.
What type of database defines the relationship between tables of data inside the database?
Relational Databases
What are the 3 advantages of a database over a spreadsheet?
1) more storage
2) more encryption
3) multiple users
What does SQL stand for?
Structured Query Language
Table names should follow what 3 rules?
1) lowercase
2) have no spaces - use underscores
3) plural
What is a record?
a row that hold data on an individual observation
What is a field?
a column that holds one piece of information about all records
Field names should follow what 5 rules?
1) lowercase
2) no spaces
3) singular
4) different from field names
5) different from the table name
Unique identifiers are used to identify what?
records in a table
What is a feature of unique identifiers (IDs) apart from being unique?
they are often numbers
Having more tables each with a clearly marked subject is generally better than what?
having fewer tables where information is combined
What are the 2 reasons we use data types?
1) different storage requirements
2) some operations only apply to certain types
What is the definition of a string?
a sequence of characters such as letters or punctuation (or numbers with special characters)
What is a popular string data type in SQL?
VARCHAR
What does an integer store?
whole numbers
What is a popular integer data type in SQL?
INT