SQL Queries Flashcards
1
Q
Insert command
A
INSERT INTO EMPLOYEE (name, age, etc)
VALUES (‘Richard’, 25, etc)
or
INSERT INTO EMPLOYEE (name, age, etc)
SELECT name, age, etc
FROM tempemployee
WHERE age > 25
2
Q
Create table following template
A
CREATE TABLE HELLO LIKE BONJOUR
(SELECT
FROM
WHERE)
WITH DATA;
3
Q
DELETE
A
DELETE FROM EMPLOYEE
WHERE Lname=’Richard’;
4
Q
UPDATE
A
UPDATE PROJECT
SET Plocation=’Bellaire’, Dnum=5
WHERE Pnumber=10;
5
Q
Give all employees in research department a 10% increase
A
UPDATE EMPLOYEE
SET SALARY=SALARY*1.1
WHERE Do IN(SELECT DNUMBER
FROM DEPARTMENT
WHERE DNAME=’Research’);
6
Q
Create a view
A
CREATE VIEW blah blah AS
SELECT
FROM
WHERE