SECTION 5 L1 - Group By and Having Clauses

Size: px
Start display at page:

Download "SECTION 5 L1 - Group By and Having Clauses"

Transcription

1 SECTION 5 L1 - Group By and Having Clauses Clauza Group By 1. SELECT department_id, AVG(salary),MAX(salary) 2. SELECT job_id, last_name, AVG(salary) GROUP BY job_id; ORA-00979: not a GROUP BY expression 3. SELECT count(first_name), shirt_color FROM students GROUP BY shirt_color 4. WHERE last_name <> King 5. SAU SELECT count(*), shirt_color FROM students GROUP BY shirt_color SELECT AVG(media), specializare FROM studenti WHERE data-absolvire >= 01-JUN-2010 GROUP BY specializare; 6. SELECT COUNT(prenume), an_studiu FROM studenti GROUP BY an_studiu;

2 In clauza SELECT putem avea: - Functii de grup ( dar nu statistice) - Cimpuri ( care trebuie sa apara si in clauza GROUP BY) Clauza WHERE : Filtreaza inregistrarile asupra carora va actiona SELECT Clauza GROUP BY: - Nu poate contine alias de cimp/coloana Grupuri si subgrupuri (maxim 2) SELECT department_id, job_id, count(*) WHERE department_id > 40 GROUP BY department_id, job_id; Clauza Having Doar grupurile ce respecta conditia mentionata in clauza HAVING vor fi returnate WHERE COUNT(*) > 1 ORA-00934: group function is not allowed here HAVING COUNT(*) >1; Ordinea clauzelor in instructiunea SELECT: SELECT column, group_function FROM table WHERE GROUP BY HAVING ORDER BY

3 SECTION 5, L2 extensii ale clauzei GROUP BY: Rollup - genereaza subtotaluri la nivel de grup si un total general SELECT department_id, job_id, SUM(salary) GROUP BY ROLLUP (department_id, job_id) Cube genereaza rapoarte cross-tabulate ( la nivel de subgroup / grup /raport) SELECT department_id, job_id, SUM(salary) GROUP BY CUBE (department_id, job_id) GROUPING SETS similar cu utilizarea mai multor clause GROUP BY in aceeasi instructiune SELECT. SELECT department_id, job_id, manager_id, SUM(salary) GROUP BY GROUPING SETS ( (job_id, manager_id), (department_id, job_id), (department_id, manager_id)); Functia GROUPING(coloana/cimp), utilizata in clauza SELECT Furnizeaza 2 valori: - 1 daca in inregistrarea returnata coloana/cimpul este calculate - 0 in cazul unui cimp simplu

4 SELECT department_id, job_id, SUM(salary), GROUPING(department_id) Dept_sub_total, GROUPING(job_id) job_sub_total, GROUP BY CUBE (department_id, job_id); SELECT depart_id, job_id, SUM(salary), DECODE(GROUPING(depart_id),1,'DeptAggr row',depart_id) AS DT, DECODE(GROUPING(job_id),1,'JobID Aggr row',job_id) AS JI WHERE depart_id < 50 GROUP BY CUBE (depart_id, job_id);

5 SELECT cimp1,cimp2 FROM tabel1 <operator> SELECT cimp1,cimp2 FROM tabel2 SECTION 5 L3 operatorii Set UNION, UNION ALL, INTERSECT, MINUS * unde cimp1 si cimp2 trebuie sa fie de acelasi tip si acelasi nume in ambele tabele SELECT department_name "Department", TO_CHAR(NULL) "Warehouse" FROM departments UNION SELECT TO_CHAR(NULL) "Department", warehouse_name FROM warehouses; * clauza ORDER BY poate fi utilizata doar in al 2-lea SELECT SELECT hire_date (1), employee_id (2), to_date(null) start_date (3), to_date(null) end_date (4) UNION SELECT to_date(null )(1),employee_id (2),start_date (3),end_date (4) FROM job_history ORDER BY employee_id;

Intermediate SQL: Aggregated Data, Joins and Set Operators

Intermediate SQL: Aggregated Data, Joins and Set Operators Intermediate SQL: Aggregated Data, Joins and Set Operators Aggregated Data and Sorting Objectives After completing this lesson, you should be able to do the following: Identify the available group functions

More information

Using the Set Operators. Copyright 2004, Oracle. All rights reserved.

