Section 11 - Databases Flashcards
(10 cards)
What are the 4 main SQL commands
SELECT
UPDATE
DELETE
INSERT
sql select syntax
SELECT <attribute>
FROM <table>
WHERE <condition>
ODER BY <attribute> <ASC/DESC></attribute></condition></attribute>
sql update syntax
UPDATE <table>
SET <attribute> = <value>
WHERE <attribue> = <value></value></attribue></value></attribute>
sql delete syntax
DELETE FROM <table>
WHERE <condition></condition>
sql insert syntax
INSERT INTO <table>
VALUES (<value1>, <value2>, ...)</value2></value1>
sql create syntax
CREATE TABLE <table>(<attribute> <datatype> PRIMARY KEY, <attribute> <datatype>, ...)</datatype></attribute></datatype></attribute>
what is record locks
- when a record is accessed by a user it is locked to other users until they’re finished
- this means others cannot access or modify the content
what is serialisation
- requests to access records are put in a queue
- after the first user has finished using the record the next command in the queue is executed
what is timestamp ordering
- each command about a feild is assigned a timestamp when it is initiated
- commands are carried out in the order of their timestamps
commitment ordering
an algorithm is used to work out an optimum order to execute commands on the same feild