Database/SQL Flashcards
What does SQL stand for?
Structured Query Language
Which component of SQL architecture receives information from a SQL query and from a Parser + Optimizer?
Query Language Processor
Which component of SQL architecture receives information from the Queary Language Processor and from a File Manager + Transaction Manager?
DBMS Engine
Which component of SQL architecture receives information from the DBMS Engine?
Physical Database
What is a field in a DB table that uniquely identifies each row/record?
Primary key
Must primary keys contain unique values?
Yes
Can primary key columns contain NULL values?
No
Can a table have more than one primary key?
No
What is the name for multiple fields in a primary key?
Composite key
If a table has a primary key defined on on any field(s), can there be more than one record with the same value as the field(s)?
No
Also called a referencing key, what is the name of a key that is used to link two tables together?
Foreign key
A foreign key is a column or combination of columns whose values match a ____ in a different table.
Primary key
What are the DDL (Data Definition Language) statements in SQL?
CREATE, ALTER, DROP
What are the DML (Data Maipulation Language) statements in SQL?
SELECT, INSERT, UPDATE, DELETE
What are the DCL (Data Control Language) statements in SQL?
GRANT, REVOKE
What are the TCL (Transaction Control Language) statements in SQL?
SAVEPOINT, ROLLBACK, COMMIT
What SQL statement is used to fetch data from a database and return this data in the form of a table?
SELECT
What syntax is used to fetch all fields?
SELECT * FROM
What SQL clause is used to specify a condition while fetching the data from a table or by joining multiple tables?
WHERE
What other statements can WHERE be used in besides SELECT?
UPDATE, DELETE
What SQL statement is used to add new rows of data to a table in the database?
INSERT INTO
What clause is used to specify the values being added to their respective columns via INSERT INTO?
VALUES
What clause is used to combine records from two or more tables in a DB?
JOIN
What type of JOIN is used only to combine mutually inclusive data from both tables?
INNER JOIN
What types of JOIN are used to combine only data from the left table or from the right table, respectively?
LEFT JOIN, RIGHT JOIN
What type of JOIN is used to combine all data from both tables?
FULL JOIN