Using the Set Operators. Copyright 2004, Oracle. All rights reserved. Using the Set Operators Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Describe set operators Use a set operator to combine

More information

Using the Set Operators. Copyright 2006, Oracle. All rights reserved.

Using the Set Operators. Copyright 2006, Oracle. All rights reserved. Using the Set Operators Objectives After completing this lesson, you should be able to do the following: Describe set operators Use a set operator to combine multiple queries into a single query Control

More information

EXISTS NOT EXISTS WITH

EXISTS NOT EXISTS WITH Subquery II. Objectives After completing this lesson, you should be able to do the following: Write a multiple-column subquery Use scalar subqueries in SQL Solve problems with correlated subqueries Update

More information

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved. Restricting and Sorting Data Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort the rows that are retrieved by a query Use

More information

Laborator 5 Instrucțiunile repetitive

Laborator 5 Instrucțiunile repetitive Laborator 5 Instrucțiunile repetitive Instrucțiunea for Instrucțiunea for permite repetarea unei secvențe de instrucțiuni atâta timp cât o condiție este îndeplinita. În plus, oferă posibilitatea execuției

More information

DUE: 9. Create a query that will return the average order total for all Global Fast Foods orders from January 1, 2002, to December 21, 2002.

DUE: 9. Create a query that will return the average order total for all Global Fast Foods orders from January 1, 2002, to December 21, 2002. CIS 207 Oracle - Database Programming and SQL HOMEWORK: # 10 DUE: Run the following queries in Oracle Application Express. Paste a copy of each query Into this word document below the questions or notepad.txt

More information

Database Foundations. 6-4 Data Manipulation Language (DML) Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Foundations. 6-4 Data Manipulation Language (DML) Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Foundations 6-4 Roadmap You are here Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control

More information

Alkérdések II. Copyright 2004, Oracle. All rights reserved.

Alkérdések II. Copyright 2004, Oracle. All rights reserved. Alkérdések II. Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Write a multiple-column subquery Use scalar subqueries in SQL

More information

CREATE TABLE COUNTRIES (COUNTRY_ID CHAR(2), COUNTRY_NAME VARCHAR2(40), REGION_ID NUMBER(4)); INSERT INTO COUNTRIES VALUES ('CA','Canada',2); INSERT INTO COUNTRIES VALUES ('DE','Germany',1); INSERT INTO

More information

Manipulating Data. Copyright 2004, Oracle. All rights reserved.

Manipulating Data. Copyright 2004, Oracle. All rights reserved. Manipulating Data Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Describe each data manipulation language (DML) statement

More information

KORA. RDBMS Concepts II

KORA. RDBMS Concepts II RDBMS Concepts II Outline Querying Data Source With SQL Star & Snowflake Schemas Reporting Aggregated Data Using the Group Functions What Are Group Functions? Group functions operate on sets of rows to

More information

Retrieving Data from Multiple Tables

Retrieving Data from Multiple Tables Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Database Lab (ECOM 4113) Lab 5 Retrieving Data from Multiple Tables Eng. Mohammed Alokshiya November 2, 2014 An JOIN clause

More information

What Are Group Functions? Reporting Aggregated Data Using the Group Functions. Objectives. Types of Group Functions

What Are Group Functions? Reporting Aggregated Data Using the Group Functions. Objectives. Types of Group Functions What Are Group Functions? Group functions operate on sets of rows to give one result per group. Reporting Aggregated Data Using the Group Functions Maximum salary in table Copyright 2004, Oracle. All rights

More information

Utilizarea formularelor in HTML

Utilizarea formularelor in HTML Utilizarea formularelor in HTML Formulare Un formular este constituit din elemente speciale, denumite elemente de control (controls), cum ar fi butoane radio, butoane de validare, câmpuri text, butoane

More information

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved. Restricting and Sorting Data Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL

More information

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 4 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA

More information

ÇALIŞMA TEST SORULARI

ÇALIŞMA TEST SORULARI 1. A table has the following definition: EMPLOYEES( EMPLOYEE_ID NUMBER(6) NOT NULL, LAST_NAME VARCHAR2(10) NOT NULL, MANAGER_ID VARCHAR2(6)) and contains the following rows: (1001, 'Bob Bevan', '200')

More information

HR Database. Sample Output from TechWriter 2007 for Databases

