ACCESS isn t only a great development tool it s

Size: px
Start display at page:

Download "ACCESS isn t only a great development tool it s"

Transcription

1 Upsizing Access to Oracle Smart Access 2000 George Esser In addition to showing you how to convert your Access prototypes into Oracle systems, George Esser shows how your Access skills translate into Oracle. ACCESS isn t only a great development tool it s also a great tool for designing and prototyping table designs that will run on other database engines. In this article, I ll show you how I convert my Access designs into Oracle systems. This month s Source Code file (available at includes the code to handle those conversions. One caveat: This code was written to convert local tables only and might not function as advertised with linked tables. At worst, this means that you ll have to import any linked tables before running my code. Mark Davis showed the basics of creating a table and inserting the data through VB and DAO code in his article Access to Oracle: Loading the Database in the May 2000 issue of Smart Access. I m going to add to that by showing you not only how to convert your tables, but also how to convert relationships (including integrity constraints and cascaded changes), validation rules, default values, required fields, primary keys, and indexes. Instead of going through DAO, I handle the conversion by creating a text file containing a SQL Script that can be run in Oracle SQL*Plus, SQL Plus Worksheet, or a similar tool. By using scripts, I can walk into my client s site and run my scripts, even if they don t have Access installed. You might want to review the sidebar Learning Oracle Terminology on page 17 before jumping into this article. Creating the tables To create a table in Oracle, I use SQL s Create Table command, as follows: CREATE TABLE TableName ( ColumnName1 Data Type, ColumnName2 Data Type, ) For example, this code creates a table called Employee with one numeric field, three variable length text fields, and a date field: However, there s more to the process than just executing a Create Table for every table in your database. In any database that has referential integrity, enabled tables need to be loaded in the correct order, determined by the way the tables reference each other. The table on the one side of the one-to-many relationship must be populated first, so that there will be no integrity issues when you upload data to the tables. On the other hand, it doesn t make any difference what order the tables are created in, provided you don t create the relationships until all of the tables are present. I choose to add the relationships between the tables as I create them because it makes for concise, easily documented code. In Figure 1, you can see the relationships among the tables that I ll use as my example for this article. In order to set the relationships between the tables as I create the tables, I ll have to create the tables in the order Skill, Department, Employee, and Emp_Skill. Another problem with creating tables is Oraclespecific. In Oracle, you can t use a reserved word for a column name. In Access, you can name a field with a date data type DATE, but in Oracle, this will create an error. In my code that creates the SQL Script, I have a function called CheckName() that will change column names with reserved words (like DATE and NUMBER) by adding the digit 1 to the end of the name (for example, DATE1 and NUMBER1). I only handle DATE and NUMBER in my routine, as they re the most likely names to crop up in an Access database. However, more unlikely names (LOOP, for instance) will also cause the SQL Script to fail when used as field names. A complete list of reserved words can be found in the Oracle documentation set, and you can modify the sample code in this month s Source Code file to handle the situations that you expect to occur. Data types In Oracle, there are three main kinds of data types: Character, Number, and Date (while there are many others, these are the most common and the ones that I ll concentrate on for this article). EMP_NO NUMBER, DEPT_ID VARCHAR2(3), Figure 1. Relationships among the tables. 16 Smart Access March

2 Characters For Access character fields, always use the Oracle type VARCHAR2(n), where n is the maximum number of characters that field will store (the field has a limit of 4,000 characters). As its name implies, VARCHAR fields are variable length. Oracle recommends VARCHAR2(n) over the older VARCHAR(n) to avoid compatibility problems in the future. Numbers To define numbers, you should use the Oracle data type Number(s,p), which will store positive and negative numbers and the value zero. The parameters s and p are optional. If you provide them, s is the scale, or number of digits to the right of the decimal point (maximum value of 127), and p is the precision or digits to the left of zero (maximum value of 38). Using Number(p) with no scale parameter gives you a number with scale of 0 (an integer). Using the data type Number without any parameters causes it to default to Number(38,18), which is the equivalent of the Double data type in Access. Number(5) would be equivalent to the Access data type Integer, and Number(19,4) would be equivalent to the Access data type Currency. I ve chosen to always use Number for all Access numeric data types (byte, integer, long). I ve noted the more exact equivalent in a comment in the function GetType() if you want a more exact conversion to other number data types. Dates The delimiter for a date in Access is the hash ( # ). The delimiter for dates in Oracle is a single quote. With Oracle, you need to use the date format defined in your system s NLS_DATE_FORMAT. For more information, see the section Inserting dates later in this article. Memo Memo fields are normally used to store data longer than 255 characters. To convert an Access memo field to Oracle, I used VARCHAR2(4000), as that s sufficient for most needs. There are other Oracle data types that will give you more than 4,000 characters if you need even more room. Primary key In Oracle, a primary key is defined by a constraint on a field. Using the UNIQUE constraint with a NOT NULL constraint is functionally the same as defining a primary key in Access. If the primary key is a single column, it can be defined by adding a parameter to the column definition like this: Emp_No Number CONSTRAINT PK_EMP PRIMARY KEY This line creates a column with a name of EMP_NO with a data type of NUMBER and adds a PRIMARY KEY Learning Oracle Terminology When learning Oracle, the terminology can slow you down. Here are some terms that I ll use in the article: Column: A column in Oracle is equivalent to a field in Access. When looking at data in datasheet mode, the data has columns and rows. Oracle has chosen to use the term columns for what Access calls fields. Constraints: Constraints are rules that constrain or confine the data. Using a validation rule (for instance, Between 1 and 10) on a column, using a relationship, or setting a column as a primary key all place a constraint on the data in some way. Each constraint is uniquely named by you or by Oracle. Trigger: A trigger is the equivalent of creating code in an event in a form. There are three main kinds of triggers: INSERT, DELETE, and UPDATE. They re equivalent to a form s Before Insert, On Delete, and Before Update events. There are many other types of triggers, including After Insert and After Delete. Reference: A reference is equivalent to a join or relationship in Access. Joins are created by defining a reference in a constraint. Foreign key: A foreign key is a column that s indexed and matches the data type and size of a related table s primary key or other uniquely indexed column. It s used in establishing a relationship (join) with another table. constraint. The name of the constraint is PK_EMPLOYEE. Summing up what I ve covered so far, the SQL Script to define my Employee table would look like this: EMP_NO NUMBER CONSTRAINT PK_EMPLOYEE PRIMARY KEY, DEPT_ID VARCHAR2(3), If the primary key was based on two fields (for example, Last_Name and First_Name), the primary key constraint would be listed separately and look like this: CONSTRAINT PK_EMPLOYEE PRIMARY KEY (LAST_NAME, FIRST_NAME), EMP_NO NUMBER, DEPT_ID VARCHAR2(3), Relationship, joins, references, and foreign keys Relationships or joins are called references and are also defined by a constraint. The table on the many side of Smart Access March

3 the relationship needs a foreign key that refers to a primary key in the table on the one side. The foreign key must be an indexed column of the same data type as the primary key it s referenced to. In my sample database, the Department table has a one-to-many relationship with the Employee table. The first step is to create both tables. Since the Department is on the one side of the relationship, I ll create it first: CREATE TABLE DEPARTMENT( DEPT_ID VARCHAR2(3) CONSTRAINT PK_DEPARTMENT PRIMARY KEY, DEPT_NAME VARCHAR2(50)); To create the Employee table with a foreign key that refers to the Department table s primary key, I add a constraint to the DEPT_ID field in the Employee table: EMP_NO NUMBER CONSTRAINT PK_EMPLOYEE PRIMARY KEY, DEPT_ID VARCHAR2(3) CONSTRAINT FK_EMPLOYEE_DEPT_ID_DEPT_ID REFERENCES DEPARTMENT(DEPT_ID), In Access, you can create a relationship without enforcing referential integrity. In Oracle, you can do the same thing by adding a DISABLE clause to the reference definition, as in this example: Dept_ID VarChar2(3) CONSTRAINT FK_EMPLOYEE_DEPT_ID_DEPT_ID REFERENCES Department(Dept_ID) DISABLE, Useful Commands When getting started with Oracle, you ll need to create a user ID, log on to it, and review the work that you ve done. Here are the commands that you ll need. You can create a user with this command: GRANT DBS, RESOURCE, CONNECT TO GEOESSER IDENTIFIED BY PASSWORD; This statement will create the user GEOESSER with a password of PASSWORD. Passwords aren t case-sensitive. To connect to GEOESSER once you ve created it, you d use this command: CONNECT GEOESSER/PASSWORD; The following commands will let you review the work you ve done: SELECT TABLE_NAME FROM USER_TABLES; SELECT SEQUENCE_NAME FROM USER_SEQUENCES; SELECT INDEX_NAME FROM USER_INDEXES; DESCRIBE EMPLOYEE The constraint will be defined but not enforced. This can be changed later using the ALTER TABLE command with ENABLE instead of DISABLE. Do be aware that Oracle requires that the referenced column(s) of the referenced table be a primary or unique key even if the constraint isn t enforced. Because Access doesn t require a unique key for joins where referential integrity isn t enforced, you ll have to make sure that the field(s) has a unique index before implementing in Oracle. Access isn t case-sensitive. If you have a relationship with referential integrity enforced in Access, uppercase and lowercase difference will be ignored (for example, VAC will be equal to Vac ). Depending on your installation, Oracle can be case-sensitive, and VAC and Vac won t be considered equal. This could be a source of errors when trying to insert data. You might find yourself getting the error ORA-02291: Integrity constraint (SYSTEM.FK_DAYSOFF_ID_DAYS_TYPE) violated parent key not found when loading data that was perfectly acceptable in Access. One solution is to convert all of your values in the related columns to uppercase or lowercase. Cascade updates Access allows you to cascade updates through relationships (that is, changing the value of the data in the primary key causes all of the values in related columns to be updated). In Oracle, cascading updates are implemented through an update statement in an update trigger. This is a sample trigger where Table_Name refers to the table on the one side and Table_Child refers to the table on the many side: CREATE TRIGGER Table_Name_Update_Trig BEFORE UPDATE ON Table_Name FOR EACH ROW Begin If :old.id!= :New.ID Then UPDATE Table_Child SET ID = :new.id WHERE ID = :Old.ID; End If; End; Here s the update trigger that would be required to implement cascading updates on the Employee table when the Department number changes: CREATE TRIGGER EMPLOYEE_UPDATE_TRIG BEFORE UPDATE ON DEPARTMENT FOR EACH ROW Begin If :OLD.DEPT_ID!= :NEW.DEPT_ID Then UPDATE EMPLOYEE SET DEPT_ID=:NEW.DEPT_ID WHERE DEPT_ID = :OLD.DEPT_ID; End IF; END; Cascade deletes Access also lets you have related records automatically deleted when the primary key record is deleted, a feature 18 Smart Access March

4 called cascading deletes. Unlike cascading updates, cascading deletes can be defined as part of the foreign key constraint using the ON DELETE CASCADE clause: Dept_ID VarChar2(3) CONSTRAINT FK_EMPLOYEE_DEPT_ID_DEPT_ID REFERENCES Department(Dept_ID) ON DELETE CASCADE, Instead of cascading the deletes, you could set the foreign key fields in the record on the many side to Null by using this clause: ON DELETE SET NULL Setting the foreign key fields to Null is useful if you have employee records that you don t want deleted when their department is deleted. As in Access, you can t use this option if the foreign key fields are also part of the primary key of their record. Field features Access allows you to set constraints on individual fields, including supplying a default value and making a field required. In this section, I ll show you the equivalent Oracle functions. Default values A default value is added to the column definition using the default keyword. In this example, I m also using Oracle s built-in SYSDATE function to pick up the current date as the default value: START_DATE DATE DEFAULT TRUNC(SYSDATE), You can also set a default through a trigger, but this syntax is easier to read. Required In Access, if a field s Required property is set to False, the field can contain Null values (as long as no other constraints are in place). If the Required property is set to True, the record can t be saved until a value is provided (that is, the field isn t Null). In Oracle, to put a constraint on a column so that data is required, you must add the NOT NULL parameter to the column definitions. There are two ways to do this in Oracle, depending on whether or not you re willing to let Oracle name the constraint. In the following code, my first version lets Oracle name the constraint; for the second version, I name it: LAST_NAME VARCHAR2(20) NOT NULL LAST_NAME VARCHAR2(20) CONSTRAINT NN_EMPLOYEE_LAST_NAME NOT NULL If you let Oracle name the constraint, the name will begin with SYS_C and end with a number (for example, SYS_C00301). Using your own name with your own naming convention makes it easier for you to refer to the constraint later so that you can alter or delete it. You can set the Not Null property for either an index object or a field object in Oracle. You should always set it for the field object as I do here. The Not Null property setting for a field object is checked before that of an index object, making your processing more efficient. Validation In Access, validation is what makes sure your data fits certain criteria by running a test on it. In Oracle, this is accomplished through a CHECK constraint. The following CHECK constraint makes sure that the SOME_NUMBER field is greater than zero: SOME_NUMBER NUMBER CONSTRAINT CHECK_SOME_NUMBER CHECK (SOME_NUMBER >0)) Inserting data With your tables created and the constraints applied, you re ready to start putting data into your table. Using a script to load data isn t very efficient compared to using Oracle s bulk load facility, SQL Loader (especially if you re loading large amounts of data). But often, if you re developing off your customer s site, using a script will be the easiest method. Using a script transfers your data to a script text file as a series of SQL commands that execute against the Oracle database. SQL Loader will transfer directly from your Access database to SQL, but you ll have to worry about drivers, ODBC connections, and so forth. It s often easier to just run your script and go to lunch. The version of the Insert command that I use looks like this: INSERT INTO Table (Column1, Column2, ) VALUES (1, 'Some Text', ) The data in the Values clause corresponds to the column names listed after the table name and represents the data from one row in the table. To create the INSERT statement, I use the following code, which loops through each field, setting the delimiter appropriate for each data type and assembling the list of field names and data values: For Each fld In rs.fields If Not IsNull(fld.Value) Then strflds = strflds & CheckName(fld.name) & ", " Select Case fld.type Case dbboolean To dbdouble strdelimiter = "" Case dbtext, dbmemo strdelimiter = "'" Case dbdate strdelimiter = "" Case Else strdelimiter = "" End Select strvalues = strvalues & strdelimiter & _ Smart Access March

5 CheckValue(rs(fld.name)) & strdelimiter & ", " End If Next fld In this code, I tested for the field s data type using the Access constants dbboolean, dbdouble, and so on. Once the two lists are complete, this code assembles them into the INSERT statement: strsql = strsql & "INSERT INTO " & _ strtablename & " (" strsql = strsql & _ Mid(strFlds, 1, Len(strFlds) - 2) & ")" & vbcrlf strsql = strsql & "Values (" & Mid(strValues, 1, _ Len(strValues) - 2) & ");" & vbcrlf While that s the general format for the INSERT statement, there are some special cases that need to be handled. Inserting special characters Oracle allows substitution variables in its PL/SQL, signaled by the ampersand (&). If you have the following command in your script, Oracle will prompt you to Enter value for v: : INSERT (DESCRIPT) INTO TABLE1 VALUES ('H&V') After you ve typed an entry, Oracle will substitute the value you type for the &V. If you start your script running and then go to lunch, you might return to find this prompt on the screen because your data contained an ampersand. There are two ways to handle this problem. To insert the literal ampersand (&), you can SET ESCAPE ON (default is off) in your script and put the escape character \ in front of your & (for example, H\&V ). This creates two new problems: Because Escape is now on, you have to use a double \\ to insert a single \ (for example, C:\\ Temp\\abc.txt will be inserted as C:\Temp\ abc.txt ). Because the single quote is used to delimit text, you have to use two single quotes in a row to insert one literal single quote (for example, This is a ''Test'' will be inserted as This is a 'Test' ). with the format that you ve selected. The code to convert the date to day-month-year format (four-digit year, of course) and create the appropriate script code looks like this: strdate = Format(varValue, "dd-mmm-yyyy") strvalue = _ "TO_DATE('" & strdate & "', 'DD-MON-YYYY')" In the INSERT string, the result would look like this: INSERT INTO EMPLOYEE (EMP_NO, START_DATE) Values (TO_DATE('01-Jun-2000', 'DD-MON-YYYY')); Inserting Boolean values Oracle doesn t have a Boolean data type. In VB, True is -1 and False is 0. In C, True is 1 and False is 0. I used the C standard and converted True to 1 and False to 0 using the following syntax: CStr(Abs(CInt(varValue))) If you want the VB standard, just remove the Abs function. AutoNumber fields The AutoNumber data type in Access is a long integer, and it s automatically generated when a new record is created. To create the equivalent functionality in an Oracle The second way to handle substitution variables is to turn substitution off via SET DEFINE OFF (default is on), insert the data, and then SET DEFINE ON in your script. This eliminates the need to insert \\, but you ll still have to double your single quotes. Inserting dates The date format accepted by Oracle will depend on your NLS_DATE_FORMAT setting. Often this will be DD- MON-YY, but it could be something different depending on how Oracle is configured at your site. One way to handle dates is to set them to some specific format with VBA and then use Oracle s TO_DATE conversion function 20 Smart Access March

6 table, you must use a trigger. This trigger causes a unique, sequential key value to be generated for the Emp_No field in the employee table on every insert: CREATE TABLE Employee( Emp_No Number CONSTRAINT PK_EMPLOYEE PRIMARY KEY, other field definitions CREATE SEQUENCE SEQ_EMPLOYEE_EMP_NO NOCACHE; CREATE TRIGGER EMPLOYEE_INSERT_TRIG BEFORE INSERT ON Employee FOR EACH ROW BEGIN SELECT SEQ_EMPLOYEE_EMP_NO.NEXTVAL INTO :NEW.EMP_NO FROM DUAL; END; This will simulate an Access AutoNumber field with the New Values property set to Increment. There s no equivalent for Access s Random setting, which is used primarily for databases that are replicated. With this code, the fields value will be incremented by 1. You can start the sequence at a specific value and change the value to increment with by changing the Create Sequence statement. The following definition creates a sequence that begins at 2 and increments by 10: CREATE SEQUENCE eseq INCREMENT BY 10 START WITH 2; Running the script To generate a script, you only need to run my CreateAll routine, passing it the name of the file to hold the script and a Boolean that indicates whether you want INSERT statements to load created data. This call, passing True to indicate that the INSERT statements are to be generated, creates a script in a file called Test.SQL: CreateAll("C:\Temp\Test.SQL",True) If you re interested in getting started with Oracle, I recommend the Oracle8i Oracle Technology Network at A one-year membership costs $200 (U.S.) and gives you the software (including Oracle8i Release 2 Version 8.1.6) and updates for a year. It also includes an online manual. You can easily learn Oracle by using the software, the online manual, and my sample code. ORACLE.ZIP at George Esser is a contract software developer with 15 years of management experience and 13 years of programming experience. He s certified in Access, VB, and SQL Server 7.0 and is currently working on his certification in Oracle. geoesser@rcv.org. Smart Access March

Lab # 4. Data Definition Language (DDL)

Lab # 4. Data Definition Language (DDL) Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Lab # 4 Data Definition Language (DDL) Eng. Haneen El-Masry November, 2014 2 Objective To be familiar with

More information

Oracle SQL. murach s. and PL/SQL TRAINING & REFERENCE. (Chapter 2)

Oracle SQL. murach s. and PL/SQL TRAINING & REFERENCE. (Chapter 2) TRAINING & REFERENCE murach s Oracle SQL and PL/SQL (Chapter 2) works with all versions through 11g Thanks for reviewing this chapter from Murach s Oracle SQL and PL/SQL. To see the expanded table of contents

More information

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul 1 EGCI 321: Database Systems Dr. Tanasanee Phienthrakul 2 Chapter 10 Data Definition Language (DDL) 3 Basic SQL SQL language Considered one of the major reasons for the commercial success of relational

More information

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama The Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Database Lab Lab # 2 Data Definition Language (DDL) Eng. Alaa O Shama October, 2015 Objective To be familiar

More information

CHAPTER4 CONSTRAINTS

CHAPTER4 CONSTRAINTS CHAPTER4 CONSTRAINTS LEARNING OBJECTIVES After completing this chapter, you should be able to do the following: Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN KEY,

More information

HOW TO CREATE AND MAINTAIN DATABASES AND TABLES. By S. Sabraz Nawaz Senior Lecturer in MIT FMC, SEUSL

HOW TO CREATE AND MAINTAIN DATABASES AND TABLES. By S. Sabraz Nawaz Senior Lecturer in MIT FMC, SEUSL HOW TO CREATE AND MAINTAIN DATABASES AND TABLES By S. Sabraz Nawaz Senior Lecturer in MIT FMC, SEUSL What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate

More information

Data Definition Language (DDL)

Data Definition Language (DDL) Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Database Lab (ECOM 4113) Lab 6 Data Definition Language (DDL) Eng. Mohammed Alokshiya November 11, 2014 Database Keys A key

More information

COSC344 Database Theory and Applications. Lecture 5 SQL - Data Definition Language. COSC344 Lecture 5 1

COSC344 Database Theory and Applications. Lecture 5 SQL - Data Definition Language. COSC344 Lecture 5 1 COSC344 Database Theory and Applications Lecture 5 SQL - Data Definition Language COSC344 Lecture 5 1 Overview Last Lecture Relational algebra This Lecture Relational algebra (continued) SQL - DDL CREATE

More information

Full file at

Full file at SQL for SQL Server 1 True/False Questions Chapter 2 Creating Tables and Indexes 1. In order to create a table, three pieces of information must be determined: (1) the table name, (2) the column names,

More information

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Table of Contents. PDF created with FinePrint pdffactory Pro trial version Table of Contents Course Description The SQL Course covers relational database principles and Oracle concepts, writing basic SQL statements, restricting and sorting data, and using single-row functions.

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE 9/27/16 DATABASE SCHEMAS IN SQL SQL DATA DEFINITION LANGUAGE SQL is primarily a query language, for getting information from a database. SFWR ENG 3DB3 FALL 2016 But SQL also includes a data-definition

More information

Creating Tables, Defining Constraints. Rose-Hulman Institute of Technology Curt Clifton

Creating Tables, Defining Constraints. Rose-Hulman Institute of Technology Curt Clifton Creating Tables, Defining Constraints Rose-Hulman Institute of Technology Curt Clifton Outline Data Types Creating and Altering Tables Constraints Primary and Foreign Key Constraints Row and Tuple Checks

More information

SQL: Data Definition Language

SQL: Data Definition Language SQL: Data Definition Language CSC 343 Winter 2018 MICHAEL LIUT (MICHAEL.LIUT@UTORONTO.CA) DEPARTMENT OF MATHEMATICAL AND COMPUTATIONAL SCIENCES UNIVERSITY OF TORONTO MISSISSAUGA Database Schemas in SQL

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL ORACLE UNIVERSITY CONTACT US: 00 9714 390 9000 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database

More information

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries

More information

SQL Data Definition: Table Creation

SQL Data Definition: Table Creation SQL Data Definition: Table Creation ISYS 464 Spring 2002 Topic 11 Student Course Database Student (Student Number, Student Name, Major) Course (Course Number, Course Name, Day, Time) Student Course (Student

More information

chapter 2 G ETTING I NFORMATION FROM A TABLE

chapter 2 G ETTING I NFORMATION FROM A TABLE chapter 2 Chapter G ETTING I NFORMATION FROM A TABLE This chapter explains the basic technique for getting the information you want from a table when you do not want to make any changes to the data and

More information

D B M G. SQL language: basics. Managing tables. Creating a table Modifying table structure Deleting a table The data dictionary Data integrity

D B M G. SQL language: basics. Managing tables. Creating a table Modifying table structure Deleting a table The data dictionary Data integrity SQL language: basics Creating a table Modifying table structure Deleting a table The data dictionary Data integrity 2013 Politecnico di Torino 1 Creating a table Creating a table (1/3) The following SQL

More information

SQL: Data Definition Language. csc343, Introduction to Databases Diane Horton Fall 2017

SQL: Data Definition Language. csc343, Introduction to Databases Diane Horton Fall 2017 SQL: Data Definition Language csc343, Introduction to Databases Diane Horton Fall 2017 Types Table attributes have types When creating a table, you must define the type of each attribute. Analogous to

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE SQL DATA DEFINITION LANGUAGE DATABASE SCHEMAS IN SQL SQL is primarily a query language, for getting information from a database. DML: Data Manipulation Language SFWR ENG 3DB3 FALL 2016 MICHAEL LIUT (LIUTM@MCMASTER.CA)

More information

COSC 304 Introduction to Database Systems SQL DDL. Dr. Ramon Lawrence University of British Columbia Okanagan

COSC 304 Introduction to Database Systems SQL DDL. Dr. Ramon Lawrence University of British Columbia Okanagan COSC 304 Introduction to Database Systems SQL DDL Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca SQL Overview Structured Query Language or SQL is the standard query language

More information

Database Programming with PL/SQL

Database Programming with PL/SQL Database Programming with PL/SQL 2-2 Objectives This lesson covers the following objectives: List and define the different types of lexical units available in PL/SQL Describe identifiers and identify valid

More information

Using DDL Statements to Create and Manage Tables. Copyright 2006, Oracle. All rights reserved.

Using DDL Statements to Create and Manage Tables. Copyright 2006, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables Objectives After completing this lesson, you should be able to do the following: Categorize the main database objects Review the table structure List the

More information

Chapter-14 SQL COMMANDS

Chapter-14 SQL COMMANDS Chapter-14 SQL COMMANDS What is SQL? Structured Query Language and it helps to make practice on SQL commands which provides immediate results. SQL is Structured Query Language, which is a computer language

More information

Item: 1 (Ref:Cert-1Z )

Item: 1 (Ref:Cert-1Z ) Page 1 of 13 Item: 1 (Ref:Cert-1Z0-071.10.2.1) Evaluate this CREATE TABLE statement: CREATE TABLE customer ( customer_id NUMBER, company_id VARCHAR2(30), contact_name VARCHAR2(30), contact_title VARCHAR2(20),

More information

Database Foundations. 6-3 Data Definition Language (DDL) Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Foundations. 6-3 Data Definition Language (DDL) Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Foundations 6-3 Roadmap You are here Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control

More information

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 3 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA

More information

Database Foundations. 6-4 Data Manipulation Language (DML) Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Foundations. 6-4 Data Manipulation Language (DML) Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Foundations 6-4 Roadmap You are here Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control

More information

Microsoft MOS- Using Microsoft Office Access Download Full Version :

Microsoft MOS- Using Microsoft Office Access Download Full Version : Microsoft 77-605 MOS- Using Microsoft Office Access 2007 Download Full Version : http://killexams.com/pass4sure/exam-detail/77-605 QUESTION: 120 Peter works as a Database Designer for AccessSoft Inc. The

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE SQL DATA DEFINITION LANGUAGE DATABASE SCHEMAS IN SQL SQL is primarily a query language, for getting information from a database. DML: Data Manipulation Language SFWR ENG 3DB3 FALL 2016 MICHAEL LIUT (LIUTM@MCMASTER.CA)

More information

SQL Structured Query Language Introduction

SQL Structured Query Language Introduction SQL Structured Query Language Introduction Rifat Shahriyar Dept of CSE, BUET Tables In relational database systems data are represented using tables (relations). A query issued against the database also

More information

Index. NOTE: Boldface numbers indicate illustrations or code listing; t indicates a table. 341

Index. NOTE: Boldface numbers indicate illustrations or code listing; t indicates a table. 341 A access paths, 31 optimizing SQL and, 135, 135 access types, restricting SQL statements, JDBC setup and, 36-37, 37 accessing iseries data from a PC, 280-287, 280 accumulate running totals, 192-197, 193,

More information

CHAPTER. Introduction

CHAPTER. Introduction CHAPTER 1 Introduction 2 Oracle Database 10g SQL In this chapter, you will Learn about relational databases. Be introduced to the Structured Query Language (SQL), which is used to access a database. Use

More information

Full file at

Full file at ch2 True/False Indicate whether the statement is true or false. 1. The SQL command to create a database table is an example of DML. 2. A user schema contains all database objects created by a user. 3.

More information

Course Outline and Objectives: Database Programming with SQL

Course Outline and Objectives: Database Programming with SQL Introduction to Computer Science and Business Course Outline and Objectives: Database Programming with SQL This is the second portion of the Database Design and Programming with SQL course. In this portion,

More information

Tutorial 5 Advanced Queries and Enhancing Table Design

Tutorial 5 Advanced Queries and Enhancing Table Design Tutorial 5 Advanced Queries and Enhancing Table Design (Sessions 1 and 3 only) The Clinic Database Clinic.accdb file for Tutorials 5-8 object names include tags no spaces in field names to promote upsizing

More information

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access Databases and Microsoft Access Introduction to Databases A well-designed database enables huge data storage and efficient data retrieval. Term Database Table Record Field Primary key Index Meaning A organized

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 2-1 Objectives This lesson covers the following objectives: Apply the concatenation operator to link columns to other columns, arithmetic expressions, or constant values to

More information

Data Modelling and Databases. Exercise Session 7: Integrity Constraints

Data Modelling and Databases. Exercise Session 7: Integrity Constraints Data Modelling and Databases Exercise Session 7: Integrity Constraints 1 Database Design Textual Description Complete Design ER Diagram Relational Schema Conceptual Modeling Logical Modeling Physical Modeling

More information

SELF TEST. List the Capabilities of SQL SELECT Statements

SELF TEST. List the Capabilities of SQL SELECT Statements 98 SELF TEST The following questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully because there might be more than one correct answer.

More information

Databases 1. Defining Tables, Constraints

Databases 1. Defining Tables, Constraints Databases 1 Defining Tables, Constraints DBMS 2 Rest of SQL Defining a Database Schema Primary Keys, Foreign Keys Local and Global Constraints Defining Views Triggers 3 Defining a Database Schema A database

More information

Access Intermediate

Access Intermediate Access 2010 - Intermediate (103-134) Building Access Databases Notes Quick Links Building Databases Pages AC52 AC56 AC91 AC93 Building Access Tables Pages AC59 AC67 Field Types Pages AC54 AC56 AC267 AC270

More information

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office Access 2010 Chapter 2: Relational Databases and Multi-Table Queries 1 Objectives Design data Create tables Understand table relationships Share data with Excel Establish table

More information

Basic SQL. Basic SQL. Basic SQL

Basic SQL. Basic SQL. Basic SQL Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation Basic SQL Structured

More information

Lecture 07. Spring 2018 Borough of Manhattan Community College

Lecture 07. Spring 2018 Borough of Manhattan Community College Lecture 07 Spring 2018 Borough of Manhattan Community College 1 SQL Identifiers SQL identifiers are used to identify objects in the database, such as table names, view names, and columns. The ISO standard

More information

Creating and Managing Tables Schedule: Timing Topic

Creating and Managing Tables Schedule: Timing Topic 9 Creating and Managing Tables Schedule: Timing Topic 30 minutes Lecture 20 minutes Practice 50 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe the

More information

Constraints. Primary Key Foreign Key General table constraints Domain constraints Assertions Triggers. John Edgar 2

Constraints. Primary Key Foreign Key General table constraints Domain constraints Assertions Triggers. John Edgar 2 CMPT 354 Constraints Primary Key Foreign Key General table constraints Domain constraints Assertions Triggers John Edgar 2 firstname type balance city customerid lastname accnumber rate branchname phone

More information

Tables From Existing Tables

Tables From Existing Tables Creating Tables From Existing Tables After completing this module, you will be able to: Create a clone of an existing table. Create a new table from many tables using a SQL SELECT. Define your own table

More information

Oracle Create Table Foreign Key On Delete No

Oracle Create Table Foreign Key On Delete No Oracle Create Table Foreign Key On Delete No Action Can I create a foreign key against only part of a composite primary key? For example, if you delete a row from the ProductSubcategory table, it could

More information

c r e at i N g yo u r F i r S t d ata b a S e a N d ta b l e

c r e at i N g yo u r F i r S t d ata b a S e a N d ta b l e 1 Creating Your First Database and Table SQL is more than just a means for extracting knowledge from data. It s also a language for defining the structures that hold data so we can organize relationships

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 6 Basic SQL Slide 6-2 Chapter 6 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries in SQL INSERT, DELETE, and UPDATE Statements in SQL Additional Features

More information

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement Chapter 4 Basic SQL Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured Query Language Statements for data definitions, queries,

More information

Principles of Data Management

Principles of Data Management Principles of Data Management Alvin Lin August 2018 - December 2018 Structured Query Language Structured Query Language (SQL) was created at IBM in the 80s: SQL-86 (first standard) SQL-89 SQL-92 (what

More information

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas SQL SQL Functionality stands for Structured Query Language sometimes pronounced sequel a very-high-level (declarative) language user specifies what is wanted, not how to find it number of standards original

More information

Importing source database objects from a database

Importing source database objects from a database Importing source database objects from a database We are now at the point where we can finally import our source database objects, source database objects. We ll walk through the process of importing from

More information

Oracle Syllabus Course code-r10605 SQL

Oracle Syllabus Course code-r10605 SQL Oracle Syllabus Course code-r10605 SQL Writing Basic SQL SELECT Statements Basic SELECT Statement Selecting All Columns Selecting Specific Columns Writing SQL Statements Column Heading Defaults Arithmetic

More information

COPYRIGHTED MATERIAL. Databases

COPYRIGHTED MATERIAL. Databases 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

More information

Database Programming - Section 18. Instructor Guide

Database Programming - Section 18. Instructor Guide Database Programming - Section 18 Instructor Guide Table of Contents...1 Lesson 1 - Certification Exam Preparation...1 What Will I Learn?...2 Why Learn It?...3 Tell Me / Show Me...4 Try It / Solve It...5

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 14-1 Objectives This lesson covers the following objectives: Define the term "constraint" as it relates to data integrity State when it is possible to define a constraint

More information

CIS 45, The Introduction. What is a database? What is data? What is information?

CIS 45, The Introduction. What is a database? What is data? What is information? CIS 45, The Introduction I have traveled the length and breadth of this country and talked with the best people, and I can assure you that data processing is a fad that won t last out the year. The editor

More information

Teach Yourself InterBase

Teach Yourself InterBase Teach Yourself InterBase This tutorial takes you step-by-step through the process of creating and using a database using the InterBase Windows ISQL dialog. You learn to create data structures that enforce

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 13-1 Objectives In this lesson, you will learn to: List and categorize the main database objects Review a table structure Describe how schema objects are used by the Oracle

More information

CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C

CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C 0 0 3 2 LIST OF EXPERIMENTS: 1. Creation of a database and writing SQL queries to retrieve information from the database. 2. Performing Insertion,

More information

Physical Design of Relational Databases

Physical Design of Relational Databases Physical Design of Relational Databases Chapter 8 Class 06: Physical Design of Relational Databases 1 Physical Database Design After completion of logical database design, the next phase is the design

More information

Getting Information from a Table

Getting Information from a Table ch02.fm Page 45 Wednesday, April 14, 1999 2:44 PM Chapter 2 Getting Information from a Table This chapter explains the basic technique of getting the information you want from a table when you do not want

More information

Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia 1. Creating a Database Alias 2. Introduction to SQL Relational Database Concept Definition of Relational Database

More information

RESTRICTING AND SORTING DATA

RESTRICTING AND SORTING DATA RESTRICTING AND SORTING DATA http://www.tutorialspoint.com/sql_certificate/restricting_and_sorting_data.htm Copyright tutorialspoint.com The essential capabilities of SELECT statement are Selection, Projection

More information

CHAPTER. Introduction

CHAPTER. Introduction CHAPTER 1 Introduction 2 Oracle Database 12c SQL In this chapter, you will learn about the following: Relational databases Structured Query Language (SQL), which is used to access a database SQL*Plus,

More information

An Introduction to Structured Query Language

An Introduction to Structured Query Language An Introduction to Structured Query Language Grant Weddell Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Winter 2017 CS 348 (Intro to DB Mgmt) SQL

More information

SQL: Data De ni on. B0B36DBS, BD6B36DBS: Database Systems. h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3

SQL: Data De ni on. B0B36DBS, BD6B36DBS: Database Systems. h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3 B0B36DBS, BD6B36DBS: Database Systems h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3 SQL: Data De ni on Mar n Svoboda mar n.svoboda@fel.cvut.cz 13. 3. 2018 Czech Technical University

More information

Lecture7: SQL Overview, Oracle Data Type, DDL and Constraints Part #2

Lecture7: SQL Overview, Oracle Data Type, DDL and Constraints Part #2 IS220 : Database Fundamentals College of Computer and Information Sciences - Information Systems Dept. Lecture7: SQL Overview, Oracle Data Type, DDL and Constraints Part #2 Ref. Chapter6 Prepared by L.

More information

Slides by: Ms. Shree Jaswal

Slides by: Ms. Shree Jaswal Slides by: Ms. Shree Jaswal A trigger is a statement that is executed automatically by the system as a side effect of a modification to the database. To design a trigger mechanism, we must: Specify the

More information

Introduction p. 1 The Logical and Physical View of Tables p. 1 Database Types p. 4 NULLs p. 6 DDL and DML Statements p. 7 Column and Table Constraint

Introduction p. 1 The Logical and Physical View of Tables p. 1 Database Types p. 4 NULLs p. 6 DDL and DML Statements p. 7 Column and Table Constraint Preface p. xv Introduction p. 1 The Logical and Physical View of Tables p. 1 Database Types p. 4 NULLs p. 6 DDL and DML Statements p. 7 Column and Table Constraint Clauses p. 7 Sample Database p. 9 A Quick

More information

A <column constraint> is a constraint that applies to a single column.

A <column constraint> is a constraint that applies to a single column. Lab 7 Aim: Creating Simple tables in SQL Basic Syntax for create table command is given below: CREATE TABLE ( [DEFAULT ] [], {

More information

An Introduction to Structured Query Language

An Introduction to Structured Query Language An Introduction to Structured Query Language Grant Weddell Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Spring 2016 CS 348 (Intro to DB Mgmt) SQL

More information

ITCertMaster. Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way!

ITCertMaster.   Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way! ITCertMaster Safe, simple and fast. 100% Pass guarantee! http://www.itcertmaster.com Exam : 1z0-007 Title : Introduction to Oracle9i: SQL Vendor : Oracle Version : DEMO Get Latest & Valid 1Z0-007 Exam's

More information

Programming Languages

Programming Languages Programming Languages Chapter 19 - Continuations Dr. Philip Cannata 1 Exceptions (define (f n) (let/cc esc (/ 1 (if (zero? n) (esc 1) n)))) > (f 0) 1 > (f 2) 1/2 > (f 1) 1 > Dr. Philip Cannata 2 Exceptions

More information

Manipulating Data. Copyright 2004, Oracle. All rights reserved.

Manipulating Data. Copyright 2004, Oracle. All rights reserved. Manipulating Data Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Describe each data manipulation language (DML) statement

More information

An Introduction to Structured Query Language

An Introduction to Structured Query Language An Introduction to Structured Query Language Alexandra Roatiş David R. Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Winter 2016 CS 348 SQL Winter

More information

Creating a Relational Database Using Microsoft SQL Code. Farrokh Alemi, Ph.D.

Creating a Relational Database Using Microsoft SQL Code. Farrokh Alemi, Ph.D. Creating a Relational Database Using Microsoft SQL Code Farrokh Alemi, Ph.D. The objective of this note is to help you understand how a relational database is organized as a collection of tables, linked

More information

BraindumpsVCE. Best vce braindumps-exam vce pdf free download

BraindumpsVCE.   Best vce braindumps-exam vce pdf free download BraindumpsVCE http://www.braindumpsvce.com Best vce braindumps-exam vce pdf free download Exam : 1z1-061 Title : Oracle Database 12c: SQL Fundamentals Vendor : Oracle Version : DEMO Get Latest & Valid

More information

Oracle 1Z MySQL 5.6 Developer.

Oracle 1Z MySQL 5.6 Developer. Oracle 1Z0-882 MySQL 5.6 Developer http://killexams.com/exam-detail/1z0-882 SELECT... WHERE DATEDIFF (dateline, 2013-01-01 ) = 0 C. Use numeric equivalents for comparing the two dates: SELECT...WHERE MOD(UNIX_TIMESTAMP

More information

Ken s SQL Syntax Refresher

Ken s SQL Syntax Refresher Ken s SQL Syntax Refresher 27Apr10 Ken s SQL Syntax Refresher 1 Select SELECT [ * ALL DISTINCT column1, column2 ] FROM table1 [, table2 ]; SELECT [ * ALL DISTINCT column1, column2 ] FROM table1 [, table2

More information

Database Programming - Section 10. Instructor Guide

Database Programming - Section 10. Instructor Guide Database Programming - Section 10 Instructor Guide Table of Contents...1 Lesson 1 - Defining NOT NULL and UNIQUE Constraints...1 What Will I Learn?...2 Why Learn It?...3...4 Try It / Solve It...13 Lesson

More information

2. Programming written ( main theme is to test our data structure knowledge, proficiency

2. Programming written ( main theme is to test our data structure knowledge, proficiency ORACLE Job Placement Paper Paper Type : General - other 1. Tech + Aptitude written 2. Programming written ( main theme is to test our data structure knowledge, proficiency sorting searching algorithms

More information

Enhancements and New Features in Oracle 12c Summarized

Enhancements and New Features in Oracle 12c Summarized Enhancements and New Features in Oracle 12c Summarized In this blog post I would be highlighting few of the features that are now available on Oracle Database 12cRelease. Here listing below in a summarized

More information

Oracle Login Max Length Table Name 11g Column Varchar2

Oracle Login Max Length Table Name 11g Column Varchar2 Oracle Login Max Length Table Name 11g Column Varchar2 Get max(length(column)) for all columns in an Oracle table tables you are looking at BEGIN -- loop through column names in all_tab_columns for a given

More information

COMP 430 Intro. to Database Systems. Encapsulating SQL code

COMP 430 Intro. to Database Systems. Encapsulating SQL code COMP 430 Intro. to Database Systems Encapsulating SQL code Want to bundle SQL into code blocks Like in every other language Encapsulation Abstraction Code reuse Maintenance DB- or application-level? DB:

More information

ORACLE Job Placement Paper. Paper Type : General - other

ORACLE Job Placement Paper. Paper Type : General - other ORACLE Job Placement Paper Paper Type : General - other 1. Tech + Aptitude written 2. Programming written ( main theme is to test our data structure knowledge, proficiency sorting searching algorithms

More information

3.1. Keys: Super Key, Candidate Key, Primary Key, Alternate Key, Foreign Key

3.1. Keys: Super Key, Candidate Key, Primary Key, Alternate Key, Foreign Key Unit 3: Types of Keys & Data Integrity 3.1. Keys: Super Key, Candidate Key, Primary Key, Alternate Key, Foreign Key Different Types of SQL Keys A key is a single or combination of multiple fields in a

More information

Introduction to Oracle9i: SQL

Introduction to Oracle9i: SQL Oracle 1z0-007 Introduction to Oracle9i: SQL Version: 22.0 QUESTION NO: 1 Oracle 1z0-007 Exam Examine the data in the EMPLOYEES and DEPARTMENTS tables. You want to retrieve all employees, whether or not

More information

CSC 453 Database Technologies. Tanu Malik DePaul University

CSC 453 Database Technologies. Tanu Malik DePaul University CSC 453 Database Technologies Tanu Malik DePaul University A Data Model A notation for describing data or information. Consists of mostly 3 parts: Structure of the data Data structures and relationships

More information

Oracle MOOC: SQL Fundamentals

Oracle MOOC: SQL Fundamentals Week 4 Homework for Lesson 4 Homework is your chance to put what you've learned in this lesson into practice. This homework is not "graded" and you are encouraged to write additional code beyond what is

More information

Relational Model. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011

Relational Model. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011 Relational Model IT 5101 Introduction to Database Systems J.G. Zheng Fall 2011 Overview What is the relational model? What are the most important practical elements of the relational model? 2 Introduction

More information

Oracle Database 11g: SQL and PL/SQL Fundamentals

Oracle Database 11g: SQL and PL/SQL Fundamentals Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL

More information

COSC344 Database Theory and Applications. Lecture 6 SQL Data Manipulation Language (1)

COSC344 Database Theory and Applications. Lecture 6 SQL Data Manipulation Language (1) COSC344 Database Theory and Applications Lecture 6 SQL Data Manipulation Language (1) COSC344 Lecture 56 1 Overview Last Lecture SQL - DDL This Lecture SQL - DML INSERT DELETE (simple) UPDATE (simple)

More information

PL / SQL Basics. Chapter 3

PL / SQL Basics. Chapter 3 PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic

More information

Chapter _CH06/CouchmanX 10/2/01 1:32 PM Page 259. Manipulating Oracle Data

Chapter _CH06/CouchmanX 10/2/01 1:32 PM Page 259. Manipulating Oracle Data Chapter 6 200095_CH06/CouchmanX 10/2/01 1:32 PM Page 259 Manipulating Oracle Data 200095_CH06/CouchmanX 10/2/01 1:32 PM Page 260 260 OCP Introduction to Oracle9i: SQL Exam Guide T his chapter covers the

More information

Introduction to Computer Science and Business

Introduction to Computer Science and Business Introduction to Computer Science and Business This is the second portion of the Database Design and Programming with SQL course. In this portion, students implement their database design by creating a

More information

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved. Restricting and Sorting Data Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort

More information