13
1 STUDY MATERIAL / GUIDELINES For B. Com. 3 rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is DBMS? Data is one of the most important assets of a company. It is very important to make sure data is stored and maintained accurately and quickly. DBMS (Database Management System) is a system that is used to store and manage data. A DBMS is a set of programs that is used to store and manipulation data. Manipulation of data includes the following: _ Adding new data, for example adding details of new student. _ Deleting unwanted data, for example deleting the details of students who have completed course. _ Changing existing data, for example modifying the fee paid by the student. There are many reasons why you could use a DBMS: Crash recovery; The database is protected from hardware crashes, disk media failures, and some user errors Sharing between users; Multiple users can access the database at the same time Sharing between applications; Multiple application programs can read and write data to the same database Security; Data can be protected against unauthorized read and write access Integrity; You can specify rules that data must satisfy. A DBMS can control the quality of its data over and above facilities that that may be provided by application programs

1 RDBMS: an · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

  • Upload
    vuquynh

  • View
    219

  • Download
    4

Embed Size (px)

Citation preview

Page 1: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

1

STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students

In the Subject of COMPUTER APPLICATIONS

1

RDBMS: an Introduction What is DBMS? Data is one of the most important assets of a company. It is very important to make sure data is stored and maintained accurately and quickly. DBMS (Database Management System) is a system that is used to store and manage data. A DBMS is a set of programs that is used to store and manipulation data. Manipulation of data includes the following: _ Adding new data, for example adding details of new student. _ Deleting unwanted data, for example deleting the details of students who have completed course. _ Changing existing data, for example modifying the fee paid by the student. There are many reasons why you could use a DBMS:

Crash recovery; The database is protected from hardware crashes, disk media failures, and some user errors

Sharing between users; Multiple users can access the database at the same time

Sharing between applications; Multiple application programs can read and write data to the same database

Security; Data can be protected against unauthorized read and write access

Integrity; You can specify rules that data must satisfy. A DBMS can control the quality of its data over and above facilities that that may be provided by application programs

Page 2: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

2

Extensibility; Data may be added to the database without disrupting existing programs. Data can be reorganized for faster performance.

Data distribution; The database may be partitioned across various sites, organizations, and hardware platforms

Data Models Data model is a way of storing and retrieving the data. There are three different data models. Data models differ in the way they allow users to view and manipulate relationships between entities. Each has its own way of storing the data. The following are the three different data models: _ Hierarchical _ Network _ Relational Hierarchical In this model, data is stored in the form of a tree. The data is represented by parent child relation ship. Each tree contains a single root record and one or more subordinate records. For example, each batch is root and students of the batch will be subordinates. This model supports only one-to-many relationship between entities. This was used in IBM’s Information management system, IMS. Network Data is stored along with pointers, which specify the relationship between entities. This was used in Honeywell's Integrated Data Store, IDS. This model is complex. It is difficult to understand both the way data is stored and the way data is manipulated. It is capable of supporting many-to-many relationship between entities, which hierarchical model doesn’t. Relational

Page 3: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

3

This stores data in the form of a table. Table is a collection of rows and columns. We will discuss more about relational model in the next second. Relational Database Management System (RDBMS) A DBMS that is based on relational model is called as RDBMS. Relation model is most successful mode of all three models. Designed by E.F. Codd, relational model is based on the theory of sets and relations of mathematics. Relational model represents data in the form a table. A table is a two dimensional array containing rows and columns. Each row contains data related to an entity such as a student. Each column contains the data related to a single attribute of the entity such as student name. One of the reasons behind the success of relational model is its simplicity. It is easy to understand the data and easy to manipulate. Another important advantage with relational model, compared with remaining two models is, it doesn’t bind data with relationship between data item. Instead it allows you to have dynamic relationship between entities using the values of the columns. Almost all Database systems that are sold in the market, now- a-days, have either complete or partial implementation of relational model. Figure 1 shows how data is represented in relational model and what are the terms used to refer to various components of a table. The following are the terms used in relational model. Table Name STUDENTS Column Name

RollNo Name Phone

101 Adil 3456921

102 Bilal 5678418

103 Khalid 9037514

Attribute/Column Tuple/Row

Figure 1: A table in relational model.