HR Database. Sample Output from TechWriter 2007 for Databases Table of Contents...3 Tables... 4 COUNTRIES... 5 DEPARTMENTS... 6 EMPLOYEES... 7 JOBS... 9 JOB_HISTORY... 10 LOCATIONS...12 REGIONS...13 Views...14 EMP_DETAILS_VIEW... 15 Procedures...17 SECURE_DML...18

More information

Join, Sub queries and set operators

Join, Sub queries and set operators Join, Sub queries and set operators Obtaining Data from Multiple Tables EMPLOYEES DEPARTMENTS Cartesian Products A Cartesian product is formed when: A join condition is omitted A join condition is invalid

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 4-3 Objectives This lesson covers the following objectives: Demonstrate the use of SYSDATE and date functions State the implications for world businesses to be able to easily

More information

School of Computing and Information Technology Session: Spring CSCI835 Database Systems (Bridging Subject) Sample class test 23 July 2018

School of Computing and Information Technology Session: Spring CSCI835 Database Systems (Bridging Subject) Sample class test 23 July 2018 School of Computing and Information Technology Session: Spring 2018 University of Wollongong Lecturer: Janusz R. Getta CSCI835 Database Systems (Bridging Subject) Sample class test 23 July 2018 THE QUESTIONS

More information

CONFIGURAREA UNUI SERVER IRC IN LINUX. Bica Bogdan *

CONFIGURAREA UNUI SERVER IRC IN LINUX. Bica Bogdan * CONFIGURAREA UNUI SERVER IRC IN LINUX Bica Bogdan * In this exemple i show how to configure an irc server based on ircd dameon named ircu.this is the main file name ircd.conf and the most important.configure

More information

DEFAULT Values, MERGE, and Multi-Table Inserts. Copyright 2009, Oracle. All rights reserved.

DEFAULT Values, MERGE, and Multi-Table Inserts. Copyright 2009, Oracle. All rights reserved. DEFAULT Values, MERGE, and Multi-Table Inserts What Will I Learn? In this lesson, you will learn to: Understand when to specify a DEFAULT value Construct and execute a MERGE statement Construct and execute

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

Bsc (Hons) Software Engineering. Examinations for / Semester 1. Resit Examinations for BSE/15A/FT & BSE/16A/FT

Bsc (Hons) Software Engineering. Examinations for / Semester 1. Resit Examinations for BSE/15A/FT & BSE/16A/FT Bsc (Hons) Software Engineering Cohort: BSE/16B/FT Examinations for 2017-2018 / Semester 1 Resit Examinations for BSE/15A/FT & BSE/16A/FT MODULE: DATABASE APPLICATION DEVELOPMENT MODULE CODE: DBT2113C

More information

Fişiere in C++ Un fişier este o colecţie de date indicat printr-un nume şi o extensie. Numele este desparţit de extensie prin punct.

Fişiere in C++ Un fişier este o colecţie de date indicat printr-un nume şi o extensie. Numele este desparţit de extensie prin punct. Fişiere in C++ Un fişier este o colecţie de date indicat printr-un nume şi o extensie. Numele este desparţit de extensie prin punct. Avantajul lucrului cu fisiere este evident, datele rezultate în urma

More information

Understanding GROUP BY and how ROLLUP/CUBE functions work

Understanding GROUP BY and how ROLLUP/CUBE functions work USE master; GO Understanding GROUP BY and how ROLLUP/CUBE functions work IF EXISTS (SELECT name FROM sys.databases WHERE name = N'Rollup_Cube_Example') BEGIN ALTER DATABASE [Rollup_Cube_Example] SET SINGLE_USER

More information

Laborator 8 Java Crearea claselor de obiecte. Variabilele (campurile) clasei de obiecte

Laborator 8 Java Crearea claselor de obiecte. Variabilele (campurile) clasei de obiecte Laborator 8 Java Crearea claselor de obiecte. Variabilele (campurile) clasei de obiecte Probleme rezolvate: Scrieti, compilati si rulati toate exemplele din acest laborator: 1. Programul urmator (LotoConstante.java)

More information

Lenuta Alboaie Reţele de calculatoare

Lenuta Alboaie Reţele de calculatoare Programarea in retea - OOB- Lenuta Alboaie adria@info.uaic.ro 1 Cuprins Trimiterea si receptarea datelor in regim 2 Ideea: in timpul unei conexiuni cind sunt transmise date ( inband data ), si daca la

More information

Additional Practice Solutions

