Code Academy Flashcards
Learn SQL
What is a statement in SQL?
A statement is a text that databases recognizes as a valid command
What is a clause in SQL?
Clauses perform specific tasks.
What is the convention for writing clauses?
Clauses are written in all caps
What is a record?
A record is a row in a table
What is a field?
text that the database recognizes as a valid command
How do you insert rows into a table?
INSERT INTO table_name ( field_name. field_name)
VALUES ( value, value);
What is the first element of starting a query?
SELECT
What is the ‘wildcard’ in SQL?
*
What does the ALTER TABLE clause allow?
ALTER TABLE allows the user to alter columns
What does
ALTER TABLE table_name
ADD COLUMN column_name DATA_TYPE;
mean?
The line of code creates a column of a specified data type in a specified table.
What is yielded after the SELECT * FROM table_name; statement?
The SELECT * FROM table_name; returns a new table that is called the result set.
What does UPDATE statement do?
It edits a row in a table. Its used to update existing records.
What does the DELETE FROM statement do?
It deletes one or more rows from a table.
What are constraints?
Constraints are rules that are used to specify rules for the data in the table.
What are primary keys?
Primary keys are unique to identify records so that there aren’t duplicates.