Quick tips Flashcards

1
Q

When doing union , except , intersect operations :
. same number of attributes
. corresponding attributes have same domain

Use aliases to ensure attrbutes you want to union have same name( eg if you had pharmacy(name), pharmacy_name) change one of them so that the names are the same

Example on back of flashcard

A

(SELECT SSN
FROM EMPLOYEE)
EXCEPT
(SELECT ESSN as SSN <— - alias used to ensure same name
FROM WORKS_ON
WHERE PNO=1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

INSERT INTO <table name>
VALUES <tuple></tuple>

A

INSERT INTO EMPLOYEE
VALUES (‘Richard’,’K’,’Marini’,’653298653’,
‘30-DEC-52’,’98 Oak Forest,Katy,TX’,
‘M’, 37000,’987654321’, 4)

same order as attributes in table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly