Relational:
Non-Relational:
INSERT:
- The most common way to enter information to a table is using the insert command.
- The usual layout of an insert command would be:
INSERT INTO (Table Name)(Fields that the new information will be added to) VALUES (The values to be added)
SELECT:
- The select command is a very versatile command and can be used in many ways.
- The select command can be used to gather an entire table or a specific field from a table.
- If we want to select a whole table, we would write:
SELECT * FROM (Table Name)
- Or, if we want to select a specific field - This is called slicing:
SELECT (Field Name) FROM (Table Name)
UPDATE:
- The update command is used to change the value of a fact based on a specified field that will identify the record of a specific entity.
The usual layout of an update command would be:
UPDATE (Table Name) SET (Field that contains the fact to be updated) WHERE (Field that contains unique value)(Unique value to the entity to be changed)
DELETE:
- Deleting is commonly used to delete records from a table in a database. For example, when a student leaves a school.
- The usual layout of a delete command would be:
DELETE FROM (Table Name) WHERE (Field Name) = (Unique Value of the record to be deleted)
SORTING:
- Sorting is done to order a specified field in a specific order.
- The key command in sorting is the ORDER BY command which specifies the order of the records in the field. The order is automatically ascending but if you want the order to be descending you must write it: [DESC].
- The usual layout of a sorting command would be:
SELECT (The Fields Wanted) FROM (Table Name) ORDER BY (Field name (Optionally: [DESC]))
For Example:
Primary Key:
Foreign Key: