SQL introduction. RHS – SOC 2 Getting data out of databases Databases are ”just” containers of data We could – in principle – just put data in a text.

Slides:



Advertisements
Similar presentations
Why is that LOV in the screen not returning me desired value?
Advertisements

Database Management Systems and Enterprise Software
Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Basic SQL Introduction Presented by: Madhuri Bhogadi.
Murach’s Java SE 6, C21© 2007, Mike Murach & Associates, Inc.Slide 1.
Some Introductory Programming 1. Structured Query Language (SQL) - used for queries. - a standard database product. 2. Visual Basic for Applications -
Databases and Database Management Systems
Information Storage and Retrieval CS French Chapter 3.
Other Features Index and table of contents Macros and VBA.
Relational Database Need to Knows. What is a database? Data - is just a pile of numbers or stats. A business "organises" the data to be meaningful and.
MY SQL Eng: SAHAR. Introduction to SQL What is SQL? When a user wants to get some information from a database file, he can issue a query A query is a.
Introduction to SQL Yong Choi School of Business CSU, Bakersfield.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
SQL Server 2000 Acropolis Institute of Technology and Research Database fundamentals Prepared By: Rahul Patel.
Database A database program is a piece of software to organize and sort information. It creates an electronic list of information that can be sorted very.
Software. Records Fields Each record is made up of fields – categories of information. The fields here are Name, Surname, Address, Telephone and Date.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
Introduction to Computers Lesson 10B. home Database A collection of related data or facts.
Introduction to Computers Lesson 10B. home Database A collection of related data or facts.
Microsoft Access Database Software.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
Database What is a database? A database is a collection of information that is typically organized so that it can easily be storing, managing and retrieving.
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
Chapter 9 Query-by-Example Pearson Education © 2009.
SQL queries subqueries and joining. RHS – SOC 2 SQL query – beyond one table So far, we have only applied queries to a single table It is possible – and.
Advanced Database CS-426 Week 1 - Introduction. Database Management System DBMS contains information about a particular enterprise Collection of interrelated.
CIS 375—Web App Dev II SQL. 2 Introduction SQL (Structured _______ Language) is an ANSI standard language for accessing databases.ANSI SQL can execute.
Computers in the Library A database application. Input and Output Devices Input Keyboard Mouse Scanner / light pen Output VDU / screen / monitor Printer.
SQL queries basics. RHS – SOC 2 SQL query An SQL query is an SQL statement, which specifies a subset of the data in the database A subset in terms of.
Course FAQ’s I do not have any knowledge on SQL concepts or Database Testing. Will this course helps me to get through all the concepts? What kind of.
CIS 375—Web App Dev II SQL. 2 Introduction SQL (Structured _______ Language) is an ANSI standard language for accessing databases.ANSI SQL can execute.
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,
SQL introduction. SWC Getting data out of databases Databases are ”just” containers of data We could – in principle – just put data in a text.
Microsoft Access is a database program to manage sort retrieve group filter for certain records.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Database Management System. DBMS A software package that allows users to create, retrieve and modify databases. A database is a collection of related.
A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows.
SQL.. AN OVERVIEW lecture3 1. Overview of SQL 2  Query: allow questions to be asked of the data and display only the information required. It can include.
Producing a Mail Merged Letter Step 1 Create an Access database for Names and Addresses you can use the ‘Customers’ template in Group Work. Enter the necessary.
Microsoft Access Introduction. What is a database? A DATABASE is a collection of related data.
WEEK# 12 Haifa Abulaiha November 02,
What is Handling Information?.
SQL Introduction to database and SQL. Chapter 1: Databases and Database Users 6 Introduction to Databases Databases touch all aspects of our lives. Examples:
JDBC Java and Databases. SWC – JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 The SqlCommand Object ADO.NET - Lesson 03  Training time: 15 minutes  Author:
The Database Concept and the Database Management System (DBMS) Databases.
Introduction to Database Programming with Python Gary Stewart
DAY 20: ACCESS CHAPTERS 5, 6, 7 Larry Reaves October 28,
Query Methods Simple SQL Statements Start ….
Query Methods Where Clauses Start ….
Query Methods Where Clauses Start ….
Oracle & SQL Introduction
Understand Data Manipulation Language (DML)
Chapter 12 Information Systems.
Understand Data Manipulation Language (DML)
Databases and Information Management
Access Lesson 2 Creating a Database
Developing a Model-View-Controller Component for Joomla Part 3
Database Design and Development
SQL .. An overview lecture3.
Spreadsheets, Modelling & Databases
Chapter 9 Query-by-Example Pearson Education © 2009.
Required queries FdSc inICT Module 107.
Do it now – PAGE 10 You will find your do it now task in your workbook – look for the start button! Sunday, 28 April 2019.
Updating Databases With Open SQL
Query-by-Example Transparencies
Database Management Systems and Enterprise Software
Updating Databases With Open SQL
Presentation transcript:

