SQL Reminder Jiankang Yuan Martin Lemke. SQL Reminder - SELECT SELECT column_name1, column_name2, … FROM table_name SELECT * FROM table_name.

Slides:



Advertisements
Similar presentations
Copyright © by Royal Institute of Information Technology Introduction To Structured Query Language (SQL) 1.
Advertisements

Structure Query Language (SQL) COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
Introduction to Oracle9i: SQL1 SQL Group Functions.
1 Introduction to Web Application Introduction to Data Base.
SQL SQL stands for Structured Query Language SQL allows you to access a database SQL is an ANSI standard computer language SQL can execute queries against.
1ISM - © 2010 Houman Younessi Lecture 3 Convener: Houman Younessi Information Systems Spring 2011.
SQL Tutorials To understand some of the topics please analyze the following tutorials: The following tutorials will help:
SQL Basics. SQL SQL (Structured Query Language) is a special-purpose programming language designed from managing data in relational database management.
1 IT420: Database Management and Organization SQL - Data Manipulation Language 27 January 2006 Adina Crăiniceanu
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Introduction to Structured Query Language (SQL) COM S Fall Instructor: Ying Cai Iowa State University 1.
 Mysql – popular open-source database management system  PHP usually works with Mysql for web- based database applications  LAMP applications—Web-based.
MS Access Database Connection. Database? A database is a program that stores data and records in a structured and queryable format. The tools that are.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
SQL: Data Manipulation Presented by Mary Choi For CS157B Dr. Sin Min Lee.
1 TAC2000/ Protocol Engineering and Application Research Laboratory (PEARL) Structured Query Language Introduction to SQL Structured Query Language.
Structure Query Language SQL. Database Terminology Employee ID 3 3 Last name Small First name Tony 5 5 Smith James
Using Special Operators (LIKE and IN)
ACTION QUERIES (SQL COMMANDS ) STRUCTURED QUERY LANGUAGE.
BY SATHISH SQL Basic. Introduction The language Structured English Query Language (SEQUEL) was developed by IBM Corporation, Inc., to use Codd's model.
SQL Unit – 2 Base Knowledge Presented By Mr. R.Aravindhan.
SQL. คำสั่ง SQL SQL stands for Structured Query Language is a standard language for accessing and manipulating databases.
Comp12 cont…. Using Quotes Note that we have used single quotes around the conditional values in the examples. SQL uses single quotes around text values.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
SQL LANGUAGE and Relational Data Model TUTORIAL Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
PHP and Mysql Database. PHP and Database Mysql – popular open-source database management system PHP usually works with Mysql for web-based database applications.
1 IT420: Database Management and Organization SQL part 3 7 February 2006 Adina Crăiniceanu
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
SQL Aggregation Oracle and ANSI Standard SQL Lecture 9.
Introduction to Query Language and SQL. Basic Query Language Operators Selection Projection Join Aggregates –Sum, Count, Max, Min, Avg SubTotal Calculated.
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
INFANL01-3 ANALYSE 3 WEEK 3 March 2015 Institute voor Communication, Media en Informatietechnology.
1 SY306 Web and Databases for Cyber Operations Set #13: SQL SELECT Grouping and sub-queries.
IS6146 Databases for Management Information Systems Lecture 4: SQL IV – SQL Functions and Procedures Rob Gleasure robgleasure.com.
Drill Consider the following tables with the following fields: Student: FName, LName, StudentID, Age, Yr, Course Grades: ID, P1, P2, P3 1.Display the.
April 2002 Information Systems Design John Ogden & John Wordsworth 1 Database Design SQL (1) John Wordsworth Department of Computer Science The University.
Spring 2011 ITCS3160: Database Design and Implementation Hands-on Learning.
SQL LANGUAGE TUTORIAL Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
PHP & MY SQL Instructor: Monireh H. Sayadnavard 1.
SQL SQL Ayshah I. Almugahwi Maryam J. Alkhalifa
How to: SQL By: Sam Loch.
Web Systems & Technologies
SQL Query Getting to the data ……..
Structured Query Language
Lab 13 Databases and SQL.
PHP + MySQL Commands Refresher.
Working with Tables: Join, Functions and Grouping
MS Access Database Connection
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
MENAMPILKAN DATA DARI SATU TABEL (Chap 2)
SQL – Entire Select.
Built in Functions Massaging the data.
Chapter 4 Summary Query.
Database systems Lecture 3 – SQL + CRUD
Access: SQL Participation Project
SQL Queries Chapter No 3.
HAVING,INDEX,COMMIT & ROLLBACK
SQL Aggregation.
Query Functions.
Section 4 - Sorting/Functions
Aggregate Functions.
Build on-the-fly reporting with Dynamic SQL
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
LINQ to SQL Part 3.
Concept of grouping SELECT statement have:
Group Operations Part IV.
Presentation transcript:

