Visual C# 2012 How to Program ©1992-2014 by Pearson Education, Inc. All Rights Reserved.

Slides:



Advertisements
Similar presentations
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Advertisements

 2003 Prentice Hall, Inc. All rights reserved. Chapter 22 – Database: SQL, MySQL, DBI and ADO.NET Outline 22.1 Introduction 22.2 Relational Database Model.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
 Pearson Education, Inc. All rights reserved Accessing Databases with JDBC.
1 Introduction to Web Application Introduction to Data Base.
Querying a Database Microsoft Office Access 2003.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ 1 Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
Exercise SELECT authorID, lastName FROM authors AuthorID FirstName
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
CORE 2: Information systems and Databases STORAGE & RETRIEVAL 2 : SEARCHING, SELECTING & SORTING.
Chapter 10 - VB.Net by Schneider1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Relational Databases and SQL.
Java Database Connectivity (JDBC). Introduction Database –Collection of data DBMS –Database management system –Storing and organizing data SQL –Relational.
1 Microsoft Access 2002 Tutorial 3 – Querying a Database.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 25 – Database: SQL, ADO and RDS Outline 25.1Introduction 25.2Relational Database Model 25.3Relational.
ASP.NET Programming with C# and SQL Server First Edition
Intro to JDBC To effectively use Java Data Base Connectivity we must understand: 1.Relational Database Management Systems (RDBMS) 2.JDBC Drivers 3.SQL.
 2008 Pearson Education, Inc. All rights reserved Database: SQL, MySQL, ADO.NET 2.0 and Java DB.
Chapter 10 Queries and Updating Part C. SQL Copyright 2005 Radian Publishing Co.
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
 2003 Prentice Hall, Inc. All rights reserved. 1 Java Database Connectivity with JDBC TM.
CIS 270—Application Development II Chapter 25—Accessing Databases with JDBC.
Introduction to SQL Steve Perry
Pemrograman VisualMinggu …10… Page 1 MINGGU Ke Sepuluh Pemrograman Visual Pokok Bahasan: ADO.NET II Tujuan Instruksional Khusus: Mahasiswa dapat menjelaskan.
CHAPTER 8 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
Database: SQL and MySQL
1 Databases November 15, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel, and Goldberg. Published.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
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)
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Relational Database. Database Management System (DBMS)
Databases MIS 21. Some database terminology  Database: integrated collection of data  Database Management System (DBMS): environment that provides mechanisms.
Ch Determine the output displayed from procedures Lab sheet 10.4.
Database Management Systems.  Database management system (DBMS)  Store large collections of data  Organize the data  Becomes a data storage system.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved. 2 Revised by Dr. T. Tran for CSI3140.
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
 2008 Pearson Education, Inc. All rights reserved Database: SQL, MySQL, ADO.NET 2.0 and Java DB.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 22 - SQL, MySQL, DBI and ADO Outline 22.1 Introduction 22.2 Relational Database Model 22.3 Relational.
Mining real world data RDBMS and SQL. Index RDBMS introduction SQL (Structured Query language)
 2009 Pearson Education, Inc. All rights reserved Databases and LINQ to SQL.
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ – Exercises 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg,
Database: SQL, MySQL, LINQ and Java DB © by Pearson Education, Inc. All Rights Reserved.
LINQ to DATABASE-2.  Creating the BooksDataContext  The code combines data from the three tables in the Books database and displays the relationships.
Manipulating Data Lesson 3. Objectives Queries The SELECT query to retrieve or extract data from one table, how to retrieve or extract data by using.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 5: SQL I Rob Gleasure robgleasure.com.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
COM621: Advanced Interactive Web Development Lecture 11 MySQL – Data Manipulation Language.
1 Finding Your Way Through a Database Exploring Microsoft Office Access.
ORDER BY Clause The result of a query can be sorted in ascending or descending order using the optional ORDER BY clause. The simplest form of.
Fundamentals of DBMS Notes-1.
Database, SQL and ADO.NET
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Database Programming in Java
 2012 Pearson Education, Inc. All rights reserved.
LINQ to DATABASE-2.
JDBC.
Databases Intro (from Deitel)
Chapter 4 Relational Databases
Chapter 22 - SQL, MySQL, DBI and ADO
LINQ to DATABASE-2.
Database Design and Development
Introduction To Structured Query Language (SQL)
Manipulating Data Lesson 3.
Presentation transcript:

Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.

 Database:  Organized integrated collection of data  Database management system (DBMS)  Provides mechanisms for storing and organizing data  Allows storage and access to database, without knowledge of internal representation  Relational Databases popular  Use Structured Query Language (SQL) to perform queries (search) and manipulate data  Programming languages need an interface to interact with relational databases

6  Logical representation of data:  Relationships can be considered without concern for physical structure of data  Composed of tables

© by Pearson Education, Inc. All Rights Reserved.

8  Rule of Entity Integrity: every record must have a unique value in its primary-key field  Compound Primary key: when a record has a unique key based on a combination of two fields  Foreign key:  Field for which every entry has a unique value in another table and where the field in the other table is the primary key for that table  Rule of Referential Integrity: every foreign-key field value must appear in another table’s primary-key field  One to many relationship: A foreign key can appear many times in its own table, but only once as primary key in another table

© by Pearson Education, Inc. All Rights Reserved. New sets made from queries called result sets Result set formed by selecting Department and Location data from the Employee table.

© by Pearson Education, Inc. All Rights Reserved.

18  Used to request data (perform queries) and manipulate data

19

20  Extracts information from one or more tables in a database  Format:  Basic: SELECT * FROM tableName  * extracts all columns  To get specific fields use a comma separated list instead of *  Example: SELECT * FROM Authors

21 SELECT * FROM Authors

22  Used to specify certain criteria in a query  Basic form:  SELECT * FROM tableName WHERE criteria  Example:  SELECT * FROM Titles WHERE copyright > 1999  Can use LIKE clause  Used for pattern matching  Uses wildcards *: zero or more characters take its place ?: exactly one character takes its place

23

24

25  Used to arrange results of a query  Can be ascending or descending order  Uses ASC and DESC respectively  Example: SELECT * FROM Authors ORDER BY lastName ASC  Can be used to sort by multiple fields

26

27

28  INNER JOIN  Merges records from multiple tables into a single record  Tests for matching values in a common field  General Form: SELECT * FROM table1 INNER JOIN table2 ON table1.fieldName=table2.fieldName  Fully-qualified names use the table name and dot operator followed by the field name  Example: SELECT firstName, isbn FROM Authors INNER JOIN AuthorISBN ON Authors.authorID= AuthorISBN.authorID

29

30  Tables produced by INNER JOIN can be used as arguments for another INNER JOIN

31 TitleAuthor query of Books database. Join Publishers and Titles tables if the publisherID matches Join Authors and AuthorISBN if authorID matches Join two created tables if titlesISBN matches authorsISBN Sort new table by title

32 Part 1

33  Inserts a new record into a table  General Form: INSERT INTO tableName(fieldName1) VALUES (value1)  Values must match field names in order and type  Example: INSERT INTO Authors (firstName, lastName) VALUES (‘Sue’, ‘Smith’)

34

35  Modifies data in a table  Form: UPDATE tableName SET fieldName1 = value1 WHERE criteria  Example : UPDATE Authors SET lastName = ‘Jones’ WHERE lastName = ‘Smith’ AND firstName = ‘Sue’

36

37  Removes data from a table  Form: DELETE FROM tableName WHERE criteria  Example: DELETE FROM Authors WHERE lastName = ‘Jones’ AND firstName = ‘Sue’

38