After completing this lesson, you should be able to
do the following:
Describe the main database objects
Create tables
Describe the data types that can be used when specifying column definition
Alter table definitions
Drop, rename, and truncate tables
http://phpexecutor.com
Integrity constraints are rules used to maintain data quality and ensure accuracy in a relational database. The main types of integrity constraints are domain constraints, which define valid value sets for attributes; NOT NULL constraints, which enforce non-null values; UNIQUE constraints, which require unique values; and CHECK constraints, which specify value ranges. Referential integrity links data between tables through foreign keys, preventing orphaned records. Integrity constraints are enforced by the database to guard against accidental data damage.
Here are the SQL commands for the questions:
Q1: SELECT PNAME FROM PROJECT WHERE PLOCATION='Houston';
Q2: SELECT FNAME, LNAME FROM EMPLOYEE WHERE HOURS>20;
Q3: SELECT FNAME, LNAME FROM EMPLOYEE, DEPARTMENT WHERE MGRSSN=SSN;
PL/SQL is a combination of SQL along with the procedural features of programming languages.
It provides specific syntax for this purpose and supports exactly the same datatypes as SQL.
Aggregating Data Using Group FunctionsSalman Memon
After completing this lesson, you should be able to
do the following:
Identify the available group functions
Describe the use of group functions
Group data using the GROUP BY clause
Include or exclude grouped rows by using the HAVING clause
http://phpexecutor.com
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
After completing this lesson, you should be able to
do the following:
List the capabilities of SQL SELECT statements
Execute a basic SELECT statement
Differentiate between SQL statements and iSQL*Plus commands
http://phpexecutor.com
This document provides an overview of SQL programming including:
- A brief history of SQL and how it has evolved over time.
- Key SQL fundamentals like database structures, tables, relationships, and normalization.
- How to define and modify database structures using commands like CREATE, ALTER, DROP.
- How to manipulate data using INSERT, UPDATE, DELETE, and transactions.
- How to retrieve data using SELECT statements, joins, and other techniques.
- How to aggregate data using functions like SUM, AVG, MAX, MIN, and COUNT.
- Additional topics covered include subqueries, views, and resources for further learning.
Integrity constraints are rules used to maintain data quality and ensure accuracy in a relational database. The main types of integrity constraints are domain constraints, which define valid value sets for attributes; NOT NULL constraints, which enforce non-null values; UNIQUE constraints, which require unique values; and CHECK constraints, which specify value ranges. Referential integrity links data between tables through foreign keys, preventing orphaned records. Integrity constraints are enforced by the database to guard against accidental data damage.
Here are the SQL commands for the questions:
Q1: SELECT PNAME FROM PROJECT WHERE PLOCATION='Houston';
Q2: SELECT FNAME, LNAME FROM EMPLOYEE WHERE HOURS>20;
Q3: SELECT FNAME, LNAME FROM EMPLOYEE, DEPARTMENT WHERE MGRSSN=SSN;
PL/SQL is a combination of SQL along with the procedural features of programming languages.
It provides specific syntax for this purpose and supports exactly the same datatypes as SQL.
Aggregating Data Using Group FunctionsSalman Memon
After completing this lesson, you should be able to
do the following:
Identify the available group functions
Describe the use of group functions
Group data using the GROUP BY clause
Include or exclude grouped rows by using the HAVING clause
http://phpexecutor.com
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
After completing this lesson, you should be able to
do the following:
List the capabilities of SQL SELECT statements
Execute a basic SELECT statement
Differentiate between SQL statements and iSQL*Plus commands
http://phpexecutor.com
This document provides an overview of SQL programming including:
- A brief history of SQL and how it has evolved over time.
- Key SQL fundamentals like database structures, tables, relationships, and normalization.
- How to define and modify database structures using commands like CREATE, ALTER, DROP.
- How to manipulate data using INSERT, UPDATE, DELETE, and transactions.
- How to retrieve data using SELECT statements, joins, and other techniques.
- How to aggregate data using functions like SUM, AVG, MAX, MIN, and COUNT.
- Additional topics covered include subqueries, views, and resources for further learning.
This document provides an overview of SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. It describes what SQL can do, such as execute queries, retrieve, insert, update and delete data. It also covers important SQL statements (SELECT, UPDATE, DELETE, INSERT), clauses (WHERE, ORDER BY), operators (LIKE), joins, and functions. In addition, it discusses SQL data types, constraints, creating tables and indexes.
PL/SQL is Oracle's standard language for accessing and manipulating data in Oracle databases. It allows developers to integrate SQL statements with procedural constructs like variables, conditions, and loops. PL/SQL code is organized into blocks that define a declarative section for variable declarations and an executable section containing SQL and PL/SQL statements. Variables can be scalar, composite, reference, or LOB types and are declared in the declarative section before being used in the executable section.
SQL is a standard language for querying and manipulating data in relational databases. It contains five categories of statements: data definition language (DDL) for defining data structure, data manipulation language (DML) for managing data, data control language (DCL) for privileges, transaction control statements for transactions, and session control statements for sessions. Common DDL commands include CREATE, ALTER, and DROP for databases and tables. Common DML commands include SELECT, INSERT, UPDATE, and DELETE for querying and modifying data. Joins are used to combine data from two or more tables.
After completing this lesson, you should be able to
do the following:
Describe the types of problem that subqueries can solve
Define subqueries
List the types of subqueries
Write single-row and multiple-row subqueries
http://phpexecutor.com
This document discusses SQL constraints. It defines constraints as limitations on the type of data that can go into a table. The main types of constraints covered are:
1. Not null constraints, which enforce that a column cannot be null
2. Unique constraints, which uniquely identify each record in a table
3. Primary key constraints, which uniquely identify each record and cannot be null
4. Foreign key constraints, which link to primary keys in other tables to define relationships
5. Check constraints, which define valid value ranges for a column
6. Default constraints, which provide a default value for a column if no other value is specified.
Examples are provided for each constraint type to illustrate their syntax and usage
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
The document discusses the relational data model and query languages. It provides the following key points:
1. The relational data model organizes data into tables with rows and columns, where rows represent records and columns represent attributes. Relations between data are represented through tables.
2. Relational integrity constraints include key constraints, domain constraints, and referential integrity constraints to ensure valid data.
3. Relational algebra and calculus provide theoretical foundations for query languages like SQL. Relational algebra uses operators like select, project, join on relations, while relational calculus specifies queries using logic.
This document discusses database languages used in database management systems (DBMS). It describes three types of database languages: data definition language (DDL) used to define and modify the database schema; data manipulation language (DML) used to insert, update, delete and retrieve data; and data control language (DCL) used to control access privileges. Examples are provided for common statements in each language type like CREATE, ALTER, DROP for DDL and INSERT, UPDATE, DELETE, SELECT for DML. Case sensitivity and data types are also briefly covered.
This document provides an overview of executable statements in PL/SQL blocks. It discusses lexical units like identifiers, delimiters, and literals. It describes PL/SQL block syntax and guidelines for writing executable code. It also covers commenting code, using SQL functions, data type conversion, and nested blocks. The document provides examples and best practices for writing readable and maintainable PL/SQL code.
SQL is a non-procedural language used to create, manipulate, and retrieve data from databases. It includes various data types, operators, and functions. The document outlines SQL concepts like datatypes, operators, database concepts, processing capabilities including DDL, DML, DCL and TCL statements. It also discusses joins, aggregate functions, stored procedures, indexes, and triggers.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
Set operations allow combining results from multiple SELECT statements. There are four main types:
Union combines results and eliminates duplicates. Intersect returns only common records. Union All and Intersect All also show duplicate rows. Syntax involves a SELECT query followed by a set operator and another SELECT query.
This document discusses different types of SQL functions including string, numeric, conversion, group, date/time, and user-defined functions. It provides examples of common string functions like UPPER, LENGTH, SUBSTR. Numeric functions covered include ABS, ROUND, POWER. Group functions include AVG, COUNT, MAX, MIN, SUM. Date functions allow conversion and calculation involving dates. The document demonstrates how to create scalar and table-valued user-defined functions in SQL.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
The document discusses views in SQL. It defines views as logical tables that represent data from one or more underlying tables. Views can be queried, updated, and deleted from like tables but do not occupy storage space. The document describes simple views based on a single table and complex views involving joins across multiple tables. It provides examples of creating, modifying, dropping, and querying views. The document also discusses indexes in SQL, describing them as pointers that speed up data retrieval. It covers B-tree and bitmap indexes and provides examples of creating indexes on tables.
PL/SQL is a combination of SQL and procedural languages that enhances SQL's capabilities. It allows processing of SQL statements as a block. A PL/SQL block consists of optional declaration, mandatory execution, and optional exception sections. Variables, constants, records can be declared in the declaration section and used in the execution section. The execution section contains the main program logic. Exceptions are handled in the exception section. PL/SQL supports programming constructs like conditional statements and loops.
The document discusses stored procedures in databases. It defines stored procedures as procedures that are stored in a database with a name, parameter list, and SQL statements. The key points covered include:
- Stored procedures are created using the CREATE PROCEDURE statement and can contain SQL statements and control flow statements like IF/THEN.
- Parameters can be used to pass data into and out of stored procedures.
- Variables can be declared and used within stored procedures.
- Cursors allow stored procedures to iterate through result sets row by row to perform complex logic.
- Error handling and exceptions can be managed within stored procedures using DECLARE HANDLER.
Stored procedures offer benefits
SQL - Structured query language introductionSmriti Jain
SQL is a language used to define, manipulate, and control relational databases. It has four main components: DDL for defining schemas; DML for manipulating data within schemas; DCL for controlling access privileges; and DQL for querying data. Some key SQL concepts covered include data definition using CREATE, ALTER, DROP statements; data manipulation using SELECT, INSERT, UPDATE, DELETE; and joining data across tables using conditions. Advanced topics include views, aggregation, subqueries, and modifying databases.
Joins in SQL are used to combine data from two or more tables based on common columns between them. There are several types of joins, including inner joins, outer joins, and cross joins. Inner joins return rows that match between tables, outer joins return all rows including non-matching rows, and cross joins return the cartesian product between tables.
Pebble IT offers a range of Oracle Database services including remote DBA support, database setup and configuration, installation, recovery, security, performance tuning, and management of Oracle features. Their services are tailored to organizational requirements and provided by experts across Oracle, MS SQL, MySQL, and Sybase. Clients benefit from 24x7 access to expert help, guaranteed high quality service, and flexible pricing plans.
The document outlines the content of an Oracle APPS DBA training course, including sections on installing and configuring R12 Oracle Applications, the application architecture, using administration utilities, patching and maintenance, advanced topics like cloning, and system administration fundamentals like security, concurrent programs, and DBA duties. The course contains over 10 topics and over 50 individual lessons that provide instruction on managing, maintaining, and administering an Oracle E-Business Suite environment.
This document provides an overview of SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. It describes what SQL can do, such as execute queries, retrieve, insert, update and delete data. It also covers important SQL statements (SELECT, UPDATE, DELETE, INSERT), clauses (WHERE, ORDER BY), operators (LIKE), joins, and functions. In addition, it discusses SQL data types, constraints, creating tables and indexes.
PL/SQL is Oracle's standard language for accessing and manipulating data in Oracle databases. It allows developers to integrate SQL statements with procedural constructs like variables, conditions, and loops. PL/SQL code is organized into blocks that define a declarative section for variable declarations and an executable section containing SQL and PL/SQL statements. Variables can be scalar, composite, reference, or LOB types and are declared in the declarative section before being used in the executable section.
SQL is a standard language for querying and manipulating data in relational databases. It contains five categories of statements: data definition language (DDL) for defining data structure, data manipulation language (DML) for managing data, data control language (DCL) for privileges, transaction control statements for transactions, and session control statements for sessions. Common DDL commands include CREATE, ALTER, and DROP for databases and tables. Common DML commands include SELECT, INSERT, UPDATE, and DELETE for querying and modifying data. Joins are used to combine data from two or more tables.
After completing this lesson, you should be able to
do the following:
Describe the types of problem that subqueries can solve
Define subqueries
List the types of subqueries
Write single-row and multiple-row subqueries
http://phpexecutor.com
This document discusses SQL constraints. It defines constraints as limitations on the type of data that can go into a table. The main types of constraints covered are:
1. Not null constraints, which enforce that a column cannot be null
2. Unique constraints, which uniquely identify each record in a table
3. Primary key constraints, which uniquely identify each record and cannot be null
4. Foreign key constraints, which link to primary keys in other tables to define relationships
5. Check constraints, which define valid value ranges for a column
6. Default constraints, which provide a default value for a column if no other value is specified.
Examples are provided for each constraint type to illustrate their syntax and usage
Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
The document discusses the relational data model and query languages. It provides the following key points:
1. The relational data model organizes data into tables with rows and columns, where rows represent records and columns represent attributes. Relations between data are represented through tables.
2. Relational integrity constraints include key constraints, domain constraints, and referential integrity constraints to ensure valid data.
3. Relational algebra and calculus provide theoretical foundations for query languages like SQL. Relational algebra uses operators like select, project, join on relations, while relational calculus specifies queries using logic.
This document discusses database languages used in database management systems (DBMS). It describes three types of database languages: data definition language (DDL) used to define and modify the database schema; data manipulation language (DML) used to insert, update, delete and retrieve data; and data control language (DCL) used to control access privileges. Examples are provided for common statements in each language type like CREATE, ALTER, DROP for DDL and INSERT, UPDATE, DELETE, SELECT for DML. Case sensitivity and data types are also briefly covered.
This document provides an overview of executable statements in PL/SQL blocks. It discusses lexical units like identifiers, delimiters, and literals. It describes PL/SQL block syntax and guidelines for writing executable code. It also covers commenting code, using SQL functions, data type conversion, and nested blocks. The document provides examples and best practices for writing readable and maintainable PL/SQL code.
SQL is a non-procedural language used to create, manipulate, and retrieve data from databases. It includes various data types, operators, and functions. The document outlines SQL concepts like datatypes, operators, database concepts, processing capabilities including DDL, DML, DCL and TCL statements. It also discusses joins, aggregate functions, stored procedures, indexes, and triggers.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
Set operations allow combining results from multiple SELECT statements. There are four main types:
Union combines results and eliminates duplicates. Intersect returns only common records. Union All and Intersect All also show duplicate rows. Syntax involves a SELECT query followed by a set operator and another SELECT query.
This document discusses different types of SQL functions including string, numeric, conversion, group, date/time, and user-defined functions. It provides examples of common string functions like UPPER, LENGTH, SUBSTR. Numeric functions covered include ABS, ROUND, POWER. Group functions include AVG, COUNT, MAX, MIN, SUM. Date functions allow conversion and calculation involving dates. The document demonstrates how to create scalar and table-valued user-defined functions in SQL.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
The document discusses views in SQL. It defines views as logical tables that represent data from one or more underlying tables. Views can be queried, updated, and deleted from like tables but do not occupy storage space. The document describes simple views based on a single table and complex views involving joins across multiple tables. It provides examples of creating, modifying, dropping, and querying views. The document also discusses indexes in SQL, describing them as pointers that speed up data retrieval. It covers B-tree and bitmap indexes and provides examples of creating indexes on tables.
PL/SQL is a combination of SQL and procedural languages that enhances SQL's capabilities. It allows processing of SQL statements as a block. A PL/SQL block consists of optional declaration, mandatory execution, and optional exception sections. Variables, constants, records can be declared in the declaration section and used in the execution section. The execution section contains the main program logic. Exceptions are handled in the exception section. PL/SQL supports programming constructs like conditional statements and loops.
The document discusses stored procedures in databases. It defines stored procedures as procedures that are stored in a database with a name, parameter list, and SQL statements. The key points covered include:
- Stored procedures are created using the CREATE PROCEDURE statement and can contain SQL statements and control flow statements like IF/THEN.
- Parameters can be used to pass data into and out of stored procedures.
- Variables can be declared and used within stored procedures.
- Cursors allow stored procedures to iterate through result sets row by row to perform complex logic.
- Error handling and exceptions can be managed within stored procedures using DECLARE HANDLER.
Stored procedures offer benefits
SQL - Structured query language introductionSmriti Jain
SQL is a language used to define, manipulate, and control relational databases. It has four main components: DDL for defining schemas; DML for manipulating data within schemas; DCL for controlling access privileges; and DQL for querying data. Some key SQL concepts covered include data definition using CREATE, ALTER, DROP statements; data manipulation using SELECT, INSERT, UPDATE, DELETE; and joining data across tables using conditions. Advanced topics include views, aggregation, subqueries, and modifying databases.
Joins in SQL are used to combine data from two or more tables based on common columns between them. There are several types of joins, including inner joins, outer joins, and cross joins. Inner joins return rows that match between tables, outer joins return all rows including non-matching rows, and cross joins return the cartesian product between tables.
Pebble IT offers a range of Oracle Database services including remote DBA support, database setup and configuration, installation, recovery, security, performance tuning, and management of Oracle features. Their services are tailored to organizational requirements and provided by experts across Oracle, MS SQL, MySQL, and Sybase. Clients benefit from 24x7 access to expert help, guaranteed high quality service, and flexible pricing plans.
The document outlines the content of an Oracle APPS DBA training course, including sections on installing and configuring R12 Oracle Applications, the application architecture, using administration utilities, patching and maintenance, advanced topics like cloning, and system administration fundamentals like security, concurrent programs, and DBA duties. The course contains over 10 topics and over 50 individual lessons that provide instruction on managing, maintaining, and administering an Oracle E-Business Suite environment.
- Razak has over 9 years of experience as an Oracle Database Administrator providing support for development and production databases.
- He has extensive experience installing, configuring, and administering Oracle databases from versions 8i to 11g on various platforms including Linux, Solaris, AIX, and Windows.
- His skills include performance tuning, backup and recovery, disaster recovery, high availability, and database migrations.
Restricting and Sorting Data - Oracle Data BaseSalman Memon
This document discusses how to restrict and sort data retrieved by SQL queries. It describes how to limit rows using the WHERE clause with various comparison operators like equal to, greater than, between, in, like, and is null. Logical operators like AND, OR and NOT can be used with WHERE. Rows can be sorted using the ORDER BY clause, specifying columns and expressions to sort on in ascending or descending order. Multiple columns can be used in the ORDER BY to further refine the sorting.
Oracle Enterprise Manager is a set of system management tools from Oracle for managing Oracle products and some non-Oracle products. It has two versions - a web-based version for managing individual databases and servers collectively, and a GUI-based version with additional licensed management packs. Oracle Enterprise Manager 12c adds capabilities for application, middleware, database, Exadata, hardware and cloud management, as well as lifecycle management, monitoring, and application quality management. It can also manage some non-Oracle products through extensions.
This document provides an overview of key concepts in Oracle database administration including:
1) Installing and configuring Oracle databases, exploring the physical and logical database architecture, and managing database storage structures.
2) Administering user security through creating users, granting privileges, and managing roles.
3) Performing backup and recovery of Oracle databases using both user-managed and RMAN-managed methods.
4) Additional topics covered include high availability features like Data Guard, performance tuning, and Oracle Grid Control.
The document provides an overview of Oracle Enterprise Manager 12c (OEM12c) with the following key points:
1. It introduces OEM12c and its capabilities for complete cloud lifecycle management including planning, building, testing, deploying, monitoring cloud services.
2. It discusses how to install OEM12c including checking requirements, using the bundle patch, and setting the correct hostname during installation.
3. It covers some common troubleshooting steps like resolving issues with configuration requirements and changing the hostname or IP address.
4. It provides some tips for OEM12c like creating scripts for starting, stopping and checking status, and backing up the admin server configuration.
5.
The document discusses the steps for creating an Oracle database instance, including understanding prerequisites, configuring initial settings, and using tools like the Database Configuration Assistant. It covers choosing a database type and management method, authentication options, storage mechanisms, and file management techniques. The key aspects are installing Oracle software, using DBCA or scripts to create the database, selecting initialization parameters, and starting/stopping the database instance.
Oracle Enterprise Manager provides integrated application-to-disk management of Oracle technologies. It can manage databases, middleware, applications, and virtualization platforms. The presentation discusses Enterprise Manager's capabilities for database lifecycle management, performance monitoring, cloud management, and chargeback and metering. It also covers Enterprise Manager's support for private and public cloud deployments.
Oracle Enterprise Manager 12c: The Oracle Monitoring tool of choice – Why yo...Jeff Kayser
The document discusses new features in Oracle Enterprise Manager 12c including a huge number of new features, a new architecture with pluggable target types, and an ITIL-inspired event management system. It also covers the new security model with more granular predefined roles and named credentials, and changes to licensing that make some previously licensed features available in the base platform.
The document discusses database design and relational database management systems. It covers key concepts like normalization, primary keys, foreign keys, and relationships between tables. Normalization is the process of organizing data to eliminate redundancy and ensure data is stored correctly. There are five normal forms with third normal form being sufficient for most applications. Tables are related through primary and foreign keys and different types of relationships can exist between tables like one-to-one, one-to-many, and many-to-many.
A database administrator is responsible for installing, configuring, upgrading, administering, monitoring and maintaining databases. Key responsibilities include database design, performance and capacity issues, data replication, and table maintenance. DBAs ensure proper data organization and management through their skills in SQL, database design, and knowledge of database management systems and operating systems. There are several types of DBAs based on their specific roles like system DBA, database architect, and data warehouse administrator.
This document provides information on creating and managing database tables in Oracle, including defining columns and data types, creating tables, altering tables, dropping tables, and other table operations. Key topics covered include the CREATE TABLE statement, data types, datetime data types, creating tables using subqueries, the ALTER TABLE statement, adding and dropping columns, truncating and dropping tables, and adding comments to tables. The overall goal is to describe how to create, modify and delete database tables through SQL statements.
DDL. data defination language for creating databaseSHAKIR325211
data defination language database management systems how to create a databse how to insert a record and how to select a particular coloums and fields for instance select records from employee database or select fields of particular coloumns in database than wright query Similarly, the meaning of a query in database management is a request for data . If you need to access, manipulate, delete, or retrieve data from your relational database, you'll need a database query written using a specific syntax. Our SQL tutorial will teach you how to use SQL in: MySQL, SQL Server, MS Access, Oracle, Sybase, Informix, Postgres, and other database systems.If you are adding values for all the columns of the table, you do not need to specify the column names in the SQL query. However, make sure the order of the values is in the same order as the columns in the table. Here, the INSERT INTO syntax would be as follows and somany features in database management systms Data is a collection of a distinct small unit of information. It can be used in a variety of forms like text, numbers, media, bytes, etc. it can be stored in pieces of paper or electronic memory, etc.
Word 'Data' is originated from the word 'datum' that means 'single piece of information.' It is plural of the word datum.
In computing, Data is information that can be translated into a form for efficient movement and processing. Data is interchangeable. You can organize data into tables, rows, columns, and index it to make it easier to find relevant information.
Database handlers create a database in such a way that only one set of software program provides access of data to all the users.
The main purpose of the database is to operate a large amount of information by storing, retrieving, and managing data.
There are many dynamic websites on the World Wide Web nowadays which are handled through databases. For example, a model that checks the availability of rooms in a hotel. It is an example of a dynamic website that uses a database.
There are many databases available like MySQL, Sybase, Oracle, MongoDB, Informix, PostgreSQL, SQL Server, etc.
Modern databases are managed by the database management system (DBMS). 1968 was the year when File-Based database were introduced. In file-based databases, data was maintained in a flat file. Though files have many advantages, there are several limitations.
One of the major advantages is that the file system has various access methods, e.g., sequential, indexed, and random.
It requires extensive programming in a third-generation language such as COBOL, BASIC.Cloud database facilitates you to store, manage, and retrieve their structured, unstructured data via a cloud platform. This data is accessible over the Internet. Cloud databases are also called a database as service (DBaaS) because they are offered as a managed service.A NoSQL database is an approach to design such databases that can accommodate a wide variety of data models. NoSQL can handle an exte
This document discusses how to create and manage database tables using data definition language (DDL) statements in Oracle. It covers how to create tables, add columns and constraints, reference other users' tables, and drop tables. The key database objects are described as are the various data types, datetime data types, and constraint types that can be used when defining tables. Examples are provided for creating tables with different constraints.
The document discusses how to create and manage database tables using data definition language (DDL) statements in Oracle. It covers:
- The main database objects like tables, views, sequences, indexes and synonyms
- Rules for naming tables and columns
- The CREATE TABLE statement and options for specifying columns, data types, constraints, and default values
- Types of constraints like NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY and CHECK
- Techniques for creating tables like using subqueries and the ALTER TABLE statement
After completing this lesson, you should be able to do the following:
Describe the main database objects
Create tables
Describe the datatypes that can be used when specifying column definition
Alter table definitions
Drop, rename, and truncate tables
Less08_Schema Advanced Databases and Management.pptxMurtazaMughal13
This document discusses managing schema objects in an Oracle database. It defines what a schema is and describes different schema objects like tables, constraints, indexes, views, sequences and temporary tables. It provides instructions on how to create, modify and view these objects and explains concepts like data integrity, indexing and using sequences. The goal is to teach how to define data types, create and modify tables, define constraints, create indexes, views, sequences and use temporary tables when working with schema objects in an Oracle database.
This document provides an overview of schema objects and how to manage them in a database. It defines schema objects as the logical constraints that define how data is organized in a relational database, including tables, fields, data types, and relationships. It describes how to create and modify tables, define constraints, create indexes, and use temporary tables. The key objectives covered are defining schema objects and data types, creating and modifying tables, defining constraints, creating indexes, and explaining the use of temporary tables.
This document discusses how to create and manage database tables. It covers how to create tables, add and modify columns, drop tables, rename objects, truncate tables, and add comments. The key statements covered are CREATE TABLE, ALTER TABLE, DROP TABLE, RENAME, TRUNCATE, and COMMENT. It also discusses data types that can be used for table columns.
The document provides information on using data definition language (DDL) statements to create and manage database tables in Oracle, including how to:
- Define the structure of tables using the CREATE TABLE statement by specifying column names, data types, constraints, etc.
- Add, modify, or drop columns on existing tables using the ALTER TABLE statement.
- Create a new table populated with data from an existing table using a subquery with the CREATE TABLE statement.
This document discusses how to create and manage database tables using SQL statements in Oracle. It covers topics such as naming rules for tables, the CREATE TABLE statement including specifying data types and constraints, accessing other users' tables, and making changes to existing tables using the ALTER TABLE statement. The goal is to teach how to categorize database objects, understand table structure, create tables with different constraints, and describe how schema objects work together.
After completing this lesson, you should be able to
do the following:
Create, maintain, and use sequences
Create and maintain indexes
Create private and public synonyms
http://phpexecutor.com
The document provides an overview of SQL Server training. It defines data and databases, explaining that a collection of data leads to a database. It also discusses database management systems (DBMS), explaining that a DBMS allows users to create, read, update and delete data in an organized way. The document also covers types of databases like hierarchical, network, relational and object-oriented databases. It focuses on relational database management systems (RDBMS) and discusses advantages like storing data uniquely and performing complex queries. Finally, it discusses Microsoft SQL Server in more detail.
This document provides an overview of managing schema objects in Oracle databases. It defines schema objects and data types, and describes how to create and modify tables, define constraints, create indexes, create views, use sequences, work with temporary tables, and utilize the data dictionary. The objectives are to understand and work with these various schema objects through SQL commands.
The document discusses Structured Query Language (SQL) and its basic statements. It covers:
- SQL is used to request and retrieve data from databases. The DBMS processes SQL queries and returns results.
- SQL statements are divided into DDL (data definition language) for managing schema, DML (data manipulation language) for data queries/modification, and DCL (data control language) for managing transactions and access control.
- The document provides examples of using SQL commands like CREATE TABLE, ALTER TABLE, DROP TABLE, INSERT, UPDATE, DELETE, SELECT and indexes. It also covers data types, constraints and operators used in SQL queries.
This document provides information about SQL and database management systems. It discusses:
- SQL is a standard language for querying, manipulating, and defining data in databases. It was developed by IBM in the 1970s.
- SQL can be used to perform functions like retrieving data from a database, inserting new records, updating existing records, and deleting records.
- The main components of SQL are DDL, DML, DCL, and DQL which allow creating, modifying and deleting database structures, manipulating data, controlling access to data, and querying data respectively.
- Common SQL statements are discussed including SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE TABLE, and DROP TABLE. Data types and
After completing this lesson, you should be able to do the following:
Create user-defined PL/SQL records
Create a record with the %ROWTYPE attribute
Create a PL/SQL table
Create a PL/SQL table of records
Describe the difference between records, tables, and tables of records
Les03 Single Row Functions in Oracle and SQL.pptDrZeeshanBhatti
Functions make the basic query block more powerful and are used to manipulate data values. This is the first of two lessons that explore functions. It focuses on single-row character, number, and date functions, as well as those functions that convert data from one type to another, for example, character data to numeric data.
This document discusses how to create, manage, and modify database tables in Oracle. The key points covered include how to create tables with column definitions and datatypes, alter tables by adding, modifying or dropping columns, rename and truncate tables, and add comments to tables. Operations like create, alter, drop, and truncate allow managing the structure of tables, while comments provide descriptive information.
This document discusses how to create and manage database tables in Oracle. It describes how to create tables with columns of different data types, alter table definitions by adding or modifying columns, drop and rename tables, and add comments to tables. The key database objects like tables, views, indexes and sequences are also introduced. Common SQL statements used for managing tables like CREATE TABLE, ALTER TABLE, DROP TABLE, COMMENT and more are explained with examples.
Similar to Creating and Managing Tables -Oracle Data base (20)
The document covers various topics related to CSS including CSS introduction, syntax, selectors, inclusion methods, setting backgrounds, fonts, manipulating text, and working with images. Key points include how CSS handles web page styling, the advantages of CSS, CSS versions, associating styles using embedded, inline, external and imported CSS, and properties for backgrounds, fonts, text formatting, and images.
This document provides an overview and instructions for using Adobe Dreamweaver CS6. It begins with an introduction to Dreamweaver, explaining that it is a complete website development program that works with technologies like HTML, CSS, JavaScript, and PHP. It then provides step-by-step instructions for setting up a local root folder to contain website files, creating a homepage named index.html, inserting and formatting tables, previewing pages in a browser, and creating hyperlinks between pages.
what is programming and its clear Concepts to the point Salman Memon
This document provides an introduction to programming and programming languages. It explains that programming involves breaking problems down into step-by-step instructions for computers to execute. Several popular programming languages are listed, including C, Java, Python, and JavaScript. The document also shows simple "Hello World" programs written in different languages like Python, C, C#, and Java to demonstrate writing source code.
The document discusses working with variables in PHP including creating variables, variable naming conventions, variable types, strings, operators, and increment/decrement operations. Key points include:
- Variables are created using a dollar sign followed by the name (e.g. $variableName) and can be assigned values.
- Variable names are case-sensitive.
- PHP uses weak/dynamic typing so variables can hold different data types.
- Strings can be delimited by double or single quotes and escape characters can be used inside strings.
- Operators like =, +, -, *, / can be used to assign values and perform math operations on variables.
This document discusses HTML form controls and elements. It explains that hidden form controls allow passing information between pages without the user seeing it. Div and span elements are used to group block and inline elements, respectively. The document provides examples of using these elements and assigns creating a multi-page form as a homework exercise.
This document discusses HTML forms and form elements. It explains that forms are used to collect information from users on a web page. Key elements discussed include:
- The <form> tag which contains all form fields and attributes like action and method.
- Common form field types like text, password, checkbox, radio, submit, and reset.
- Differences between GET and POST methods.
- Other elements like <textarea> and <select> with <option> for multi-line text and drop-down lists.
- Environment variables $_GET, $_POST and $_REQUEST for accessing submitted form data in PHP.
The document discusses different types of lists that can be created in HTML, including unordered lists, ordered lists, and definition lists. It provides examples of how to write the code for each type of list using tags like <ul>, <ol>, and <dl>. The document also covers HTML table elements, describing how to structure tables using tags like <table>, <tr>, <td>, <th>, <thead>, <tbody>, and <tfoot>. It provides examples of how to use attributes like colspan and rowspan to merge table cells, as well as how to add styling to tables. Finally, it lists some assignments for students to practice creating lists, tables, and basic calculators and forms using HTML.
The document discusses various HTML tags for images, links, and email links. It provides the syntax and attributes for image tags like <img> and describes how to specify image source, size, alignment, and more. It also explains the different types of links - internal, local, and global - and how to create them using <a> tags and href attributes. The document concludes with assignments to create basic web pages using these tags and linking between pages.
The document provides information on HTML (Hypertext Markup Language) including what the World Wide Web and hypertext are, the basic structure and elements of an HTML document, common HTML tags for formatting text like headings, paragraphs, line breaks, and bold/italic text, and how to add comments in HTML.
Organizations are “collections of people working together, in divisions of labor, to achieve a common purpose.”
“Synergy” = the creation of a whole that is greater than the sum of its parts.
Open systems exchange input and output with the environment.
http://phpexecutor.com
Topics that will be emphasized in this class include
Technology Strategy
Development of Technological capability
Innovation management
Technology management and business competitiveness interface
Technology adoption
E-business and Virtual Corporation
http://phpexecutor.com
Align Information Technology and Business Strategy Salman Memon
Align Information Technology and Business Strategy
The mission critical, long-term IT choices made by a firm.
Commitment to build IT capability
http://phpexecutor.com
WHITE BOX & BLACK BOXTESTING IN DATABASESalman Memon
White box & black box are software testing methods.
Software testing is a process that should be done during the development process. In other words software testing is a verification and validation process.
Verification : is the process to make sure the product satisfies the conditions imposed at the start of the development phase. In other words, to make sure the product behaves the way we want it to.
http://phpexecutor.com
E-Mail Electronic mail
A method of exchanging messages in digital form.
E-mail systems are based on a store-and-forward method in which e-mail server accept, forwards, delivers and stores messages on behalf of users.
Users only need to connect to the internet through a computer for the duration of message submission or retrieval
http://phpexecutor.com
Electronic mail, most commonly called email or e-mail since around 1993
E-mail is one of the most widely used forms of communication today.
E-mail is faster and cheaper than traditional postal mail, but at least when you seal that envelope and stick a stamp on it, you can have some confidence that only the intended recipient will open it.
With e-mail, however, your message could be intercepted midstream, and you might never realize it. You have to take steps to secure and protect your e-mail messages.
http://phpexecutor.com
Process of minimizing the resource usage.
Aims of Query Decomposition
To transform a high-level query into a Relational Algebra query
&
To check the query is syntactically and semantically correct
It is efficient way to retrieve data
from database.
http://phpexecutor.com
Time management is an art. It is arranging, organizing and budgeting time for the purpose of accomplishing something within a time.
Time management is having control over the amount of time spent on a particular activity.
Hence, time management helps an individual to be more organized and more productive.
http://phpexecutor.com
What is video conferencing
A videoconference is a live connection between people in separate locations for the purpose of communication, usually involving audio and often text as well as video. At its simplest, videoconferencing provides transmission of static images and text between two locations. At its most sophisticated, it provides transmission of full-motion video images and high-quality audio between multiple locations.
http://phpexecutor.com
A hash function usually means a function that compresses, meaning the output is shorter than the input
A hash function takes a group of characters (called a key) and maps it to a value of a certain length (called a hash value or hash).
The hash value is representative of the original string of characters, but is normally smaller than the original.
This term is also known as a hashing algorithm or message digest function.
Hash functions also called message digests or one-way encryption or hashing algorithm.
http://phpexecutor.com
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Lesson Aim
In this lesson, you learn about tables, the main database objects, and their relationships to each other. You also learn how to create, alter, and drop tables.
Database Objects
An Oracle database can contain multiple data structures. Each structure should be outlined in the database design so that it can be created during the build stage of database development.
Table: Stores data
View: Subset of data from one or more tables
Sequence: Numeric value generator
Index: Improves the performance of some queries
Synonym: Gives alternative names to objects
Oracle9i Table Structures
Tables can be created at any time, even while users are using the database.
You do not need to specify the size of any table. The size is ultimately defined by the amount of space allocated to the database as a whole. It is important, however, to estimate how much space a table will use over time.
Table structure can be modified online.
Note: More database objects are available but are not covered in this course.
Instructor Note
Tables can have up to 1,000 columns and must conform to standard database object-naming conventions. Column definitions can be omitted when using the AS subquery clause. Tables are created without data unless a query is specified. Rows are usually added by using INSERT statements.
Naming Rules
Name database tables and columns according to the standard rules for naming any Oracle database object:
Table names and column names must begin with a letter and be 1–30 characters long.
Names must contain only the characters A–Z, a–z, 0–9, _ (underscore), $, and # (legal characters, but their use is discouraged).
Names must not duplicate the name of another object owned by the same Oracle server user.
Names must not be an Oracle server reserved word.
Naming Guidelines
Use descriptive names for tables and other database objects.
Note: Names are case insensitive. For example, EMPLOYEES is treated as the same name as eMPloyees or eMpLOYEES.
For more information, see Oracle9i SQL Reference,“Object Names and Qualifiers.”
The CREATE TABLE Statement
Create tables to store data by executing the SQL CREATE TABLE statement. This statement is one of the data definition language (DDL) statements, that are covered in subsequent lessons. DDL statements are a subset of SQL statements used to create, modify, or remove Oracle9i database structures. These statements have an immediate effect on the database, and they also record information in the data dictionary.
To create a table, a user must have the CREATE TABLE privilege and a storage area in which to create objects. The database administrator uses data control language (DCL) statements, which are covered in a later lesson, to grant privileges to users.
In the syntax:
schemais the same as the owner’s name
tableis the name of the table
DEFAULT exprspecifies a default value if a value is omitted in the INSERT statement
columnis the name of the column
datatypeis the column’s data type and length
Instructor Note
Please read the Instructor note on page 9-37
Referencing Another User’s Tables
A schema is a collection of objects. Schema objects are the logical structures that directly refer to the data in a database. Schema objects include tables, views, synonyms, sequences, stored procedures, indexes, clusters, and database links.
If a table does not belong to the user, the owner’s name must be prefixed to the table. For example, if there is a schema named USER_B, and USER_B has an EMPLOYEES table, then specify the following to retrieve data from that table:
SELECT *
FROM user_b.employees;
The DEFAULT Option
A column can be given a default value by using the DEFAULT option. This option prevents null values from entering the columns if a row is inserted without a value for the column. The default value can be a literal, an expression, or a SQL function, such as SYSDATE and USER, but the value cannot be the name of another column or a pseudocolumn, such as NEXTVAL or CURRVAL. The default expression must match the data type of the column.
Note: CURRVAL and NEXTVAL are explained later.
Instructor Note
Here is an example for a pseudocolumn. For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle server selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.
The default value works with the DEFAULT keyword for INSERT and UPDATE statements discussed in the “Manipulating Data” lesson.
Creating Tables
The example on the slide creates the DEPT table, with three columns: DEPTNO, DNAME, and LOC. It further confirms the creation of the table by issuing the DESCRIBE command.
Since creating a table is a DDL statement, an automatic commit takes place when this statement is executed.
Instructor Note
Explain that additional syntax for CREATE TABLE could include constraints and so on. For more information on the CREATE TABLE syntax, refer to: Oracle9i SQL Reference, “CREATE TABLE. ”
Tables in the Oracle Database
User tables are tables created by the user, such as EMPLOYEES. There is another collection of tables and views in the Oracle database known as the data dictionary. This collection is created and maintained by the Oracle server and contains information about the database.
All data dictionary tables are owned by the SYS user. The base tables are rarely accessed by the user because the information in them is not easy to understand. Therefore, users typically access data dictionary views because the information is presented in a format that is easier to understand. Information stored in the data dictionary includes names of the Oracle server users, privileges granted to users, database object names, table constraints, and auditing information.
There are four categories of data dictionary views; each category has a distinct prefix that reflects its intended use.
Querying the Data Dictionary
You can query the data dictionary tables to view various database objects owned by you. The data dictionary tables frequently used are these:
USER_TABLES
USER_OBJECTS
USER_CATALOG
Note: USER_CATALOG has a synonym called CAT. You can use this synonym instead of USER_CATALOG in SQL statements.
SELECT *
FROM CAT;
Data Types
Data Types (continued)
A LONG column is not copied when a table is created using a subquery.
A LONG column cannot be included in a GROUP BY or an ORDER BY clause.
Only one LONG column can be used per table.
No constraints can be defined on a LONG column.
You may want to use a CLOB column rather than a LONG column.
Instructor Note
Oracle8 introduced large object (LOB) data types that can store large and unstructured data such as text, image, video, and spatial data, up to 4 gigabytes in size. In Oracle9i, LONG columns can be easily migrated to LOB columns. Refer students to Oracle9i Migration Release 9.0.1 Guide.
Instructor Note (for page 9-13)
The date and time data types shown on the next page are new to release Oracle9i.
Other DateTime Data Types
DateTime Data Types
The fractional_seconds_precision optionally specifies the number of digits in the fractional part of the SECOND datetime field and can be a number in the range 0 to 9. The default is 6.
Example
CREATE TABLE new_employees
(employee_id NUMBER,
first_name VARCHAR2(15),
last_name VARCHAR2(15),
...
start_date TIMESTAMP(7),
...);
In the preceding example, we are creating a table NEW_EMPLOYEES with a column start_date with a data type of TIMESTAMP. The precision of &apos;7&apos; indicates the fractional seconds precision which if not specified defaults to &apos;6&apos;.
Assume that two rows are inserted into the NEW_EMPLOYEES table. The output shows the differences in the display. (A DATE data type defaults to display the format of DD-MON-RR):
SELECT start_date
FROM new_employees;
17-JUN-87 12.00.00.000000 AM
21-SEP-89 12.00.00.000000 AM
Datetime Data Types
UTC stands for Coordinated Universal Time—formerly Greenwich Mean Time. Two TIMESTAMP WITH TIME ZONE values are considered identical if they represent the same instant in UTC, regardless of the TIME ZONE offsets stored in the data.
Because TIMESTAMP WITH TIME ZONE can also store time zone information, it is particularly suited for recording date information that must be gathered or coordinated across geographic regions.
For example,
TIMESTAMP &apos;1999-04-15 8:00:00 -8:00&apos;
is the same as
TIMESTAMP &apos;1999-04-15 11:00:00 -5:00&apos;
That is, 8:00 a.m. Pacific Standard Time is the same as 11:00 a.m. Eastern Standard Time.
This can also be specified as
TIMESTAMP &apos;1999-04-15 8:00:00 US/Pacific&apos;
Note: fractional_seconds_precision optionally specifies the number of digits in the fractional part of the SECOND datetime field and can be a number in the range 0 to 9. The default is 6.
DateTime Data Types (continued)
Unlike TIMESTAMP WITH TIME ZONE, you can specify columns of type TIMESTAMP WITH LOCAL TIME ZONE as part of a primary or unique key. The time zone displacement is the difference (in hours and minutes) between local time and UTC. There is no literal for TIMESTAMP WITH LOCAL TIME ZONE.
Note: fractional_seconds_precision optionally specifies the number of digits in the fractional part of the SECOND datetime field and can be a number in the range 0 to 9. The default is 6.
Example
CREATE TABLE time_example
(order_date TIMESTAMP WITH LOCAL TIME ZONE);
INSERT INTO time_example VALUES(&apos;15-NOV-00 09:34:28 AM&apos;);
SELECT *
FROM time_example;
order_date
----------------------------
15-NOV-00 09.34.28.000000 AM
The TIMESTAMP WITH LOCAL TIME ZONE type is appropriate for two-tier applications where you want to display dates and times using the time zone of the client system.
INTERVAL YEAR TO MONTH Data Type
INTERVAL YEAR TO MONTH stores a period of time using the YEAR and MONTH datetime fields.
Use INTERVAL YEAR TO MONTH to represent the difference between two datetime values, where the only significant portions are the year and month. For example, you might use this value to set a reminder for a date 120 months in the future, or check whether 6 months have elapsed since a particular date.
Specify INTERVAL YEAR TO MONTH as follows:
INTERVAL YEAR [(year_precision)] TO MONTH
In the syntax:
year_precision is the number of digits in the YEAR datetime field. The default value of year_precision is 2.
Example
CREATE TABLE time_example2
(loan_duration INTERVAL YEAR (3) TO MONTH);
INSERT INTO time_example2 (loan_duration)
VALUES (INTERVAL &apos;120&apos; MONTH(3));
SELECT TO_CHAR( sysdate+loan_duration, &apos;dd-mon-yyyy&apos;)
FROM time_example2; --today’s date is 26-Sep-2001
INTERVAL DAY TO SECOND Data Type
INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and seconds.
Use INTERVAL DAY TO SECOND to represent the precise difference between two datetime values. For example, you might use this value to set a reminder for a time 36 hours in the future, or to record the time between the start and end of a race. To represent long spans of time, including multiple years, with high precision, you can use a large value for the days portion.
Specify INTERVAL DAY TO SECOND as follows:
INTERVAL DAY [(day_precision)]
TO SECOND [(fractional_seconds_precision)]
In the syntax:
day_precision is the number of digits in the DAY datetime field. Accepted values are 0 to 9. The default is 2.
fractional_seconds_precision is the number of digits in the fractional part of the SECOND datetime field. Accepted values are 0 to 9. The default is 6.
INTERVAL DAY TO SECOND Data Type (continued)
Example
CREATE TABLE time_example3
(day_duration INTERVAL DAY (3) TO SECOND);
INSERT INTO time_example3 (day_duration)
VALUES (INTERVAL &apos;180&apos; DAY(3));
SELECT sysdate + day_duration &quot;Half Year&quot;
FROM time_example3; --today’s date is 26-Sep-2001
Creating a Table from Rows in Another Table
A second method for creating a table is to apply the AS subquery clause, which both creates the table and inserts rows returned from the subquery.
In the syntax:
tableis the name of the table
columnis the name of the column, default value, and integrity constraint
subqueryis the SELECT statement that defines the set of rows to be inserted into the new table
Guidelines
The table is created with the specified column names, and the rows retrieved by the SELECT statement are inserted into the table.
The column definition can contain only the column name and default value.
If column specifications are given, the number of columns must equal the number of columns in the subquery SELECT list.
If no column specifications are given, the column names of the table are the same as the column names in the subquery.
The integrity rules are not passed onto the new table, only the column data type definitions.
Creating a Table from Rows in Another Table (continued)
The slide example creates a table named DEPT80, which contains details of all the employees working in department 80. Notice that the data for the DEPT80 table comes from the EMPLOYEES table.
You can verify the existence of a database table and check column definitions by using the iSQL*Plus DESCRIBE command.
Be sure to give a column alias when selecting an expression. The expression SALARY*12 is given the alias ANNSAL. Without the alias, this error is generated:
ERROR at line 3:
ORA-00998: must name this expression with a column alias
Instructor Note
To create a table with the same structure as an existing table, but without the data from the existing table, use a subquery with a WHERE clause that always evaluates as false. For example:
CREATE TABLE COPY_TABLE AS
(SELECT *
FROM employees
WHERE 1 = 2);
The ALTER TABLE Statement
After you create a table, you may need to change the table structure because: you omitted a column, your column definition needs to be changed, or you need to remove columns. You can do this by using the ALTER TABLE statement.
The ALTER TABLE Statement (continued)
You can add, modify, and drop columns to a table by using the ALTER TABLE statement.
In the syntax:
tableis the name of the table
ADD|MODIFY|DROPis the type of modification
columnis the name of the new column
datatypeis the data type and length of the new column
DEFAULT exprspecifies the default value for a new column
Note: The slide gives the abridged syntax for ALTER TABLE. More about ALTER TABLE is covered in a subsequent lesson.
Instructor Note
In Oracle8i and later, there are new options for the ALTER TABLE command, including the ability to drop a column from a table, which are covered later in this lesson.
Adding a Column
The graphic adds the JOB_ID column to the DEPT80 table. Notice that the new column becomes the last column in the table.
Guidelines for Adding a Column
You can add or modify columns.
You cannot specify where the column is to appear. The new column becomes the last column.
The example on the slide adds a column named JOB_ID to the DEPT80 table. The JOB_ID column becomes the last column in the table.
Note: If a table already contains rows when a column is added, then the new column is initially null for all the rows.
Modifying a Column
You can modify a column definition by using the ALTER TABLE statement with the MODIFY clause. Column modification can include changes to a column’s data type, size, and default value.
Guidelines
You can increase the width or precision of a numeric column.
You can increase the width of numeric or character columns.
You can decrease the width of a column only if the column contains only null values or if the table has no rows.
You can change the data type only if the column contains null values.
You can convert a CHAR column to the VARCHAR2 data type or convert a VARCHAR2 column to the CHAR data type only if the column contains null values or if you do not change the size.
A change to the default value of a column affects only subsequent insertions to the table.
Dropping a Column
You can drop a column from a table by using the ALTER TABLE statement with the DROP COLUMN clause. This is a feature available in Oracle8i and later.
Guidelines
The column may or may not contain data.
Using the ALTER TABLE statement, only one column can be dropped at a time.
The table must have at least one column remaining in it after it is altered.
Once a column is dropped, it cannot be recovered.
Instructor Note
When a column is dropped from a table, any other columns in that table that are marked with the SET UNUSED option are dropped too.
The SET UNUSED Option
The SET UNUSED option marks one or more columns as unused so that they can be dropped when the demand on system resources is lower. This is a feature available in Oracle8i and later. Specifying this clause does not actually remove the target columns from each row in the table (that is, it does not restore the disk space used by these columns). Therefore, the response time is faster than if you executed the DROP clause. Unused columns are treated as if they were dropped, even though their column data remains in the table’s rows. After a column has been marked as unused, you have no access to that column. A SELECT * query will not retrieve data from unused columns. In addition, the names and types of columns marked unused will not be displayed during a DESCRIBE, and you can add to the table a new column with the same name as an unused column. SET UNUSED information is stored in the USER_UNUSED_COL_TABS dictionary view.
The DROP UNUSED COLUMNS Option
DROP UNUSED COLUMNS removes from the table all columns currently marked as unused. You can use this statement when you want to reclaim the extra disk space from unused columns in the table. If the table contains no unused columns, the statement returns with no errors.
ALTER TABLE dept80
SET UNUSED (last_name);
Table altered.
ALTER TABLE dept80
DROP UNUSED COLUMNS;
Table altered.
Dropping a Table
The DROP TABLE statement removes the definition of an Oracle table. When you drop a table, the database loses all the data in the table and all the indexes associated with it.
Syntax
DROP TABLE table
In the syntax:
tableis the name of the table
Guidelines
All data is deleted from the table.
Any views and synonyms remain but are invalid.
Any pending transactions are committed.
Only the creator of the table or a user with the DROP ANY TABLE privilege can remove a table.
Note: The DROP TABLE statement, once executed, is irreversible. The Oracle server does not question the action when you issue the DROP TABLE statement. If you own that table or have a high-level privilege, then the table is immediately removed. As with all DDL statements, DROP TABLE is committed automatically.
Renaming a Table
Additional DDL statements include the RENAME statement, which is used to rename a table, view, sequence, or a synonym.
Syntax
RENAME old_name TO new_name;
In the syntax:
old_nameis the old name of the table, view, sequence, or synonym.
new_nameis the new name of the table, view, sequence, or synonym.
You must be the owner of the object that you rename.
Truncating a Table
Another DDL statement is the TRUNCATE TABLE statement, which is used to remove all rows from a table and to release the storage space used by that table. When using the TRUNCATE TABLE statement, you cannot roll back row removal.
Syntax
TRUNCATE TABLE table;
In the syntax:
tableis the name of the table
You must be the owner of the table or have DELETE TABLE system privileges to truncate a table.
The DELETE statement can also remove all rows from a table, but it does not release storage space. The TRUNCATE command is faster. Removing rows with the TRUNCATE statement is faster than removing them with the DELETE statement for the following reasons:
The TRUNCATE statement is a data definition language (DDL) statement and generates no rollback information.
Truncating a table does not fire the delete triggers of the table.
If the table is the parent of a referential integrity constraint, you cannot truncate the table. Disable the constraint before issuing the TRUNCATE statement.
Adding a Comment to a Table
You can add a comment of up to 2,000 bytes about a column, table, view, or snapshot by using the COMMENT statement. The comment is stored in the data dictionary and can be viewed in one of the following data dictionary views in the COMMENTS column:
ALL_COL_COMMENTS
USER_COL_COMMENTS
ALL_TAB_COMMENTS
USER_TAB_COMMENTS
Syntax
COMMENT ON TABLE table | COLUMN table.column
IS &apos;text&apos;;
In the syntax:
tableis the name of the tablecolumnis the name of the column in a tabletextis the text of the comment
You can drop a comment from the database by setting it to empty string (&apos;&apos;):
COMMENT ON TABLE employees IS &apos; &apos;;
Summary
In this lesson, you should have learned how to use DDL commands to create, alter, drop, and rename tables. You also learned how to truncate a table and add comments to a table.
CREATE TABLE
Create a table.
Create a table based on another table by using a subquery.
ALTER TABLE
Modify table structures.
Change column widths, change column data types, and add columns.
DROP TABLE
Remove rows and a table structure.
Once executed, this statement cannot be rolled back.
RENAME
Rename a table, view, sequence, or synonym.
TRUNCATE
Remove all rows from a table and release the storage space used by the table.
The DELETE statement removes only rows.
COMMENT
Add a comment to a table or a column.
Query the data dictionary to view the comment.
Practice 9 Overview
Create new tables by using the CREATE TABLE statement. Confirm that the new table was added to the database. Create the syntax in the command file, and then execute the command file to create the table.
Instructor Note
Explain what a table instance chart is. Tell students how to interpret a table instance chart. Explain that they need to look out for the entries in the Column Name, Data Type, and Length fields. The other entries are optional, and if these entries exist, they are constraints that need to be incorporated as a part of the table definition.
Point out to students that the practices are based on the tables that they are creating exclusively for this lesson. They need to be careful not to alter the other tables in the schema.
Practice 9
1.Create the DEPT table based on the following table instance chart. Place thesyntax in a script called lab9_1.sql, then execute the statement in the script to create the table. Confirm that the table is created.
2.Populate the DEPT table with data from the DEPARTMENTS table. Include only columns thatyou need.
3.Create the EMP table based on the following table instance chart. Place the syntax ina script called lab9_3.sql, and then execute the statement in the script to create the table. Confirm that the table is created.
Practice 9 (continued)
4.Modify the EMP table to allow for longer employee last names. Confirm your modification.
5.Confirm that both the DEPT and EMP tables are stored in the data dictionary. (Hint: USER_TABLES)
6.Create the EMPLOYEES2 table based on the structure of the EMPLOYEES table. Include only the EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY, and DEPARTMENT_ID columns. Name the columns in your new table ID, FIRST_NAME, LAST_NAME, SALARY , and DEPT_ID, respectively.
7.Drop the EMP table.
8.Rename the EMPLOYEES2 table as EMP.
9.Add a comment to the DEPT and EMP table definitions describing the tables. Confirm your additions in the data dictionary.
10. Drop the FIRST_NAME column from the EMP table. Confirm your modification by checking the description of the table.
11. In the EMP table, mark the DEPT_ID column in the EMP table as UNUSED. Confirm your modification by checking the description of the table.
12. Drop all the UNUSED columns from the EMP table. Confirm your modification by checking the description of the table.
Instructor Note (for page 9-5)
There is an option, CREATE GLOBAL TEMPORARY TABLE, that identifies a table as temporary and visible to all sessions. The data in a temporary table is visible only to the session that inserts data into the table.
A temporary table has a definition that persists like the definitions of regular tables, but it contains either session-specific or transaction-specific data. You specify whether the data is session- or transaction-specific with the ON COMMIT keywords. Temporary tables use temporary segments. Unlike permanent tables, temporary tables and their indexes do not automatically allocate a segment when they are created. Instead, segments are allocated when the first INSERT (or CREATE TABLE AS SELECT) statement is performed. This means that if a SELECT, UPDATE, or DELETE statement is performed before the first INSERT, then the table appears to be empty. You can perform DDL commands (ALTER TABLE, DROP TABLE, CREATE INDEX, and so on) on a temporary table only when no session is currently bound to it. A session gets bound to a temporary table when an INSERT is performed on it. The session gets unbound by a TRUNCATE, at session termination, or by doing a COMMIT or ABORT for a transaction-specific temporary table. Temporary segments are deallocated at the end of the transaction for transaction-specific temporary tables and at the end of the session for session-specific temporary tables.
For more information on temporary tables and CREATE TABLE, refer to Oracle9i Concepts, “Temporary Tables.”