SQL Reminder Jiankang Yuan Martin Lemke

SQL Reminder - SELECT SELECT column_name1, column_name2, … FROM table_name SELECT * FROM table_name

SQL Reminder - SELECT IDNameProjectSemester 1PeterGeda5 2PaulEco System9 3MaryGeda7 Table ‚Software_Project‘ Query SELECT Name, Semester FROM Software_Project NameSemester Peter5 Paul9 Mary7 Result: Example

SQL Reminder - WHERE SELECT column_name1, column_name2, … FROM table_name WHERE column_nameX operator value Query SELECT Name, Semester FROM Software_Project WHERE Semester > 5 Result: NameSemester Paul9 Mary7 Example

SQL Reminder – Aggregate Functions AVG() - Returns the average value COUNT() - Returns the number of rows FIRST() - Returns the first value LAST() - Returns the last value MAX() - Returns the largest value MIN() - Returns the smallest value SUM() - Returns the sum etc.

SQL Reminder – GROUP BY SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name Example Query SELECT Project, COUNT(Name) FROM Software_Project WHERE Semester > 4 GROUP BY Project Result: ProjectCOUNT(Name) Geda2 Eco System1 Example Query SELECT Project, COUNT(Name) FROM Software_Project WHERE Semester > 4 GROUP BY Project Example Query SELECT Project, COUNT(Name) FROM Software_Project WHERE Semester > 4 GROUP BY Project Example Query SELECT Project, COUNT(Name) FROM Software_Project WHERE Semester > 4 GROUP BY Project Example Query SELECT Project, COUNT(Name) FROM Software_Project WHERE Semester > 4 GROUP BY Project

SQL Reminder - HAVING SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value Example Query SELECT Project, COUNT(Name) FROM Software_Project WHERE Semester > 4 GROUP BY Project HAVING COUNT(Name) > 1 Result: ProjectCOUNT(Name) Geda2

SQL Reminder – AND, OR, ORDER BY AND & OR Use AND and OR to join more conditions in the WHERE or HAVING clause ORDER BY SELECT column_name(s) FROM table_name ORDER BY column_name(s) ASC|DESC

SQL Reminder – CREATE TABLE CREATE TABLE table_name ( column_name1 data_type, column_name2 data_type, column_name3 data_type,.... ) Example CREATE TABLE seminar ( ID int, Name varchar(255), Topic varchar(255) ) Result IDNameTopic

SQL Reminder – INSERT INTO INSERT INTO table_name VALUES (value1, value2, value3,...) INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...) Example Query INSERT INTO Software_Project VALUES (4, John, News Analysis, 5) Result: IDNameProjectSemester 1PeterGeda5 2PaulEco System9 3MaryGeda7 4JohnNews Analysis5

SQL Reminder - UPDATE UPDATE table_name SET column1=value, column2=value2,... WHERE some_column=some_value Example Query UPDATE Software_Project SET Semester = 17 WHERE Name = ‚John‘ Result: IDNameProjectSemester 1PeterGeda5 2PaulEco System9 3MaryGeda7 4JohnNews Analysis17

SQL Reminder - DELETE DELETE FROM table_name WHERE some_column=some_value Example Query DELETE FROM Software_Project WHERE Project = ‚News Analysis‘ Result: IDNameProjectSemester 1PeterGeda5 2PaulEco System9 3MaryGeda7