Additional Practice Solutions Additional Practice Solutions Additional Practices Solutions The following exercises can be used for extra practice after you have discussed the data manipulation language (DML) and data definition language

More information

Rezolvarea exceptiilor

Rezolvarea exceptiilor PL/SQL SECTIUNE 6 Rezolvarea exceptiilor Entering an incorrect username and/or password Forgetting to include the @ in an email address Entering a credit card number incorrectly Entering an expiration

More information

Course Overview. Copyright 2010, Oracle and/or its affiliates. All rights reserved.

Course Overview. Copyright 2010, Oracle and/or its affiliates. All rights reserved. Course Overview Course Objectives After completing this course, you should be able to do the following: Manage application navigation by using hierarchical lists with images, database-driven navigation,

More information

Reporting Aggregated Data Using the Group Functions. Copyright 2004, Oracle. All rights reserved.

Reporting Aggregated Data Using the Group Functions. Copyright 2004, Oracle. All rights reserved. Reporting Aggregated Data Using the Group Functions Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Identify the available

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

Data Manipulation Language

Data Manipulation Language Manipulating Data Objectives After completing this lesson, you should be able to do the following: Describe each data manipulation language (DML) statement Insert rows into a table Update rows in a table

More information

Limit Rows Selected. Copyright 2008, Oracle. All rights reserved.

Limit Rows Selected. Copyright 2008, Oracle. All rights reserved. What Will I Learn? In this lesson, you will learn to: Apply SQL syntax to restrict the rows returned from a query Demonstrate application of the WHERE clause syntax Explain why it is important, from a

More information

Táblák tartalmának módosítása. Copyright 2004, Oracle. All rights reserved.

Táblák tartalmának módosítása. Copyright 2004, Oracle. All rights reserved. Táblák tartalmának módosítása Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Describe each data manipulation language (DML)

More information

1. Să se determine de câte ori apare cifra c în scrierea în baza p a numărului n.

1. Să se determine de câte ori apare cifra c în scrierea în baza p a numărului n. Observatii: Codul de mai jos a fost realizat si testat pe pagina online: https://www.tutorialspoint.com/compile_pascal_online.php 1. Să se determine de câte ori apare cifra c în scrierea în baza p a numărului

More information

SELF TEST. List the Capabilities of SQL SELECT Statements

SELF TEST. List the Capabilities of SQL SELECT Statements 98 SELF TEST The following questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully because there might be more than one correct answer.

More information

School of Computing and Information Technology. Examination Paper Autumn Session 2017

School of Computing and Information Technology. Examination Paper Autumn Session 2017 School of Computing and Information Technology CSIT115 Data Management and Security Wollongong Campus Student to complete: Family name Other names Student number Table number Examination Paper Autumn Session

More information

Fisa de lucru: Studiul componentelor calculatorului

Fisa de lucru: Studiul componentelor calculatorului 11.3.7 Fisa de lucru: Studiul componentelor calculatorului Imprimati si completati aceasta activitate. In aceasta activitate veti folosi Internet-ul, un ziar, sau un magazin local pentru a culege informatii

More information

1Z0-007 ineroduction to oracle9l:sql

1Z0-007 ineroduction to oracle9l:sql ineroduction to oracle9l:sql Q&A DEMO Version Copyright (c) 2007 Chinatag LLC. All rights reserved. Important Note Please Read Carefully For demonstration purpose only, this free version Chinatag study

More information

Proiectarea Rețelelor 32. Controlul modelelor de trafic in retea prin alterarea atributelor BGP

Proiectarea Rețelelor 32. Controlul modelelor de trafic in retea prin alterarea atributelor BGP Platformă de e-learning și curriculă e-content pentru învățământul superior tehnic Proiectarea Rețelelor 32. Controlul modelelor de trafic in retea prin alterarea atributelor BGP De ce ebgp? De ce ibgp?

More information

Sun Certified MySQL Associate

Sun Certified MySQL Associate 310-814 Sun Certified MySQL Associate Version 3.1 QUESTION NO: 1 Adam works as a Database Administrator for a company. He creates a table named Students. He wants to create a new table named Class with

More information

CHAPTER. Advanced Queries

CHAPTER. Advanced Queries CHAPTER 7 Advanced Queries 183 184 Oracle Database 11g SQL I n this chapter, you will see how to Use the set operators, which allow you to combine rows returned by two or more queries. Use the TRANSLATE()

