select distinct select list selectfrom from list

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CT [DISTINCT] select-list selectFROM from-list fromWHERE qualification; ALTER TABLE Students CHANGE SSN ID CHAR(9); (Changes name of SSN column to ID; possibly also changed type.) ALTER TABLE Students CHANGE ID ID INTEGER; (Changes type of the ID column.) 31 31 32 Query Evaluation Query Examples (Q1) Conceptually: 1. 2. 3. 4. Compute cross-product of tables in from-list. crossfromDelete rows that fail qualification. Delete columns not in select-list. selectIf DISTINCT, delete duplicate rows. Find names of sailors who have reserved boat number 103. SELECT DISTINCT S.sname FROM Sailors S, Reserves R WHERE S.sid=R.sid AND R.bid=103; S.sid= R.bid=103; SELECT DISTINCT sname FROM Sailors, Reserves WHERE Sailors.sid=Reserves.sid AND bid=103; Sailors.sid= 33 Query Examples (continued) (Q1) Query Examples (continued) (Q1) Find the names of sailors who have reserved boat 103. Find the names of sailors who have reserved boat 103. Can be done using EXISTS: Can be done as nested query: SELECT S.sname FROM Sailors S W...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern