SQL Flashcards
Statement
A statement is a text that the database recognizes as a valid command.
Clause
SQL commands commonly appear as capitals in statements.
Parameter
A parameter is a list of columns, data types, or values.
Integer data type
A whole number between -2147483648 and 2147483647. Postgres also includes alternativessmallintandbigint.
real: A floating-point type with variable precision with a maximum range of 6 decimals.
Real data type
A floating-point type with variable precision with a maximum range of 6 decimals.
Text data type
A range of characters of unlimited length.
Char data type
A range of characters of fixed lengthn, an error will be raised for any entries that exceed lengthn. Entries that are shorter thannwill be space-padded.
Varchar data type
A range of characters of variable length with a maximum lengthn. However, unlikecharthere is no space padding to extend entries shorter thann.
Date data type
A date (without any time value), such as 2022-06-21 (ISO 8601 format) and 6/21/2022.
CREATE TABLE
A clause that tells SQL you want to create a new table.
INSERT INTO
A clause that adds the specified row or rows.
VALUES
A clause that indicates the data being inserted.
ALTER TABLE
A clause that lets you make the specified changes.
ADD COLUMN
This clause lets you add a new column to a table.
UPDATE
Edits a row in a table. You can use the UPDATE statement when you want to change existing records.