Page 4: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

4

Tuple / Row A single row in the table is called as tuple. Each row represents the data of a single entity. Attribute / Column A column stores an attribute of the entity. For example, if details of students are stored then student name is an attribute; course is another attribute and so on. Column Name Each column in the table is given a name. This name is used to refer to value in the column. Table Name Each table is given a name. This is used to refer to the table. The name depicts the content of the table. The following are two other terms, primary key and foreign key that are very important in relational model. Primary Key A table contains the data related entities. If you take STUDETNS table, it contains data related to students. For each student there will be one row in the table. Each student’s data in the table must be uniquely identified. In order to identify each entity uniquely in the table, we use a column in the table. That column, which is used to uniquely identify entities (students) in the table is called as primary key. In case of STUDENTS table (see figure 1) we can use ROLLNO as the primary key as it in not duplicated. So a primary key can be defined as a set of columns used to uniquely identify rows of a table. Some other examples for primary keys are account number in bank, product code of products, employee number of an employee.

Page 5: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

5

Composite Primary Key In some tables a single column cannot be used to uniquely identify entities (rows). In that case we have to use two or more columns to uniquely identify rows of the table. When a primary key contains two or more columns it is called as composite primary key. Foreign Key A Foreign key is a column or set of columns that refers to a primary key in the same table or another table. You use foreign keys to establish principle connections between, or within, tables. A foreign key must either match a primary key or else be NULL. Rows are connected logically when required. The logical connections are based upon conditions that define a relationship between corresponding values, typically between a primary key and a matching foreign key. This relational method of linking provides great flexibility as it is independent of physical links between records. Structured Query Language (SQL) Almost all relational database management systems use SQL (Structured Query Language) for data manipulation and retrieval. SQL is the standard language for relational database systems. SQL is a non-procedural language, where you need to concentrate on what you want, not on how you get it. Put it in other way, you need not be concerned with procedural details. SQL Commands are divided into four categories, depending upon what they do. _ DDL (Data Definition Language) _ DML (Data Manipulation Language) _ DCL (Data Control Language) _ TCL (Transaction Control Language) DDL commands are used to define the data. For example, CREATE and ALTER. DML commands such as, INSERT and DELETE are used to manipulate data.

Page 6: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

6

DCL commands are used to control access to data. For example, GRANT. TCL commands such as ROLLBACK are used to control the transactions. RDBMS Properties An RDBMS is easily accessible. You execute commands in the Structured Query Language (SQL) to manipulate data. SQL is the international Standards Organization (ISO) standard language for interacting with a RDBMS. An RDBMS provides full data independence. The organization of the data is independent of the applications that use it. You do not need to specify the access routes to tables or know how data is physically arranged in a database. A relational database is a collection of individual, named objects. The basic unit of data storage in a relational database is called a table. A table consists of rows and columns used to store values. For access purpose, the order of rows and columns is insignificant. You can control the access order as required. When querying the database, you use conditional operations such as joins and restrictions. A join combines data from separate database rows. A restriction limits the specific rows returned by a query. An RDBMS enables data sharing between users. At the same time, you can ensure consistency of data across multiple tables by using integrity constraints. An RDBMS uses various types of data integrity constraints. These types include entity, column, referential and user-defined constraints. The constraint, entity, ensures uniqueness of rows, and the constraint column ensures consistency of the type of data within a column. The other type, referential, ensures validity of foreign keys, and user-defined constraints are used to enforce specific business rules.

Page 7: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

7

An RDBMS minimizes the redundancy of data. This means that similar data is not repeated in multiple tables.

2

Electronic Commerce Electronic Commerce is exactly analogous to a marketplace on the Internet. Electronic Commerce (also referred to as EC, e-commerce eCommerce or ecommerce) consists primarily of the distributing, buying, selling, marketing and servicing of products or services over electronic systems such as the Internet and other computer networks. The information technology industry might see it as an electronic business application aimed at commercial transactions; in this context, it can involve electronic funds transfer, supply chain management, e-marketing, online marketing, online transaction processing, electronic data interchange (EDI), automated inventory management systems, and automated data collection systems. Electronic commerce typically uses electronic communications technology of the World Wide Web, at some point in the transaction's lifecycle, although of course electronic commerce frequently depends on computer technologies other than the World Wide Web, such as databases, and e-mail, and on other non-computer technologies, such as transportation for physical goods sold via e-commerce. History (Evolution) The meaning of the term "electronic commerce" has changed over the last 30 years. Originally, "electronic commerce" meant the facilitation of commercial transactions electronically, usually using technology like Electronic Data Interchange (EDI) and Electronic Funds Transfer (EFT), where both were introduced in the late 1970s, for example, to send commercial documents like purchase orders or invoices electronically.

