Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

SQL

QuestionAnswer
SELECT and WHERE SELECT <colName1>, <colName2> FROM <table name> WHERE <colNam3> = <param>
AND/OR SELECT * FROM Persons WHERE LastName='Svendson' AND (FirstName='Tove' OR FirstName='Ola')
ORDER BY SELECT * FROM Persons ORDER BY LastName DESC
INSERT INTO _____ VALUES INSERT INTO Persons VALUES (4,'Nilsen', 'Johan', 'Bakken 2', 'Stavanger') INSERT INTO Persons (P_Id, LastName, FirstName) VALUES (5, 'Tjessem', 'Jakob')
UPDATE _______ SET UPDATE Persons SET Address='Nissestien 67', City='Sandnes' WHERE LastName='Tjessem' AND FirstName='Jakob'
DELETE DELETE FROM table_name WHERE some_column=some_value
TOP SELECT TOP 2 * FROM Persons SELECT TOP 50 PERCENT * FROM Persons ORACLE equiv: SELECT * FROM Persons WHERE ROWNUM <=5
LIKE SELECT * FROM Persons WHERE City LIKE '%tav%' SELECT * FROM Persons WHERE City NOT LIKE '%tav%'
% A substitute for zero or more characters
_ A substitute for exactly one character
[^charlist] or [!charlist] Any single character not in charlist
IN SELECT * FROM Persons WHERE LastName IN ('Hansen','Pettersen')
BETWEEN SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2 SELECT column_name(s) FROM table_name WHERE column_name NOT BETWEEN value1 AND value2
ALIAS For tables: SELECT po.OrderID, p.LastName, p.FirstName FROM Persons AS p, Product_Orders AS po WHERE p.LastName='Hansen' AND p.FirstName='Ola' for columns: SELECT column_name AS alias_name FROM table_name
JOIN or INNER JOIN SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons INNER JOIN Orders ON Persons.P_Id=Orders.P_Id ORDER BY Persons.LastName
LEFT JOIN SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons LEFT JOIN Orders ON Persons.P_Id=Orders.P_Id ORDER BY Persons.LastName
RIGHT JOIN SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons RIGHT JOIN Orders ON Persons.P_Id=Orders.P_Id ORDER BY Persons.LastName
FULL JOIN SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons FULL JOIN Orders ON Persons.P_Id=Orders.P_Id ORDER BY Persons.LastName
UNION (only selects distinct values) SELECT column_name(s) FROM table_name1 UNION SELECT column_name(s) FROM table_name2
UNION ALL SELECT column_name(s) FROM table_name1 UNION ALL SELECT column_name(s) FROM table_name2
INTO SELECT column_name(s) INTO new_table_name [IN externaldatabase] FROM old_tablename SELECT * INTO Persons_Backup IN 'Backup.mdb' FROM Persons
CREATE DATABASE CREATE DATABASE database_name
CREATE TABLE CREATE TABLE Persons ( P_Id int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) )
NOT NULL -- can't update or add new records w/o having value for notnull constrained col, col has to have value CREATE TABLE Persons ( P_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255) )
UNIQUE CREATE TABLE Persons ( P_Id int NOT NULL UNIQUE, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255) )
UNIQUE (multiple columns) CREATE TABLE Persons ( P_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255), CONSTRAINT uc_PersonID UNIQUE (P_Id,LastName) )
UNIQUE (to add after table already created [alter] table) ALTER TABLE Persons ADD UNIQUE (P_Id) for multiple columns: ALTER TABLE Persons ADD CONSTRAINT uc_PersonID UNIQUE (P_Id,LastName)
UNIQUE (to remove constraint) ALTER TABLE Persons DROP CONSTRAINT uc_PersonID
PRIMARY KEY CREATE TABLE Persons ( P_Id int NOT NULL PRIMARY KEY, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255) )
PRIMARY KEY (multiple columns) CREATE TABLE Persons ( P_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255), CONSTRAINT pk_PersonID PRIMARY KEY (P_Id,LastName) )
(To add key after table already created): PRIMARY KEY ALTER TABLE Persons ADD PRIMARY KEY (P_Id) ALTER TABLE Persons ADD CONSTRAINT pk_PersonID PRIMARY KEY (P_Id,LastName)
(To remove constraint): PRIMARY KEY ALTER TABLE Persons DROP CONSTRAINT pk_PersonID
Created by: sjampana920
Popular Engineering sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards