2. SQL and tables
A database contains one or more data structures called 'tables'. A table is made up of one or more columns called 'fields' and a number of rows. Each row is a 'record'.
A statement or command in SQL is called a query. Queries are formed from the built in commands in SQL.
SQL contains a number of commands to manage data, these include
Some SQL commands |
---|
CREATE TABLE - create an empty table |
DROP - delete a table or even a complete database |
INSERT - insert a row into a table |
UPDATE - alter data in a row |
SELECT - retrieve data from the database, more than one table can be accessed in the query. |
WHERE sets up one or more conditions to filter the query |
AND allows more than one condition to be included |
FROM identifies the table to be used |
There are quite a few more commands available as well which you may find worthwhile exploring online.
Challenge see if you can find out one extra fact on this topic that we haven't already told you
Click on this link: What is SQL