1 / 9

ΕΠΛ 3 42 – Βάσεις Δεδομένων

ΕΠΛ 3 42 – Βάσεις Δεδομένων. Εργαστήριο 5 ο SQL - Queries Ιωάννα Συρίμη syrimi@ucy.ac.cy. SELECT. SELECT JOB FROM EMP SELECT DISTINCT JOB FROM EMP. SELECT. SELECT COUNT(*) FROM STUDENTS SELECT MAX(SAL), MIN(SAL) FROM EMPLOYEES. SELECT. SELECT DEPT_ID,

terryrice
Download Presentation

ΕΠΛ 3 42 – Βάσεις Δεδομένων

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ΕΠΛ 342 – Βάσεις Δεδομένων Εργαστήριο 5ο SQL - Queries Ιωάννα Συρίμη syrimi@ucy.ac.cy

  2. SELECT SELECT JOB FROM EMP SELECTDISTINCT JOB FROM EMP ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

  3. SELECT SELECT COUNT(*) FROM STUDENTS SELECT MAX(SAL), MIN(SAL) FROM EMPLOYEES ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

  4. SELECT SELECT DEPT_ID, MAX(SALARY), MIN(SALARY) FROM EMPLOYEES GROUP BY DEPT_ID ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

  5. SELECT SELECT DEPT_NAME, MAX(SALARY), MIN(SALARY) FROM EMPLOYEES E, DEPARTMENTS D WHERE D.DEPT_ID = E.DEPT_ID GROUP BY DEPT_ID  ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

  6. SELECT SELECT MAX(DEPT_NAME), MAX(SALARY), MIN(SALARY) FROM EMPLOYEES E, DEPARTMENTS D WHERE D.DEPT_ID = E.DEPT_ID GROUP BY DEPT_ID  ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

  7. SELECT SELECT DEPT_NAME, MAX(SALARY), MIN(SALARY) FROM EMPLOYEES E, DEPARTMENTS D WHERE D.DEPT_ID = E.DEPT_ID GROUP BY DEPT_NAME ORDER BY DEPT_NAME  ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

  8. SELECT SELECT DEPT_NAME, COUNT(*) NO_EMPLOYEES MAX(SALARY) MAX_SALARY, MIN(SALARY)MIN_SALARY FROM EMPLOYEES E, DEPARTMENTS D WHERE D.DEPT_ID = E.DEPT_ID GROUP BY DEPT_NAME HAVING COUNT(*) > 5 ORDER BY COUNT(*) DESC ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

  9. Ομαδικές Συναρτήσεις (GroupsFunctions) • COUNT ([DISTINCT], n) / COUNT(*) • SUM ([DISTINCT], n) • MAX ([DISTINCT], n) • MIN ([DISTINCT], n) • AVG([DISTINCT], n) • VARIANCE ([DISTINCT], n) • STDDEV ([DISTINCT], n) ΕΠΛ342-Βάσεις Δεδομένων6/1/2020

More Related