CS 111 – Nov. 8 Databases Database Management Systems (DBMS) Structured Query Language (SQL) Commitment –Please review sections 9.1 – 9.2.

Slides:



Advertisements
Similar presentations
Sorting Rows. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –Construct a query to sort a results set in ascending.
Advertisements

4 Copyright © 2004, Oracle. All rights reserved. Reporting Aggregated Data Using the Group Functions.
4 การใช้ SQL Functions. Copyright © 2007, Oracle. All rights reserved What Are Group Functions? Group functions operate on sets of rows to give.
Chapter 8 Special-Purpose Languages. SQL SQL stands for "Structured Query Language". Allows the user to pose complex questions of a database. It also.
This course has taken from This unique introductory SQL tutorial not only provides easy-to-understand SQL instructions, but it allows.
30-Jun-15 SQL A Brief Introduction. SQL SQL is Structured Query Language Some people pronounce SQL as “sequel” Other people insist that only “ess-cue-ell”
CHAPTER 3 DATABASES AND DATA WAREHOUSES. 3-2 STUDENT LEARNING OUTCOMES 1.Describe business intelligence and its role 2.Compare databases and data warehouses.
Introduction to Structured Query Language (SQL)
Attribute databases. GIS Definition Diagram Output Query Results.
Concepts of Database Management Sixth Edition
Database terms Mr. Brunton.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Introduction to Databases. Overview  What is a Database?  What is a Database Management System?  How is information organized in a database?  What.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
Chapter 15: Using LINQ to Access Data in C# Programs.
MS Access Tour Sesión # 6. MS Access Tour Database Management System (DBMS): An application software that allows users to create, manipulate, and change.
HAP 709 – Healthcare Databases SQL Data Manipulation Language (DML) Updated Fall, 2009.
Database Queries. Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be.
CS 111 – Nov. 10 Structured Query Language (SQL) –We’ve already seen simple select statements, with optional “where” clause and aggregate functions. –More.
4 Copyright © 2004, Oracle. All rights reserved. Reporting Aggregated Data Using the Group Functions.
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
Unit 6 Data Storage Design. Key Concepts 1. Database overview 2. SQL review 3. Designing fields 4. Denormalization 5. File organization 6. Object-relational.
Structured Query Language. Group Functions What are group functions ? Group Functions Group functions operate on sets of rows to give one result per group.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
Nitin Singh/AAO RTI ALLAHABAD 1 SQL Nitin Singh/AAO RTI ALLAHABAD 2 OBJECTIVES §What is SQL? §Types of SQL commands and their function §Query §Index.
CS 1308 Computer Literacy and the Internet
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
MS Access. Access is a DBMS/RDMS DBMS = Database Management System RDMS = Relational Database Management System.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 7 Introduction to Structured Query Language (SQL)
Visual Programing SQL Overview Section 1.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
1 Querying a Single Table Structured Query Language (SQL) - Part II.
Queries SELECT [DISTINCT] FROM ( { }| ),... [WHERE ] [GROUP BY [HAVING ]] [ORDER BY [ ],...]
DATA RETRIEVAL WITH SQL Goal: To issue a database query using the SELECT command.
Database Basics BCIS 3680 Enterprise Programming.
Introduction to Functions – Single Row Functions.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
Working with Columns, Characters, and Rows. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –Apply the concatenation.
9-1 © Prentice Hall, 2007 Topic 9: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 9 Vocabulary Databases. 1.Table – a collection of information, or data arranged in columns and rows. 2.Record – all of the information about one.
1 MySQL and SQL. 2 Topics  Introducing Relational Databases  Terminology  Managing Databases MySQL and SQL.
IS6146 Databases for Management Information Systems Lecture 4: SQL IV – SQL Functions and Procedures Rob Gleasure robgleasure.com.
Oracle & SQL. Oracle Data Types Character Data Types: Char(2) Varchar (20) Clob: large character string as long as 4GB Bolb and bfile: large amount of.
Aggregating Data Using Group Functions. What Are Group Functions? Group functions operate on sets of rows to give one result per group.
Database Presentation BIM, Mrs. Bailey. **Database Notes** Use new sheet of paper! Microsoft Access - known as a database management system or DBMS Database.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
2b. Create an Access Database Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis with Spreadsheets 1.
SQL SQL Ayshah I. Almugahwi Maryam J. Alkhalifa
Rob Gleasure robgleasure.com
Database Management  .
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
ORACLE SQL Developer & SQLPLUS Statements
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Database Queries.
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
PHPMyAdmin.
PHP and MySQL.
Prof: Dr. Shu-Ching Chen TA: Haiman Tian
Reporting Aggregated Data Using the Group Functions
Reporting Aggregated Data Using the Group Functions
Reporting Aggregated Data Using the Group Functions
Aggregate functions Objective- understand and able to use aggregate functions in select statement Aggregate functions are used to implement calculation.
分组函数 Schedule: Timing Topic 35 minutes Lecture 40 minutes Practice
Chapter Name SQL: Data Manipulation
Aggregating Data Using Group Functions
SQL (Structured Query Language)
Presentation transcript:

CS 111 – Nov. 8 Databases Database Management Systems (DBMS) Structured Query Language (SQL) Commitment –Please review sections 9.1 – 9.2.

Database A file containing 1+ tables Table = 2-d arrangement of data into rows and columns –Rows correspond to “records” – info about 1 customer, 1 student, 1 animal, 1 house, whatever –Columns correspond to “fields” – individual attributes about each record. For example, name, address, phone number, ID number, $ amount

DBMS “Data Base Management System” Software that allows us to manipulate a database file. Most often, we want to query the database. Examples: –Microsoft Access –Open Office Base –phpMyAdmin –Oracle –Datatel SQL = Structured Query Language –All DBMS support SQL –We use SQL to communicate with the database.

SQL “Structured Query Language” DBMS accepts commands written in this language, so we can manipulate the database file. DBMS may actually have point-&-click shortcut features to save time on tedious tasks, such as entering all the data, or creating tables from scratch. Most common SQL command is the “select” statement, which asks the DBMS to return some of the data in the database. Examples: –Show me everybody’s address –How many employees make over $100,000 ?

How to begin Create the database file Create first table: specify its format –For each field (column), it needs a name, data type and maximum length. –Common data types are: –Int/number –Date –Varchar (“variable-length character string”). Here you must specify a maximum length, such as 20 characters. –Sometimes, you may want to indicate whether a field is required, must have unique values, etc. Enter data into the table. Make queries about the table.

Example FirstLastLocationTitleSalary PeterJacobsBrusselsBroker55000 DeniseLambertBrusselsAccountant42500 RobertNijsBrusselsBroker66700 RuthMolloyChicagoManager68650 DeclanMurphyChicagoAccountant84125 SusanPattersonChicagoEconomist51000 RachelBradyCincinnatiBroker43300 DavidCunninghamCincinnatiAccountant48000 JohnWhelanCincinnatiBroker60500 YvonneButlerSan DiegoBroker48500 VeronicaKeatingSan DiegoBroker72000 MaryWalshDublinAccountant46850 An Employee table:

The select statement Very commonly used in SQL. Some possible formats: select columns from table; select * from table; select columns from table where condition; Examples: select First, Last from Employee; select Last, Location, Salary from Employee; select Last, Salary from Employee where Salary >= 70000; select * from Employee where Location = “Dublin”; select * from Employee where Last like “M%”;

Aggregate functions In SQL, we can ask questions that involve arithmetic, such as finding the max, min, avg of numerical values. select max(Salary) from Employee; select min(Salary), max(Salary) from Employee; select avg(Salary) from Employee where Location = “Chicago”; select avg(Salary) from Employee where Title = “Broker”;