SQL introduction

RHS – SOC 2 Getting data out of databases Databases are ”just” containers of data We could – in principle – just put data in a text file instead The real strength of databases is the ability to efficiently retrieve a specified subset of data

RHS – SOC 3 Getting data out of databases Suppose we have information about a set of persons: –Name –Address –Date of birth –Occupation –Income –… We wish to find all persons, who are older than 40 years, and have an income of more than $50,000 Is that an easy or hard task…?

RHS – SOC 4 Getting data out of databases NameAddressDate of birthOccupationIncome John None$20,000 Mira Doctor$120,000 Alex Programmer$240,000 Steven Teacher$60,000 Joanne Doctor$90,000 Hannah Nurse$45,000 Susanne None$20,000

RHS – SOC 5 Getting data out of databases NameAddressDate of birthOccupationIncome John None$20,000 Mira Doctor$120,000 Alex Programmer$240,000 Steven Teacher$60,000 Joanne Doctor$90,000 Hannah Nurse$45,000 Susanne None$20,000 ”Older than 40 years”

RHS – SOC 6 Getting data out of databases NameAddressDate of birthOccupationIncome Mira Doctor$120,000 Steven Teacher$60,000 Joanne Doctor$90,000 Susanne None$20,000

RHS – SOC 7 Getting data out of databases NameAddressDate of birthOccupationIncome Mira Doctor$120,000 Steven Teacher$60,000 Joanne Doctor$90,000 Susanne None$20,000 ”Income of more than $50,000”

RHS – SOC 8 Getting data out of databases NameAddressDate of birthOccupationIncome Mira Doctor$120,000 Steven Teacher$60,000 Joanne Doctor$90,000

RHS – SOC 9 Getting data out of databases Pretty easy; we could almost do it just by looking at the table What if we had 100,000 records…? Maybe I could write a small program to pick out the relevant records

RHS – SOC 10 Getting data out of databases for (Records r : recordList) { if ((r.getAge() > 40) and (r.getIncome() > 50000)) { selectedRecords.add(); }

RHS – SOC 11 Getting data out of databases Fine, but… The code is very task-specific; can only solve this specific problem The code might be inefficient; we examine all records to find the specified subset Enter SQL!

RHS – SOC 12 SQL SQL – Structured Query Language A language which enables us to specify subsets of data in a database Subsets in terms of –Tables –Fields –Conditions on fields

RHS – SOC 13 SQL SQL is the standard for database languages It is non-procedural; you specify what data to find, not how to find it Fairly easy to learn and understand

RHS – SOC 14 SQL SQL enables us to –Create databases and tables –Perform ”data management” like inserting, updating and deleting records –Perform queries on data; i.e. retrieve specified subsets of data We concentrate on queries initially

RHS – SOC 15 Exercise The piece of Java code to retrieve records was potentially very inefficient, since all records might be examined in the process 1.Consider how the data in the recordList could be organised, in order to make it more efficient to find all records for persons older than 40 2.Will the improved structure also make the original query more efficient (persons older than 40 and income more than $50,000)?