Page 8: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

8

The 'electronic' or 'e' in e-commerce refers to the technology/systems; the 'commerce' refers to be traditional business models. E-commerce is the complete set of processes that support commercial business activities on a network. In the 1970s and 1980s, this would also have involved information analysis. The growth and acceptance of credit cards, automated teller machines (ATM) and telephone banking in the 1980s were also forms of e-commerce. However, from the 1990s onwards, this would include enterprise resource planning systems (ERP), data mining and data warehousing. In the dot com era, it came to include activities more precisely termed "Web commerce" -- the purchase of goods and services over the World Wide Web, usually with secure connections (HTTPS, a special server protocol that encrypts confidential ordering data for customer protection) with e-shopping carts and with electronic payment services, like credit card payment authorizations. Today, it encompasses a very wide range of business activities and processes, from e-banking to offshore manufacturing to e-logistics. The ever growing dependence of modern industries on electronically enabled business processes gave impetus to the growth and development of supporting systems, including backend systems, applications and middleware. Examples are broadband and fiber-optic networks, supply-chain management software, customer relationship management software, inventory control systems and financial accounting software. Electronic Data Interchange (EDI) is a set of standards for structuring information that is to be electronically exchanged between and within businesses, organizations, government entities and other groups. The standards describe structures that emulate documents, for example purchase orders to automate purchasing. The term EDI is also used to refer to the implementation and operation of systems and processes for creating, transmitting, and receiving EDI documents.

Page 9: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

9

Despite being relatively unheralded, in this era of technologies such as XML services, the Internet and the World Wide Web, EDI is still the data format used by the vast majority of electronic commerce transactions in the world. Electronic funds transfer (EFT) refers to the computer-based systems used to perform financial transactions electronically. The term is used for a number of different concepts:

cardholder-initiated transactions, where a cardholder makes use of a payment card

electronic payments by businesses, including salary payments

electronic check (or cheque) clearing Card-based EFT EFT may be initiated by a cardholder when a payment card such as a credit card or debit card is used. This may take place at an automated teller machine (ATM) or point of sale (EFTPOS), or when the card is not present, which covers cards used for mail order, telephone order and internet purchases. Card-based EFT transactions are often covered by the ISO 8583 standard. Transaction types A number of transaction types may be performed, including the following:

1. Sale: where the cardholder pays for goods or service. 2. Refund: where a merchant refunds an earlier payment made by

a cardholder. 3. Withdrawal: the cardholder withdraws funds from their

account, e.g. from an ATM. The term Cash Advance may also be used, typically when the funds are advanced by a merchant rather than at an ATM.

4. Deposit: where a cardholder deposits funds to their own account (typically at an ATM).

Page 10: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

10

5. Cashback: where a cardholder withdraws funds from their own account at the same time as making a purchase.

6. Inter-account transfer: transferring funds between linked accounts belonging to the same cardholder

7. Payment: transferring funds to a third party account 8. Inquiry: a transaction without financial impact, for instance

balance inquiry, available funds inquiry, linked accounts inquiry, or request for a statement of recent transactions on the account.

9. Administrative: this covers a variety of non-financial transactions including PIN change.

The transaction types offered depend on the terminal. An ATM would offer different transactions from a POS terminal, for instance. Traditional Commerce vs. E-Commerce Both share the same goal and real estate, but that's where the similarity ends! What are the differences between traditional distribution facilities and those that serve online shoppers? Both of these types of facilities have the same objective: to get the right product to the right customer at the right time. And both operate out of the same kind of real estate: warehouses typically located near major transportation arteries. But they aren't as similar as they appear - or as some online marketers might assume. In fact, one can safely say they're as different as night and day. Knowing the key differences between the two facilities could save some headaches for manufacturers purchasing or establishing an online fulfillment effort. More important, it could prevent the loss of thousands of customers. Difference No. 1: Higher order volume, lower order quantity. Many traditional distribution facilities are designed to fill orders in large volume configurations such as cases or pallets. They may handle hundreds or even thousands of orders per day. But these

