Using Database: A very, very short introduction..

Slides:



Advertisements
Similar presentations
Introduction to SQL, OleDB interface to Access from VB.NET.
Advertisements

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.
Introduction to Database Processing with ADO.NET.
Chapter 8 Special-Purpose Languages. SQL SQL stands for "Structured Query Language". Allows the user to pose complex questions of a database. It also.
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
CSC 2720 Building Web Applications Database and SQL.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
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.
Introduction to SQL Steve Perry
Simple Database.
Chapter 15: Using LINQ to Access Data in C# Programs.
Python MySQL Database Access
Web Services Week 8 Aims: –Using web services as front ends to databases Objectives: –Review of relational databases –Connecting to and querying databases.
HAP 709 – Healthcare Databases SQL Data Manipulation Language (DML) Updated Fall, 2009.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Instructor: Dema Alorini Database Fundamentals IS 422 Section: 7|1.
Chapter 10: The Data Tier We discuss back-end data storage for Web applications, relational data, and using the MySQL database server for back-end storage.
ADO.NET Data Access. Page  2 SQL  When we interact with the datasource through ADO.NET we use the SQL language to retrieve,modify,update information.
CS 1308 Computer Literacy and the Internet
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
SQL Unit – 2 Base Knowledge Presented By Mr. R.Aravindhan.
Oracle & SQL Introduction. Database Concepts Revision DB? DBMS? DB Application? Application Programs? DBS? Examples of DBS? Examples of DBMS? 2Oracle.
Information Building and Retrieval Using MySQL Track 3 : Basic Course in Database.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
SQL Basic. What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database.
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.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
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,
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
SQL. Originally developed by IBM Standardized in 80’s by ANSI and ISO Language to access relational database and English-like non-procedural Predominant.
 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.
SQL Introduction SQL stands for “Structured Query Language” and can be pronounced as “SQL” or “sequel – (Structured English.
Fundamental of Database Systems
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
DBMS and SQL.
Data Access with ADO.NET
Accessing Databases using Ado.net
Introduction to Database Processing with ADO.NET
Chapter 15 Using a Database.
Web Systems & Technologies
Module T03d Software Engineering
Query Methods Simple SQL Statements Start ….
Database Access with SQL
Introduction to Database Processing with ADO.NET
ADO.NET Framework.
Programming the Web Using ASP.Net
Introduction to Structured Query Language(SQL)
ICT Database Lesson 1 What is a Database?.
MS Access Database Connection
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Browser (Client Side) 瀏覽器 (客戶端)
PHP and MySQL.
SQL Queries Chapter No 3.
Introduction To Structured Query Language (SQL)
Database SQL.
Lecuter-1.
Unit – V Data Controls.
Presentation transcript:

Using Database: A very, very short introduction.

No more play This camp is not a game-programming camp! We should try for more serious programming.

With database engine, we can: Store lots of data Do complex search over data And... most important:  Write better games!

Reference Most part of this note is from Wikipedia.

SQLSQL SQL stands for "Structured Query Language." It operates on databases with table structures. A few notable commands:  SELECT  INSERT  UPDATE  DELETE

Plan for the day Morning:  Using SELECT to query data Afternoon:  Manipulating data with INSERT, UPDATE, DELETE

Database ~ Tables A table is a collection of rows. Each row contains a set of columns, called fields.

Table structure Each row (or record) contains a set of fields, each of which is of a specific data type.

A very simple database We will use only one table! It is a movie show time database, from movieseer. (thanks a lot!)

SELECT Syntax:  SELECT [ DISTINCT ] FROM [ WHERE ] [ ORDER BY ] What's that mean?  SELECT FROM ;  SELECT FROM WHERE ;  SELECT DISTINCT FROM WHERE ;  SELECT FROM WHERE ORDER BY ;

How could we use this fancy SQL command in C#? Database Engine with SQL capability  MySQL, Access, SQL Server, etc. A bunch of objects:  xxxDbConnection  xxxDbCommand  xxxDbDataReader

Connecting to Access We need to use Microsoft JET OLEDB. We use  System.Data.OleDb.OleDbConnection With the following connection string:  Provider=Microsoft.JET.OLEDB.4.0; Data source=

OleDbCommand Properties:  CommandText Example: cmd.CommandText = "SELECT DISTINCT theater FROM showtime"; OleDbDataReader reader = cmd.ExecuteReader(); while(reader.Read()) { // your data is in reader["theater"] } reader.Close();

More SQL Commands INSERT UPDATE DELETE

INSERT Syntax:  INSERT INTO ( ) VALUES ( ) Example:  INSERT INTO showtime (movie,theater,time) VALUES ('The Programmer', 'KAMPANGSAN-SF', #20:00:0#)

UPDATE Syntax:  UPDATE SET =, =,... WHERE Example:  UPDATE showtime SET movie="Sad City" WHERE movie = "Sin City";

DELETE Syntax:  DELETE FROM WHERE ; Example:  DELETE FROM showtime WHERE movie like "Star%";