Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI

Similar presentations


Presentation on theme: "Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI"— Presentation transcript:

1 Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI E-mail: droberts@cs.iupui.edu Introduction to Relational Databases

2 Dale Roberts 2 Sharing Knowledge and Success Oracle is a relational database management system (RDBMS). A DBMS allows users to... put data in keep/manage the data get data out and work with it

3 Dale Roberts 3 Disadvantages of traditional file processing systems… uncontrolled redundancy inconsistent data inflexibility limited data sharing poor enforcement of standards low programmer productivity excessive program maintenance An DBMS deals with these problem my introduction… Concurrency control and locking Transaction processing Read-consistency Database Management

4 Dale Roberts 4 Hierarchical Data Model (IMS) nested sets of 1:1 or 1:M relationships Network Data Model (IDMS, TOTAL) multiple sets of 1:1, 1:M, M:1, or M:N relationships Relational Data Model (Oracle, SQL Server, DB2, mySQL) A Relational DBMS expresses data in terms of a “relation” or a table consistent of named columns with data organized into rows. relationships are NOT physically implemented uses primary keys to represent associations terminology: relations (tables), columns, tuples (rows), domain, degree, cardinality, primary keys, concatenated keys, alternate keys, foreign keys, Referential Integrity or R.I. relational algebra, three main operators: select, project, join normalization theory:1NF, 2NF, 3NF Database Management: Data Models

5 Dale Roberts 5 The Language of Oracle: SQL –Structured Query Language, English like query language –keywords: select, from, where, and order by –Example query: select city, temperature from weather where temperature > 80 order by temperature; Examples of relational databases –stock tables in newspaper –sports scores –100 year example in book Sharing Knowledge and Success

6 Dale Roberts 6 History of SQL The paper, “A Relational Model of Data for large Shared Data Banks,” by Dr. E. F. Codd, was published in June 1970 in … Communications of the ACM. Codd’s model is now accepted as the definitive model for relational database management systems (RDBMS). The language, Structured English Query Language (SEQUEL) was developed by IBM to use Codd’s model. SEQUEL later became SQL. In 1979, Relational Software, Inc. (now Oracle Corporation) introduced the first commercially available implementation of SQL. Today, SQL is accepted as the standard RDBMS language.

7 Dale Roberts Client-Server Architecture 7 In the Oracle database system environment, the database application and the database are separated into two parts: a front-end or client portion, and a back-end or server portion—hence the term client/server architecture. Client and server are located on different computers, and these computers are connected through a network. The server and clients of an Oracle database system communicate through Oracle Net Services, Oracle's network interface. SQL

8 Dale Roberts 8 It looks very easy to use a RDBMS –learning about normalization, SQL, etc. make for instant “experts.” –lack of experience with major production systems can create catastrophic project failures. Testing cycles are getting shorter –newer development tools make software development quicker, usually systems testing gets shortened. Recent college grads... –least experienced developers usually have more training with relational database technology. –veteran developers are busy with older projects. The Dangers in a Relational Database

9 Dale Roberts 9 Bad Examples of Table and Column Names Tables DEPTEMPEMPSMYEMPS PEPROJTITLESPERSONNEL Columns AD1AU_LNAMEAU_ORDBLOC CDLEXPDEPTNODNAMEDISCOUNTTYPE EMPNOENAMEENUMBERESAL HIGHQTYHIRANGELORANGELOWQTY NOTEORD_NUMPNAMEPROJNO PUBDATEQTYOHSLSTAXPCTWORKHRS Reasons –abbreviation used without good reason –inconsistent abbreviations, underlines, and use of plurals –purpose not apparent from name –name rules have limitations The Dangers in a Relational Database

10 Dale Roberts 10 Use English Name for Data: Poor Example: Better Example: The Dangers in a Relational Database

11 Dale Roberts 11 The Basic Parts of Speech in SQL SQL is a language. Oracle SQL is a superset of the American National Standards Institute (ANSI) and the International Standards Organization (ISO) SQL92 standard at entry level conformance. PL/SQL is Oracle’s procedural language extension to SQL. It allows you to link several SQL commands through procedural language. SQL*Plus (SQLPLUS from command line) is a tool that allows users to interact with Oracle. SQL*Plus enables you to manipulate SQL commands and PL/SQL blocks, and to perform many additional tasks as well. Through SQL*Plus, you can: –enter, edit, store, retrieve, and run SQL commands and PL/SQL blocks –format, perform calculations on, store, and print query results in the form of reports –list column definitions for any table –access and copy data between SQL databases –send messages to and accept responses from an end user

12 Dale Roberts 12 Ten Commandments (suggestions?) 1. Include Users. Put them on the project team, teach them SQL. 2. Name tables, columns, data with users. Develop application thesaurus to ensure consistency. 3. Use English words. 4. Don’t mix levels in naming. 5. Avoid codes and abbreviations. 6. Use meaningful keys. 7. Decompose overloaded keys. 8. Analyze and design from the tasks, not just the data. Normalization is not design. 9. Move tasks from users to the machine. 10. Don’t be seduced by development speed. Take time in analysis, design, testing, tuning.

13 Dale Roberts 13 Acknowledgements McFadden and Hoffer, Database Management, pp. 8- 14 Loney, Oracle Database 10g The Complete Reference Oracle® Database Concepts 10g Release 2 (10.2)


Download ppt "Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI"

Similar presentations


Ads by Google