What is programming? Who can teach me to do the most basic? Is the network programmed?

Programming direction 1. foreword

Many people think that database programming is a very attractive job, which comes from the huge market demand for database applications. There are three main areas of computer applications: scientific calculation, data processing and process control, among which data processing accounts for the largest proportion, including the most popular generalized client/server mode (C/S) and Internet mode (B/S) applications. It is precisely because of the huge market demand that the prospect of database programming is optimistic. Are you interested in entering the programming hall?

Second, the database application and programming principle

1. database application development

Database system is developed on the basis of file system, which has gone through three stages: hierarchical database, mesh database and relational database. Because relational database uses two-dimensional tables that people can easily understand and accept to organize data, it has developed rapidly and has become the mainstream of database products. The database knowledge we introduced here refers to the relational database.

2. Basic concepts

Database (abbreviated as DB) is a set of interrelated data stored in computer memory in a certain way, and the establishment of the database has nothing to do with the program. The so-called relational database is a kind of database that represents data as a collection of tables and defines the structure by establishing the relationship between simple tables.

Database management system (DBMS) is a software system for managing databases. It provides users with methods and commands to describe, operate and maintain databases, and can automatically control the security and data integrity of databases. At present, Oracle, Sybase, Microsoft SQL Server and other databases are database management systems.

Database system is a computer system with database management function, including application software, database, database management system and database administrator. The database programming we are talking about today generally refers to developing a database system, that is, manipulating the database by writing database applications to achieve effective data management.

We use the structure diagram to intuitively understand the architecture of database programming, as shown below:

Of course, database administrators are generally aimed at large-scale database applications, and there is no database administrator specifically for small-scale database applications. Some readers may mistakenly think that database programming means writing database applications. In fact, it should also include database design, such as writing a salary management system, how to organize personnel information and salary information reasonably, and designing data structures, which are also considered in database programming. DBMS is the function of the database itself, so we don't need to consider it. We only need to deal with its interface (for example, contemporary development tools generally provide ODBC to connect to the database). No matter how a table is physically stored in a database file, it can be regarded as a set of rows and columns, similar to those of a spreadsheet Excel. In a relational database, rows are called records and columns are called fields. The following is an example of employee payroll.

Employee number, name, age, title, working hours and basic salary.

1 Qiao Feng 32 Senior Engineer1990/07/011000.00

7 Zhang Wuji 25 Engineer 1997/08/0 1 800.00

We can see that each line in this table describes the information of a specific employee of the company, which is called a record; Each record contains the same type and number of fields. From this table, we get the following definitions:

A table is a logical group of related information arranged in rows and columns, such as the company employee table above.

Each column in a field database table is called a field. The table structure is defined by the various fields it contains, and each field describes its attribute value. Fields can contain various characters, numbers and even graphics (such as saving photos of employees).

Records are stored in rows of a table, which are called records. No two records in the same data table are identical.

A key is one (or more) fields in a table, and the key can be unique or not. You can specify a unique key as the primary key to uniquely identify each row in the table. For example, in the employee table, the employee number is the primary key of the table because it uniquely identifies an employee (we can't use the name as the primary key here because the name can't uniquely identify an employee, and there may be duplicate names).

Relationship is the connection between table and existence. A database can be composed of multiple tables, which can be related to each other in different ways. For example, the employee database can also have a table containing other information about employees, which are related to the employee table through the employee number.

Third, SQL language.

When it comes to database programming, we can't help but mention SQL language. The English full name of SQL language is structured query language, which means structured query language. The main function of SQL language is to establish contact and communication with various databases and perform various operations, such as updating data in the database and extracting data from the database. SQL has been designated as the standard language of relational database management system by ANSI (American National Standards Institute) and International Organization for Standardization (ISO). At present, most popular relational database management systems, such as Oracle, Sybase, Microsoft SQL Server, DB2, etc., follow the SQL language standard.

If you want to do a good job, you must sharpen your tools first. The next work is to choose a better database development tool.

Fourth, the comparison of several database development tools

At present, some proprietary database vendors have provided database programming tools, such as Oracle Developer 2000 and Sybase Power++, but Delphi, VB, PowerBuilder and other languages are popular, and these development tools have their own strengths and advantages. For example, VB uses BASIC language, which is easy to learn and has strong integration with Microsoft products; Delphi component technology is excellent, compilation speed is fast, and object-oriented Pascal language is adopted, which has high compilation efficiency and intuitive and readable grammar. PowerBuilder has powerful data window technology, which is a patent of SYBASE company and provides a special interface with large databases. VFP also has a huge user base in China, but Microsoft announced that it will not launch a new version after VFP6, and many former FOX programmers have turned to other development tools. For beginners, you can choose according to your own needs. I'm here to introduce PowerBuilder, which is a powerful database development tool and a master of database programming.

Verb (abbreviation of verb) Introduction to PowerBuilder database programming

PowerBuilder (hereinafter referred to as PB) is an object-oriented graphical interactive development tool launched by PowerSoft, a wholly-owned subsidiary of Sybase Company, which is applied to the application development under the client/server architecture. PB is more and more favored by programmers because of its concise and efficient integrated development environment, powerful data window technology, almost omnipotent database access ability and friendly user interface. PB6.5 is the most widely used version at present. PB7 has been introduced for a long time, but it seems to be unstable all the time. PB8 is also under development, and it is a product worthy of our expectation. Here we take PB6.5 as an example to make a simple introduction.

PB database applications generally include three parts: user program, database engine and database. The database engine is an interface with various databases provided by PB. Using the database engine, we can focus on the design of the database and the writing of user programs without knowing the technical details of accessing the database.

PB development environment consists of a series of comprehensive painters. The so-called brush is actually a tool to complete certain functions. For example, window brush is used to define window objects, data window brush is used to define data window objects, and library brush is used to add, delete and modify application libraries. Application developers can design, build and test client/server applications with simple mouse operations.

PB calls an Application that solves practical problems, that is, an application object. The application object is the entry point of other objects in the application library. By writing code at the application level, you can extend the program framework. PB application objects are saved in PBL files.

What if we want to develop one? /span>。