Wiley 978-0-7645-8894-5 Datasheet

Browse online or download Datasheet for Software manuals Wiley 978-0-7645-8894-5. Wiley Beginning Visual Basic 2005 Databases User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 30
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
1
Databases
Most Visual Basic 2005 applications that you write use data in some form or fashion. Where you
retrieve that data from depends on what your application is doing. One of the most common types
of applications that you are likely to write is a database application, which retrieves and processes
data from a database.
Although there are different kinds of databases and different manufacturers, the databases that
you are most likely to encounter are Microsoft Access, Microsoft SQL Server, and Oracle. This
chapter explores the components that make up each of these common databases at a high level to
help you gain a better understanding of how they work.
To help you understand how databases are put together, you look also at relational database
design. This topic describes the relationships between the different tables in your database and
how they can be designed for optimal performance.
At the end of the chapter, you build the sample databases that are used throughout the rest of this
book. You’ll be using these databases to perform the Try It Out exercises in each of the chapters.
In this chapter, you:
Learn which components make up a Microsoft Access database
Learn which components make up a Microsoft SQL Server database
Learn which components make up an Oracle database
Learn about relational database design
Build the sample databases used throughout the rest of this book
04_58894x ch01.qxd 10/13/05 5:54 PM Page 1
COPYRIGHTED MATERIAL
Page view 0
1 2 3 4 5 6 ... 29 30

Summary of Contents

Page 1 - COPYRIGHTED MATERIAL

1DatabasesMost Visual Basic 2005 applications that you write use data in some form or fashion. Where youretrieve that data from depends on what your a

Page 2 - Access Databases

Stored proceduresA stored procedure in Oracle is functionally equivalent to a stored procedure in SQL Server and stores asingle or group of SQL statem

Page 3 - SQL Server Databases

Each table in your database represents an object about your business, and each column in a table represents an attribute of the object that the table

Page 4 - Data files

You’ll also notice that the field names have been defined using Pascal casing. Pascal casing is where thefirst letter of each word is in uppercase, su

Page 5

❑ The first normal form eliminates repeating groups of data in a table. You create a separate tablefor each set of related data and identify each tabl

Page 6

Second normal formThe rule for the second normal form dictates that you must create separate tables for sets of values thatapply to multiple records a

Page 7 - Oracle Databases

Building the Case Study DatabasesIn the rest of this book, you use some sample databases to work through the exercises in the chapters.These sample da

Page 8

Figure 1-6If you choose to create your own Access database instead of using the sample Access database availablefrom the Wrox Web site, you can follow

Page 9

Try It Out Creating the ProjectTimeTracker Access Database1.Start Microsoft Access by clicking Start on the taskbar and then clicking Run.2. In the Ru

Page 10 - Relational Database Design

Table 1-6: Projects Table FieldsField Name Data Type Data Type AttributesProjectID Number Field Size = Replication ID, Required =Yes, Indexed = Yes (N

Page 11 - Databases

19. In the Show Table dialog box, select all three tables and click the Add button. Then click theClose button to close the Show Table dialog box.20.

Page 12 - Normalization

Access DatabasesAccess databases are common and can be found on most computers, especially if the sample databaseswere installed along with Microsoft

Page 13

SQL Server schemaThe Access schema was small compared to the SQL Server schema shown in Figure 1-8. You will bedoing a limited amount of work on the P

Page 14 - Chapter 1

Figure 1-8The steps in the following Try It Out assume that the physical database, ProjectTimeTracker, has beencreated by you or your DBA and that you

Page 15 - Access schema

4. Click Change next to the Data Source field and in the Change Data Source dialog box, selectMicrosoft SQL Server and then click OK.5. In the Add Con

Page 16

14. At this point, all of your tables have been created and their primary keys have been set. You needto add the foreign key relationships between you

Page 17

17. Click the Add button in the Foreign Key Relationships dialog box to add another relationship.In the Properties window, click the Tables and Column

Page 18

Oracle schemaThe Oracle schema, shown in Figure 1-12, is similar to the SQL Server schema shown in Figure 1-8. Theonly differences between these schem

Page 19

Figure 1-12GroupsGroupIDGroupNameGroupDescriptionLastUpdateDateNot NullNot NullNullNot NullChar(36)VarChar2(50)ClobDateUsersUserIDLoginNamePasswordFir

Page 20 - SQL Server schema

Try It Out Creating the ProjectTimeTracker Oracle Database1.Start SQL Plus or your favorite third-party tool for running SQL scripts against an Oracle

Page 21

Ranking number(3) NOT NULL,LastUpdateDate date NOT NULL );CREATE TABLE TimeSheets (TimeSheetID char(36) NOT NULL,UserID char(36) NOT NULL,WeekEndingDa

Page 22

(CONSTRAINT PK_TimeSheets PRIMARY KEY (TimeSheetID));ALTER TABLE TimeSheetItems ADD (CONSTRAINT PK_TimeSheetItems PRIMARY KEY (TimeSheetItemID));4. Fi

Page 23

Name and Last Name. These two fields in a single record describe the name of a single person, as illus-trated in Figure 1-1.Figure 1-1QueriesA query i

Page 24

SummaryThis chapter has been quite diverse, covering the major components that make up an Access, SQLServer, and Oracle database. If you weren’t alrea

Page 25 - Oracle schema

SQL Server is a relational database consisting of many components, each of which contains multipleobjects. In the following sections, you examine the

Page 26

Object DescriptionUser-Defined Functions A group of SQL statements that can be encapsulated into a subroutine that can be called by views and stored p

Page 27

do so, you must first delete the row of data containing the foreign key or update the column using aNULL value. Only then are you able to delete the r

Page 28

Second, stored procedures are similar to procedures and functions in other programming languages, asthey can contain input and output parameters and c

Page 29

Oracle consists of many components in addition to the database engine, including components that perform data analysis, help you manage XML and image

Page 30

TablesTables in Oracle perform the same function as they do in SQL Server— they contain information aboutyour business.KeysKeys in Oracle perform the

Comments to this Manuals

No comments