Database Flashcards
How do you delete query’s
DELETE FROM table1
WHERE PKfield =“009”;
How do you insert code
INSERT INTO table name (fieldname1,fieldname2)
VALUES (value1, value2,);
How do you update code
UPDATE table1
SET feildName=“FALSE”
WHERE PKfeild=“001”;
What are the 4 database validations
Restricted choice
Validation check
Range check
Length check
Example of text data type
“Hello” or “092”
Example of date
22/02/1990
Example of number
10
Example of time
“20:09
Equijoin select query
SELECT feildName1,feildName2
FROM Table1,Table 2
WHERE Table1.pk1=Table2.Fk1
AND fieldName=“TRUE”;
What does an underlined word in an entity relationship diagram mean
It’s the primary key for that table
What does a word that has an asterisk above it in an entity relationship diagram mean
Foreign key in that table, but the pk in the other table (which is the table without the crows feet)
What table is the FK always in
The many table ( the one with crows feet)
If asked to add stuff to an entity relationship diagram for 5 marks, what do you add
Both PKS, the FK in the many table, crows feet to the many table and the verb in the middle of the two tables don’t just say (has or have )
For GDPR companies data must be
Accurate and up to date
Be safe and secure
For GDPR an individual can
Access the data being stored about them
Change any data which is now false
What is referential integrity
All FKS in the many table must link to a PK in the one table, if there is no link the query cannot run
Fit for purpose
A database is fit for purpose if it meets all the end user and functional requirements