Databases Flashcards
define: data
“known facts that can be recorded and have implicit meaning”
define: database
collection of related data
define: DBMS
acronym for DataBase Management System
a collection of programs that enables users to create and maintain a database with processes for creating and maintaining a database (that would otherwise be manually maintained)
These are the processes:
- defining (info type, structures, constraints)
- construction (process of storing data)
- manipulation (query, update, generate reports)
- sharing (between multiple users)
define: database system
database + DBMS
define: DBA
aka DataBase Administrator
define: persistent object
permanent
What does SQL stand for?
Structured Query Language
What is SQL?
programming language designed to manage data stored in relational databases
How does SQL operate?
through simple, declarative statements
Why does SQL operate through simple, declarative statements?
keeps data accurate and secure, and helps maintain the integrity of databases, regardless of size.
What is a relational database?
A database that organizes information into one or more tables
What is a table?
A table is a collection of data organized into rows and columns.
What’s another word for tables?
Tables are sometimes referred to as relations.
Identify the parts of this diagram in SQL terms
Refer to attached picture
How can you create a table from scratch?
Relation: celebs with properties
id (integer)
name
age (integer)
How do you insert a new row into a table? Given this data
1, Justin Beiber, 22
2, Beyonce Knowles, 33
3, Jeremy Lin, 27
4, Taylor Swift, 30
What’s the faster way to insert multiple rows into a table?
What happens if we try to create a table with an existing name?
SQLite is case insensitive for most syntax
it will throw an error, because the table name already exists
https://discuss.codecademy.com/t/what-happens-if-we-try-to-create-a-table-with-an-existing-name/376312
How do you return column ‘name’ from relation ‘celebs’?
SELECT name FROM celebs;
What does SELECT statement do?
always return a new table called the result set
How do you select all data from relation?
SELECT * FROM celebs;
How would you add a new column to celebs table
twitter_handle
data type: text
What is NULL?
A special value in SQL that represents missing or unknown data.
∅
Can we change the order a column is added to a table?
No. By default, a new column will always be added at the end of the table
however, you can always select the columns in any order
SELECT col3, col1, col2
source: https://discuss.codecademy.com/t/can-we-add-a-column-at-a-specific-position-to-a-table/376656