What are the 4 query statements?
SQL command for creating a table:
CREATE TABLE
explain what this statement executes: first_name CHAR (30) NULL,
why must the key field in a database always have a NOT NULL statement?
it must always have a value
for example: key INT IDENTITY (1001, 1) NOT NULL,
) ;
explain what this statement executes:
key INT IDENTITY (1001, 1) NOT NULL,
) ;
what is VARCHAR and why is it used?
stores a set of alphanumeric data (letters and numbers) as a variable string
why isn’t always the case that VARCHAR uses less memory space?
there could be a minimum length
what statement is used to add data?
INSERT INTO
explain what this statement does:
INSERT INTO Name, ID, DOB VALUES (Jim, NULL, NULL)
inserts the value Jim as the name and no values for the ID and DOB
explain what this means: WHERE ID (less than sign and the greater than sign) 10
(wouldn’t let me show it)
choose data that is not equal to 10 (less than sign and the greater than sign means not equal to)
Key point
you must add data in the same given order as the rows in the table. if you don’t know the data for a row, you would assign it to NULL
what is the statement to edit/ update data in table?
UPDATE
what happens if the WHERE clause is left out?
all record will be affected (edited)
statement for retrieving data:
SELECT
SELECT * FROM table1 means select everything in table1