what is a database? - city university of new yorknatacha/teachspring_12/csc330/... ·...

23

Upload: others

Post on 30-Jul-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together
Page 2: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

What is a Database?What is a Database?What is a Database?What is a Database?

da·ta·base noun \�dā-tə-�bās, �da- also �dä-\

Definition of DATABASE : a usually large collection of data organized especially for rapid search and retrieval (as by a computer) ( y p )

Page 3: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Components of a DatabaseComponents of a DatabaseComponents of a DatabaseComponents of a Database

Components of a Database include tables containing a variety of data and functions that have to ability to y yaccess and manipulate the data sources.

Page 4: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Advantages of Using Advantages of Using D bD bDatabasesDatabases

It means all of the information is together.

The information can be portable if on a laptop. p p p

The information is easy to access at any time.

I ' il i bl It's more easily retrievable.

Many people can access the same database at the same time.

Improved data security.

Reduced data entry storage and retrieval costs Reduced data entry, storage, and retrieval costs.

Page 5: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Disadvantages of Using Disadvantages of Using D bD bDatabasesDatabases

Database systems are complex, difficult, and time-consuming to design.

Initial training required for all programmers and users.

Suitable hardware and software start up costs Suitable hardware and software start-up costs.

A longer running time for individual applications.

Page 6: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

SQL?SQL?SQL?SQL?

SQL stands for Structured/Sequential Query Language and is the international standard for g gdatabase manipulation.

Page 7: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

SQL Connection StringSQL Connection StringSQL Connection StringSQL Connection String

The sql connection string consists of specific information about the data source and the means to connect to it. Pre-installed connection drivers code the connection from the program to the data source.

Example of how to connect to a data source using Visual Studios will be provided.

Page 8: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

SQL QueriesSQL QueriesSQL QueriesSQL Queries

Pre-Installed Drivers allow executable Queries to be made to the database to add, modify, access and , y,remove data from the data sources. This queries can be implemented in the classes, at the User-End of the Program or directly in the databaseProgram or directly in the database.

Page 9: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Examples of SQL QueriesExamples of SQL QueriesExamples of SQL QueriesExamples of SQL Queries

Insert into Books values (‘1984’,’George Orwell’, ‘Fiction’, 9100001, ‘Secker and Warburg’, ‘7/21/1950’,910, ‘OUT’,NULL, 0.15,21,13.99);, , , , , , );

This executable Query enters a series of information to a database into a table called ‘Books’

Page 10: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Tables in a DatabaseTables in a DatabaseTables in a DatabaseTables in a DatabasePrimary Key

Names of the columns in the database table

Page 11: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Information in a DatabaseInformation in a DatabaseInformation in a DatabaseInformation in a Database

Information in the columns in the database table

Column Title

Table DataTable Data

Page 12: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

.NET Framework.NET Framework.NET Framework.NET Framework

The .Net Framework is a platform created by Microsoft as a programming model to ease the p g gbuilding of applications for various purposes.

Page 13: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Components of the Components of the N F kN F k.Net Framework.Net Framework

Common Language Runtime

Base Class Libraries

Development frameworks and technologies

Page 14: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

ADO.NETADO.NETADO.NETADO.NET

ADO.Net is a suite of classes that make data access from a variety of sources such as Microsoft SQL y QServer, OLE DB, and XML. ADO.Net allows data to be retrieved, stored and modified from these sources.

This presentation will focus on the SQL Server p Qimplementation of a database application

Page 15: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Database DevelopmentDatabase Development(T Ti T Ti )(T Ti T Ti )(To Tier or not Two Tier)(To Tier or not Two Tier)

Depending on personal programming preference, desired design or encapsulation needs, the g p ,programming of a database can be what is considered Two-Tiered or Multi-Tiered.

Page 16: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

TwoTwo--TieredTieredTwoTwo TieredTiered

A Two Tiered programming design connects the database directly to the application for user access. y ppGiving the user direct access to modify or insert stored data. The first tier refers to the user-end portion of the program (The GUI) and the second tier refers to the program (The GUI) and the second tier refers to the database itself.

Page 17: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

MultiMulti--TieredTieredMultiMulti TieredTiered

Unlike the Two-Tiered approach to database access, the multi-tiered design for database implementation g psets up the databases in classes and not directly though the User-End interface. This method takes longer to set up but provides better encapsulation and security set-up but provides better encapsulation and security for the databases, only allowing prompted access for the end users.

The multi-tiered approach is commonly used in the business environment where data privacy is crucial.

Page 18: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

C# vs. JavaC# vs. JavaC# vs. JavaC# vs. Java

Methods of database access are similar, and when accessing databases using both languages and each g g g glanguage requires:

• Database Drivers

• Database Connections

• SQL Queries

H h i l d However, the syntax to implement and access a database are different for both languages.

Page 19: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Implementing a Database Implementing a Database i JAVAi JAVAusing JAVAusing JAVA

Page 20: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Implementing a Database Implementing a Database U i C#U i C#Using C#Using C#

Page 21: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

Database ImplementationDatabase ImplementationDatabase ImplementationDatabase Implementation

*Presentation of the creation of a database application in Visual Studios

Page 22: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

References References References References

http://www.microsoft.com/net/

http://msdn.microsoft.com/en-us/library/aa286484.aspx

http://www.w3schools.com/sql/default.asp

http://dictionary.reference.com/browse/database

Page 23: What is a Database? - City University of New Yorknatacha/TeachSpring_12/CSC330/... · 2012-04-11 · Advantages of Using DbDatabases ZIt means all of the information is together

--FINFINFINFIN