Intro to SQL & Select statements: LMS 18 Flashcards
What does SQL stand for?
Structured Query Language
What is SQL?
(Structured Query Language?)
A database computer language
What is SQL designed for?
Designed to retrieve and manage data.
Also to create and modify DB schema, etc.
What is a Database?
An organized repository of indexed information.
(usually as a group of linked data files)
What does a Database allow?
easy retrieval, updating, analysis, and output of data.
Where is a data in a database stored?
Usually in a computer.
What form is the data in?
Graphics, reports, scripts, tables, text, etc.
Data could represent almost every kind of information.
Examples of computer apps that have data bases at their core.
Antivirus software, spreadsheets, word-processors.
Most computer apps are databases at their core.
What is a Query?
A request to the database to retrieve information.
What is a subquery?
A query within another query.
What is the outer query called?
The main query.
What is the inner query called
Subquery
Whats is executed first?
The subquery or main query?
The subquery is always executed first, and the results of the subquery are passed on to the main query.
What does DBMS stand for?
Database Management System
What does a DBMS do?
It’s a software that controls the organization, storage, retrieval, security, and integrity of data in a database.
What is a Primary Key?
Its a unique identifier of every record in the database table.
Where is the Primary Key?
Its a column in a database where each row has a unique value.
How many primary keys are in a table?
Only one primary key. No NULL values are allowed.
What is a Unique Key?
It’s a column or group of columns that together hold unique values.
A table can have more than one unique key.
In a list of American citizens, there is a column with Social Security Numbers (SSN).
Also First and last name columns combined with phone number.
What is the Primary Key?
What is the Unique key?
The column with social security numbers (SSN) would be a Primary Key
The first and last name columns combined with phone number would be a Unique Key.
What is a Foreign Key (SQL)?
A column or combination of columns that’s used to establish a relationship, linking the table rows to another table’s Primary Key.
What is Referential Integrity?
Refers to the relationship between tables.
What does a Foreign Key do?
A Foreign Key enforces the relationship between two tables via the Primary Key of the parent table and the Foreign Key of the development child of the table.
Is a Foreign Key unique?
A Foreign Key is usually not unique (one-to-many relation) and always points to a Primary Key.