SQL Flashcards
What is SELECT’s function
To return data, it requires SELECT and then the feild name, FROM which is the table, WHERE which is which row(s) you want to access.
What is WHERE’s purpose?
To limit the results down to what you want, e.g. WHERE PrimaryKey = x when you want a specific items details
what is FROM’s purpose?
To identify which table you want to access this data from
What is AND’s purpose?
To add another requirement to the queary and its part of the where function
What is UPDATES function?
To update data, it requires UPDATE which acts like the FROM, SET which is what you are doing to the data, and WHERE which is where the data you want change is
What is DELETE’s function
To delete a row of data, it requires DELETE FROM which acts like the FROM, and WHERE which is where you want the data to be deleted
What is inserts function?
To add data to a table, it requires INSERT INTO which is then followed by the table name like a FROM, and then VALUES and then the data you want adding.
How do you create a table
CREATE TABLE (tableName)(
(fieldName) (dataType)
PRIMARY KEY (fieldName)
)
How do you use ORDER BY
slap it on the end of a queary e.g. ORDER BY (fieldName) ASC -for ascending or DESC for decending-