1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is SQL?
A language used to work with databases
→ Declarative language
What are the key SQL commands?
- SELECT
- UPDATE
- INSERT
- DELETE
What is the SELECT command used for?
Data retrieval
How is the SELECT command used?
SELECT [attribute]
FROM [table]
WHERE [condition]
What is the UPDATE command used for?
Modifying the attributes of an existing entity
How is the UPDATE command used?
UPDATE [table]
SET [attribute] = [value]
WHERE [attribute] = [value]
What is the DELETE command used for?
Removing entities from a database
How is the DELETE command used?
DELETE FROM [table]
WHERE [condition]
What is the INSERT command used for?
Adding new records to an existing table
How is the INSERT command used?
INSERT INTO [table] ([column1], [column2], …)
VALUES ([value1], [value2]
How is SQL used to make new database tables?
CREATE commandH
How is the CREATE command used?
Specifies:
- Table name
- Attributes and their data types
- Entity identifiers
What are the possible data types for attributes?
- CHAR(size) - fixed length string
- VARCHAR(size) - variable length string
- INT(size)
- FLOAT(size, precision)
- DATE - yyyy-mm-dd
- DATETIME
- TIME - hh-mm-ss
- YEAR