define an attribute
-a piece of information which determines the properties of a field or tag in a database or a string of characters in a display.
define primary key
-an attribute that provides an unique identifier for every entity in a database table
define composite primary key
-a primary key made up of more than one attribute
define foreign key
- the attribute must be a primary key in one table
what is normalisation
5 points
what is first normal form
- the database data is atomic (meaning no single column contains more than one value)
what is second normal form
- no partial dependencies
what is third normal form
why are databases normalised
how do you write a select sql command
SELECT attribute FROM table WHERE condition ORDER BY ASC/DESC
how do you write an update sql command
UPDATE table SET attribute = value WHERE = attribute = value
how do you write a delete sql command
DELETE FROM table WHERE condition
how do you write an insert sql command
INSERT INTO table (column1, column 2 , …) VALUES (vaule1, value2 , …)
how do you define a table with sql
CREATE TABLE Artworks (Title VARCHAR(225), Artist VARCHAR(255), Date YEAR, PRIMARY KEY (Title, Artist))
how do you do an inner join on a sql select statement
SELECT *
FROM table1 INNER JOIN table2
ON table1.column_name= table2.column_name;