SQL Flashcards
ALL
*
ANY or no characters
%
Exactly one character
_ (underscore)
Select every record from the table
SELECT * FROM table
Select every record from the table with the name attribute “Bob”
SELECT name(comma) surname FROM table WHERE name = “Bob”
Select every record from the table with the name attribute starting with “B”
SELECT * FROM table WHERE name LIKE “B%”
Deletes the table
DROP TABLE table
Delete the records with the name attribute “Bob”
DELETE FROM table WHERE name = “Bob”
Selects distinct records
SELECT DISTINCT
Insert a record into a table
INSERT INTO Customers (Name (comma) Surname) VALUES (“Bob” (comma) “Smith”)
Select ProductID from Orders table and Address from Customers table where shipped is false
SELECT Orders.ProductID (comma) Customers.Address FROM Orders JOIN Customers ON Orders.CustomerID = Customers.CustomerID Where Shipped = “False”
Update the name of Bob to John in the Customers Table
UPDATE Customers SET Name = “John” Where Name = “Bob”