SQL Flashcards
(11 cards)
What is SQL used for
declerative language to manipulate databases
SELECT
collect fields from a given table
FROM
specify which table the info comes from
WHERE
specify the search criteria
BETWEEN
between two values like BETWEEN 10 AND 20
ORDER BY
Specifies if you want it ascending or descending.
ORDER BY DatePublished Desc
JOIN
combines rows from multiple tables from a common field
CREATE
Make new databases.
CREATE TABLE TableName
(
Attribute1 INTEGER NOT NULL, PRIMARY KEY,
Attribute2 VARCHAR(20) NOT NULL,
)
ALTER
Used to add, delete or modify columns in a table.
delete: ALTER TABLE TableName
DROP COLUMN AttributeX
INSERT INTO
INSERT INTO (column1, column2, …)
VALUES (value1, value2, …)
UPDATE
update a record.
UPDATE TableName
SET column1 = value1
WHERE columnX = value