More information

Tehnici avansate de programare

Tehnici avansate de programare Tehnici avansate de programare Curs - Cristian Frăsinaru acf@infoiasi.ro Facultatea de Informatică Universitatea Al. I. Cuza Iaşi Adnotarea elementelor Tehnici avansate de programare p.1/1 Cuprins Ce sunt

More information

Ingineria Sistemelor de Programare. UML Diagrama Cazurilor de Utilizare 2016

Ingineria Sistemelor de Programare. UML Diagrama Cazurilor de Utilizare 2016 Ingineria Sistemelor de Programare UML Diagrama Cazurilor de Utilizare mihai.hulea@aut.utcluj.ro 2016 Introducere UML UML UML = Unified Modeling Language Dezvoltat in cadrul Object Management Group In

More information

Se cer 2 variante: una cu implementarea statica si a doua cu implementarea dinamica a structurilor de date necesare. Comentati variantele.

Se cer 2 variante: una cu implementarea statica si a doua cu implementarea dinamica a structurilor de date necesare. Comentati variantele. Lucrarea 1 SDA 03.04.2017 Sa se realizeze urmatoarele programe, in limbaj C: 1. Se primesc de la intrarea standard: un numar k si un sir infinit de numere naturale a i. Se afiseaza la iesirea standard,

More information

RETRIEVING DATA USING THE SQL SELECT STATEMENT

RETRIEVING DATA USING THE SQL SELECT STATEMENT RETRIEVING DATA USING THE SQL SELECT STATEMENT Course Objectives List the capabilities of SQL SELECT statements Execute a basic SELECT statement Development Environments for SQL Lesson Agenda Basic SELECT

More information

Database Programming with PL/SQL

Database Programming with PL/SQL Database Programming with PL/SQL 3-2 Objectives This lesson covers the following objectives: Recognize the SQL statements that can be directly included in a PL/SQL executable block Construct and execute

More information

Oracle Database SQL Basics

Oracle Database SQL Basics Oracle Database SQL Basics Kerepes Tamás, Webváltó Kft. tamas.kerepes@webvalto.hu 2015. február 26. Copyright 2004, Oracle. All rights reserved. SQL a history in brief The relational database stores data

More information

Displaying Data from Multiple Tables. Copyright 2004, Oracle. All rights reserved.

Displaying Data from Multiple Tables. Copyright 2004, Oracle. All rights reserved. Displaying Data from Multiple Tables Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data

More information

CS 275 Winter 2011 Problem Set 3

CS 275 Winter 2011 Problem Set 3 CS 275 Winter 2011 Problem Set 3 Run the following quires in Oracle Application Express where appropriate. Cut and paste your query for each applicable question. For short answer or multiple choice type

More information

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables INDEX Exercise No Title 1 Basic SQL Statements 2 Restricting and Sorting Data 3 Single Row Functions 4 Displaying data from multiple tables 5 Creating and Managing Tables 6 Including Constraints 7 Manipulating

More information

Appendix B: Table Descriptions

Appendix B: Table Descriptions Appendix B: Table Descriptions Schema Descriptions Overall Description Oracle Database sample schemas portray a sample company that operates worldwide to fill orders for several different products. The

More information

Alocarea memoriei în C sub Linux

Alocarea memoriei în C sub Linux Costel Aldea Alocarea memoriei în C sub Linux Sunt trei funcţii C standard care se pot folosi pentru a aloca memorie: malloc(), calloc(), si realloc(). Prototipurile lor, după cum sunt definite în stdlib.h:

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 2-1 Objectives This lesson covers the following objectives: Apply the concatenation operator to link columns to other columns, arithmetic expressions, or constant values to

More information

Design activities. Session III. 1. Topology. - Selecting and placing devices - Interconnecting devices

Design activities. Session III. 1. Topology. - Selecting and placing devices - Interconnecting devices Design activities Session I 1. Topology - Selecting and placing devices - Interconnecting devices 2. Providing connectivity between directly connected devices - Configuring addresses for servers and hosts

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 3-2 Objectives This lesson covers the following objectives: Construct a query to sort a result set in ascending or descending order State the order in which expressions are

More information

PNI SmartCAM. versiune Android. - manual de utilizare-