Page 11: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

11

orders are typically quite large, and most move via full truckload (FTL) or less-than-truckload (LTL).

By contrast, as e-commerce fulfillment center may process tens or thousands of orders a day - orders that may be only a hundredth the size of their traditional counterparts. Instead of shipping 100 turtlenecks to a single Gap store in Atlanta, the facility may send turtlenecks to 100 different customers throughout the country, all via small package delivery.

As a result, manufacturers must lay out and equip e-commerce fulfillment centers differently, with more pick-to-light systems. Automation like this doesn't come cheap, which is why companies can expect to pay three to five times as much per square foot for an e-commerce fulfillment center.

Difference No. 2: More products. A virtual store can do many things a real store can't - including carrying a larger array of products. Delta Air Lines' Skymall, for example, offers 10,000 items on its Web site versus 2,000 items in its in-flight catalogues.

This type of inventory presents an incredible challenge for online fulfillment centers. Among other things, they must have more storage areas, pick lines, and people to manage this variety - not to mention more space. They also must be more systems intensive, because the more individual products you have, the more difficult it is to maintain accurate inventory data - and to avoid the most dreaded of e-commerce blunders, the back order.

Difference No. 3: More people. Traditional distribution facilities that muse pick lines to fill orders typically assign approximately one-quarter to one-third of their labor force to this activity. By contrast, 75 percent to 90 percent of employees may man the pick and customization lines at e-commerce fulfillment centers.

Page 12: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

12

The human resources function at an e-commerce fulfillment center is especially critical. Not only will such a center probably have to hire and maintain more employees, it will need to manage them more efficiently to inspire order-perfect performance. Accommodating this additional staff becomes a critical design issue because the facility will need larger break rooms, more restrooms, and additional parking spaces than normally found in a traditional distribution center.

Difference No. 4: Sending product packaging When the term "wrap" is used at a traditional distribution center, it typically refers to encasing a pallet in plastic wrapping for protective purposes. Say that word at an e-commerce fulfillment center and it more likely means the kind of activity that results in a package you'd find under a Christmas tree.

E-commerce fulfillment centers must be small-package experts, which means they need areas dedicated to boxing materials and providing extra touches such as gift-wrapping. They must also be more adept at dealing with small package carriers, whether they use an expedited company or a parcel consolidator.

Difference No. 5: Fulfillment centers may make the sale. Perhaps the most important difference of all is the critical role e-commerce fulfillment centers play in making a sale. Online customer satisfaction levels are declining, and customers' biggest complaint is product fulfillment, according to a recent Jupiter Communications, Inc. research study. The study also finds that customers eventually cancelled more than 50 percent of orders for back-ordered items. For an online sales effort to be a success, companies must pay as much attention to their e-commerce fulfillment design as their Web site design. Not only will their fulfillment deliver the goods; it could deliver a future sale. E-Commerce Types

Page 13: 1 RDBMS: an  · PDF file1 STUDY MATERIAL / GUIDELINES For B. Com. 3rd Year Students In the Subject of COMPUTER APPLICATIONS 1 RDBMS: an Introduction What is

13

Business-to-Consumer (B2C) It provides the following facilities:

Social Interaction: e-mail, video conferencing, etc.

Personal Finance Management: Enables consumers to manage investments and personal finances using online banking tools.

Purchasing Products and Services: Enables consumers to find online information about existing and new products and services.

Business-to-Business (B2B) It provides the following facilities:

Inventory Management: Shortens the order ship bill cycle.

Distribution Management: Facilitates the transmission of shipping documents.

Channel Management: By electronically linking production information, it eliminates thousands of labour hours and ensures accurate information sharing.

Payment Management: Reduces the clerical error and increases the speed of invoices.

Compiled by SHAHNAWAZ SHAH Lecturer Computer Applications

PG Deptt. of Commerce and Management Govt. Degree College Bemina