SQL Queries

?
  • Created by: arrey
  • Created on: 23-04-19 20:28
Select Query w/ Where
Select FieldName // FROM tablename // WHERE fieldname = condition [AND field2 = condition]
1 of 7
Select Example
SELECT name FROM customers WHERE town = "Birmingham";
2 of 7
Select Query with 2 or more tables - think Join -- EXAMPLE
SELECT Chocolates.name, Chocolates.price // FROM Chocolates INNER JOIN Manufacturer // ON Chocolates.manufacturerName = Manufacturer.manufactuerName (IE we r linking the 2 primary keys of the tables) WHERE ...
3 of 7
Adding New Record
INSERT INTO table_name(column1, column2,...) // VALUES (value1, value2...)
4 of 7
Modifying a Record
UPDATE TableName // SET Field1 = "value1", Field2 = "val2" // WHERE FieldID = x
5 of 7
Deleting a Record
DELETE FROM table_name // WHERE condition;
6 of 7
Deleting a table
DROP TABLE table_name
7 of 7

Other cards in this set

Card 2

Front

Select Example

Back

SELECT name FROM customers WHERE town = "Birmingham";

Card 3

Front

Select Query with 2 or more tables - think Join -- EXAMPLE

Back

Preview of the front of card 3

Card 4

Front

Adding New Record

Back

Preview of the front of card 4

Card 5

Front

Modifying a Record

Back

Preview of the front of card 5
View more cards

Comments

No comments have yet been made

Similar Computing resources:

See all Computing resources »See all Programming resources »