1 / 22

Oracle & SQL Introduction

Oracle & SQL Introduction. Database Design Revision. Steps in building a database for an application: Analysis: Understand real-world domain being captured. Design: Specify it using a database conceptual model (ER). Translate specification to model of DBMS (Relational).

sudie
Télécharger la présentation

Oracle & SQL Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Oracle & SQL Introduction

  2. Database Design Revision Steps in building a database for an application: • Analysis: • Understand real-world domain being captured. • Design: • Specify it using a database conceptual model (ER). • Translate specification to model of DBMS (Relational). • Implementation (using DBMS): • Create schema using DBMS commands (DDL). • Load data (DML).

  3. Relational Database • A relational database is a DB that stores the data in the form of tables/relations with rows and columns. Every table shares at least one column with another table (Relationships). • A table/Relation is the category of data, like Staff. The columns are information about the category (Attributes), like name or address and the rows are the actual data or records.

  4. Oracle • Oracle is a powerful relational database management system (RDBMS) that offers a large feature set. • Oracle is widely regarded as one of the popular full-featured database systems on the market today. • In almost all relational databases, data is accessed through Structured Query Language (SQL), and Oracle is one of them. • SQL is nonprocedural language that represents a combination of DDL and DML.

  5. Data Definition Language (DDL) • DDL is a descriptive language for defining the database schema. • Some of the main SQL-DDL commands are: • CREATE TABLE • ALTER TABLE • DROP TABLE

  6. Data Manipulation Language (DML) • DML is a language for retrieving and updating (insert, delete, & modify) the data in the DB. • The main SQL-DML commands are: • SELECT • INSERT INTO • UPDATE • DELETE FROM

  7. Simple Queries Syntax: SELECT { * | column | column_expression[,…] } FROM table_name; Staff

  8. Simple QueriesRetrieve all columns & rows Example: Retrieve all staff information. SELECT StaffNo, Fname, Lname, position, sex, DOB, Salary, BrnNo FROM staff; OR SELECT * FROM staff;

  9. Simple QueriesRetrieve specific columns & all rows Example: List salaries of all staff, showing only the staff number, the full and last name, and salary. SELECT StaffNo, Fname, Lname, Salary FROM staff;

  10. Simple QueriesRow selection (WHERE clause) Syntax: SELECT { * | column | column_expression [,…] } FROM table_name WHERE condition; Comparison operators: = , <, >, <=, >=, <>

  11. Simple QueriesRow selection (WHERE clause) Example: List all staff with a salary greater than 10,000. SELECT sno, fname, lname, salary FROM staff WHERE salary > 10000;

  12. Oracle 11g (SQL Developer) Demo

  13. Connection name: global • User name: Sserial-number_section-number • ex: S1_25486 • Password: Sserial-number_section-number • ex: S1_25486 • Hostname: 10.6.14.101 • Servicename: global11g

More Related