PNI SmartCAM. versiune Android. - manual de utilizare- PNI SmartCAM versiune Android - manual de utilizare- Introducere: Acest manual se refera la instalarea si utilizarea aplicatiei PNI SmartCAM, software necesar monitorizarii atat camerei cu IP PNI 631W,

More information

Aggregate Functions. Eng. Mohammed Alokshiya. Islamic University of Gaza. Faculty of Engineering. Computer Engineering Dept. Database Lab (ECOM 4113)

Aggregate Functions. Eng. Mohammed Alokshiya. Islamic University of Gaza. Faculty of Engineering. Computer Engineering Dept. Database Lab (ECOM 4113) Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Database Lab (ECOM 4113) Lab 4 Aggregate Functions Eng. Mohammed Alokshiya October 26, 2014 Unlike single-row functions, group

More information

Instructiuni de control

Instructiuni de control Instructiuni de control Introducerea caracterelor de la tastatura Instructiuni de selectie (if, switch) Instructiuni repetitive (for, while, dowhile, foreach) Instructiuni de salt (break, continue, goto,

More information

insert update delete INSERT, UPDATE DELETE

insert update delete INSERT, UPDATE DELETE DECLANŞATOARE Un declanşator (trigger) este o procedură care este executată în mod implicit când asupra tabelului asociat se execută o comandă insert, update sau delete. Declanşatoarele sunt medii prin

More information

Laborator 10. SGBD-ul MySQL (partea I)

Laborator 10. SGBD-ul MySQL (partea I) Laborator 10 SGBD-ul MySQL (partea I) 1. Introduceţi următoarea secvenţă PHP: $dbh = mysql_connect("localhost", "Costica", "mypass") or die("unable to connect to MySQL"); $selectdb = mysql_select_db('lucrudb');

More information

LECTURE10: DATA MANIPULATION IN SQL, ADVANCED SQL QUERIES

LECTURE10: DATA MANIPULATION IN SQL, ADVANCED SQL QUERIES LECTURE10: DATA MANIPULATION IN SQL, ADVANCED SQL QUERIES Ref. Chapter5 From Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. 1 IS220: D a

More information

Lecture10: Data Manipulation in SQL, Advanced SQL queries

Lecture10: Data Manipulation in SQL, Advanced SQL queries IS220 / IS422 : Database Fundamentals : Data Manipulation in SQL, Advanced SQL queries Ref. Chapter5 Prepared by L. Nouf Almujally & Aisha AlArfaj College of Computer and Information Sciences - Information

More information

Using DbVisualizer Variables

Using DbVisualizer Variables Using DbVisualizer Variables DbVisualizer variables are used to build parameterized SQL statements and let DbVisualizer prompt you for the values when the SQL is executed. This is handy if you are executing

More information

CONCAT SUBSTR LOWER (*) All three will be evaluated simultaneously. Correct

CONCAT SUBSTR LOWER (*) All three will be evaluated simultaneously. Correct 1. You query the database with this SQL statement: SELECT CONCAT(last_name, (SUBSTR(LOWER(first_name), 4))) Default Password FROM employees; Which function will be evaluated first? CONCAT SUBSTR LOWER

More information

Introducere in Maven. Information Type: Working Standard, Disclosure Range:, Information Owner: mihai.hulea, NTT DATA Romania

Introducere in Maven. Information Type: Working Standard, Disclosure Range:, Information Owner: mihai.hulea, NTT DATA Romania Introducere in Maven Build management tools Java build tools: Maven Gradle Ant + Ivy Build tools are programs that automate the creation of executable applications from source code. Building incorporates

More information

Proiectarea bazelor de date

Proiectarea bazelor de date Universitatea Constantin Brâncuşi din Târgu-Jiu Facultatea de Inginerie Departamentul de Automatică, Energie şi Mediu Proiectarea bazelor de date Lect.univ.dr. Adrian Runceanu 19.03.2013 Proiectarea bazelor

More information

Oracle Database 10g: SQL Fundamentals II

Oracle Database 10g: SQL Fundamentals II D17111GC30 Edition 3.0 January 2009 D57874 Oracle Database 10g: SQL Fundamentals II Student Guide Volume 2 Authors Salome Clement Chaitanya Koratamaddi Priya Vennapusa Technical Contributors and Reviewers

More information

Exam: 1Z Title : Introduction to Oracle9i: SQL. Ver :

Exam: 1Z Title : Introduction to Oracle9i: SQL. Ver : Exam: 1Z0-007 Title : Introduction to Oracle9i: SQL Ver : 05.14.04 QUESTION 1 A: This query uses "+" to create outer join as it was in Oracle8i, but it requires also usage of WHERE clause in SELECT statement.b:

More information

Memorator funcţii predefinite C++ Funcţii matematice

Memorator funcţii predefinite C++ Funcţii matematice Funcţii matematice Funcţia Prototipul funcţiei Fişierul pow(x,y) double pow (double x,double y); long double pow ( long double x, long double y); float pow (float x,float y); double pow (double x, int

More information

Série n 6 Bis : Ateliers SQL Data Modeler (Oracle)

Série n 6 Bis : Ateliers SQL Data Modeler (Oracle) Série n 6 Bis : Ateliers SQL Data Modeler (Oracle) Getting started with data Modeler Adding a Table to An Existing Database Purpose This tutorial shows you how to add a table to an existing database using

More information

Rezolvare fişă de laborator Java Iniţiere în limbajul Java

Rezolvare fişă de laborator Java Iniţiere în limbajul Java Rezolvare fişă de laborator Java Iniţiere în limbajul Java Ex 1: Scrie următorul program Java folosind JCreator apoi încercă să-l înţelegi. public class primulprg System.out.println("Acesta este primul

More information

Ingineria Sistemelor de Programare

Ingineria Sistemelor de Programare Ingineria Sistemelor de Programare Interfete grafice (Swing) mihai.hulea@aut.utcluj.ro 2017 Scurt istoric AWT: Abstract Windowing Toolkit import java.awt.* Swing Java FX Swing Demo Libraria Swing Swing

More information

Assignment Grading Rubric

Assignment Grading Rubric Final Project Outcomes addressed in this activity: Overview and Directions: 1. Create a new Empty Database called Final 2. CREATE TABLES The create table statements should work without errors, have the

More information

Oracle9i: Advanced SQL

Oracle9i: Advanced SQL Oracle9i: Advanced SQL Student Guide Volume 1 40058GC11 Production 1.1 November 2001 D34074 Authors Priya Nathan Technical Contributors and Reviewers Josephine Turner Martin Alvarez Anna Atkinson Don Bates

More information

Îmbunătăţiri aduse în limbajul C++ facilităţilor standard ale limbajului C (cele care nu ţin de conceptele programării orientate obiect).

Îmbunătăţiri aduse în limbajul C++ facilităţilor standard ale limbajului C (cele care nu ţin de conceptele programării orientate obiect). Îmbunătăţiri aduse în limbajul C++ facilităţilor standard ale limbajului C (cele care nu ţin de conceptele programării orientate obiect). Supraîncărcarea numelui de funcţii (overloading) In C nu este permisa

More information

Testing Masters Technologies

Testing Masters Technologies 1. What is Data warehouse ETL TESTING Q&A Ans: A Data warehouse is a subject oriented, integrated,time variant, non volatile collection of data in support of management's decision making process. Subject

More information

Exam : 1Z Title : Introduction to Oracle9i: SQL

Exam : 1Z Title : Introduction to Oracle9i: SQL Exam : 1Z0-007 Title : Introduction to Oracle9i: SQL Ver : 01-15-2009 QUESTION 1: Examine the data in the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20

More information

Creating Other Schema Objects

Creating Other Schema Objects Creating Other Schema Objects Objectives After completing this lesson, you should be able to do the following: Create simple and complex views Retrieve data from views Database Objects Object Table View

More information

Introduction to Oracle9i: SQL

Introduction to Oracle9i: SQL Introduction to Oracle9i: SQL Additional Practices Volume 3 40049GC11 Production 1.1 October 2001 D33992 Authors Nancy Greenberg Priya Nathan Technical Contributors and Reviewers Josephine Turner Martin

More information

Oracle Database: SQL Fundamentals I. Oracle Internal & Oracle Academy Use Only. Volume II Student Guide. D64258GC10 Edition 1.0 January 2010 D65028

Oracle Database: SQL Fundamentals I. Oracle Internal & Oracle Academy Use Only. Volume II Student Guide. D64258GC10 Edition 1.0 January 2010 D65028 D64258GC10 Edition 1.0 January 2010 D65028 Oracle Database: SQL Fundamentals I Volume II Student Guide Authors Salome Clement Brian Pottle Puja Singh Technical Contributors and Reviewers Anjulaponni Azhagulekshmi

More information

2. What privilege should a user be given to create tables? The CREATE TABLE privilege

2. What privilege should a user be given to create tables? The CREATE TABLE privilege Practice 1: Solutions To complete question 6 and the subsequent questions, you need to connect to the database using isql*plus. To do this, launch the Internet Explorer browser from the desktop of your

More information

RMOUG Training Days 2018

RMOUG Training Days 2018 RMOUG Training Days 2018 Pini Dibask Product Manager for Database Tools February 22 nd, 2018 Oracle Database Locking Mechanism Demystified About the Speaker Pini Dibask, Product Manager for Database Tools,

More information

GIFT Department of Computing Science. CS-217/224: Database Systems. Lab-5 Manual. Displaying Data from Multiple Tables - SQL Joins

GIFT Department of Computing Science. CS-217/224: Database Systems. Lab-5 Manual. Displaying Data from Multiple Tables - SQL Joins GIFT Department of Computing Science CS-217/224: Database Systems Lab-5 Manual Displaying Data from Multiple Tables - SQL Joins V3.0 5/5/2016 Introduction to Lab-5 This lab introduces students to selecting

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 12-2 Objectives In this lesson, you will learn to: Construct and execute an UPDATE statement Construct and execute a DELETE statement Construct and execute a query that uses

More information

ITCertMaster. Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way!

ITCertMaster.  Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way! ITCertMaster Safe, simple and fast. 100% Pass guarantee! http://www.itcertmaster.com IT Certification Guaranteed, The Easy Way! Exam : 1Z0-870 Title : MySQL 5.0, 5.1 and 5.5 Certified Associate Exam Vendors

More information

Database Programming with PL/SQL

Database Programming with PL/SQL Database Programming with PL/SQL Trapping Oracle Server Exceptions 1 Copyright 2013, Oracle and/or its affiliates. All rights Objectives This lesson covers the following objectives: Describe and provide

More information

Probleme propuse pentru Testul de Laborator Semestrul I

Probleme propuse pentru Testul de Laborator Semestrul I Probleme propuse pentru Testul de Laborator Semestrul I Problema 1: Scrieti un program in C pentru rezolvarea ecuatiei de gradul 1 cu coeficienti reali. Valorile coeficientilor se citesc de la tastatura.

More information

Operatii pop si push-stiva

Operatii pop si push-stiva Operatii pop si push-stiva Aplicatia realizata in Microsoft Visual Studio C++ 2010 permite simularea operatiilor de introducere si extragere a elementelor dintr-o structura de tip stiva.pentru aceasta

More information

Database Foundations. 6-9 Joining Tables Using JOIN. Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Database Foundations. 6-9 Joining Tables Using JOIN. Copyright 2014, Oracle and/or its affiliates. All rights reserved. Database Foundations 6-9 Roadmap Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML Transaction Control Language (TCL)

More information

Lucrarea nr. 2. Funcţii şi structuri în C++

Lucrarea nr. 2. Funcţii şi structuri în C++ Lucrarea nr. 2 Funcţii şi structuri în C++ Pe măsură ce programele cresc in complexitate şi dimensiune, ele trebuiesc împărţite în fragmente mai mici şi mai uşor de gestionat numite funcţii. Funcţiile

More information

Oracle Database 10g: SQL Fundamentals II

Oracle Database 10g: SQL Fundamentals II Oracle Database 10g: SQL Fundamentals II Electronic Presentation D17111GC11 Production 1.1 August 2004 D39754 Author Priya Vennapusa Technical Contributors and Reviewers Brian Boxx Andrew Brannigan Zarko

More information

DBMS Practice 1 http://use-the-index-luke.com/ 2 Join 3 Join An SQL query walks into a bar and sees two tables. He walks up to them and asks Can I join you? Source: Unknown Join-ul transforms data from

More information

1. Funcţii referitoare la o singură înregistrare (single-row functions)

1. Funcţii referitoare la o singură înregistrare (single-row functions) Laborator 4 Limbajul SQL 1. Funcţii referitoare la o singură înregistrare (single-row functions) 2. Funcţii referitoare la mai multe înregistrări (multiple-row functions) 1. Funcţii referitoare la o singură

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 6-4 Objectives This lesson covers the following objectives: Construct and execute a SELECT statement to join a table to itself using a self-join Interpret the concept of a

More information