BUY TELUGU TUTORIAL DVD'S:::: SEO::3500/-,DCA(DOS,WINDOWS,WORD,EXCEL,POWER POINT, MS ACCESS, INTERNET CONCEPTS)::499/-,DTP(PHOTOSHOP,PAGEMAKER, CORELDRAW,TELUGU TYPING)::999/-,C::700,C++::900,TALLY ERP 9:: 999,ORACLE:999/-,CORE JAVA::1000/-,SPOKEN HINDI:500,HTML::500/-,AUTOCAD::2500/-,DCA+DTP::1000/-,DCA+TALLY::1000,C,C++,JAVA::1500, ALL COURSES(DCA,DTP,C,C++,JAVA,ORACLE,TALLY,HTML,SPOKEN HINDI,AUTOCAD):: 3500/-..CONTACT : SYED HAFIZ, SHOPPING COMPLEX,8INCLINE COLONY,GODAVARI KHANI,KARIMNAGAR, TELANGANA,CELL:9395306603,EMAIL:COOLHAFI7@GMAIL.COM.
Home / Oracle In Telugu / Oracle tutorial for beginners in telugu Part 8

Oracle tutorial for beginners in telugu Part 8

Oracle tutorial for beginners in telugu

Oracle/PLSQL: CREATE TABLE Statement

This Oracle tutorial explains how to use the Oracle CREATE TABLE statement with syntax, examples, and practice exercises.

Description

The Oracle CREATE TABLE statement allows you to create and define a table.

Syntax

The syntax for the Oracle CREATE TABLE statement is:

CREATE TABLE table_name
(
  column1 datatype [ NULL | NOT NULL ],
  column2 datatype [ NULL | NOT NULL ],
  ...
);

Parameters or Arguments

table_name is the name of the table that you wish to create.

column1, column2 are the columns that you wish to create in the table. Each column must have a datatype. The column should either be defined as “null” or “not null” and if this value is left blank, the database assumes “null” as the default.

Example

Let’s look at an Oracle CREATE TABLE example.

CREATE TABLE customers
( customer_id number(10) not null,
  customer_name varchar2(50) not null,
  city varchar2(50)
);

This Oracle CREATE TABLE example creates a table called customers which has 3 columns.

  • The first column is called customer_id which is created as a number datatype (maximum 10 digits in length) and can not contain null values.
  • The second column is called customer_name which is a varchar2 datatype (50 maximum characters in length) and also can not contain null values.
  • The third column is called city which is a varchar2 datatype but can contain null values.

Now the only problem with this Oracle CREATE TABLE statement is that you have not defined a primary key for the table. We could modify this CREATE TABLE statement and define the customer_id as the primary key as follows:

CREATE TABLE customers
( customer_id number(10) not null,
  customer_name varchar2(50) not null,
  city varchar2(50),
  CONSTRAINT customers_pk PRIMARY KEY (customer_id)
);

Oracle/PLSQL: INSERT Statement

This Oracle tutorial explains how to use the Oracle INSERT statement with syntax and examples. We’ve also added some practice exercises that you can try for yourself.

Description

The Oracle INSERT statement is used to insert a single record or multiple records into a table in Oracle.

Syntax

The syntax for the Oracle INSERT statement when inserting a single record using the VALUES keyword is:

INSERT INTO table
(column1, column2, ... )
VALUES
(expression1, expression2, ... );

Or the syntax for the Oracle INSERT statement when inserting multiple records using a SELECT statement is:

INSERT INTO table
(column1, column2, ... )
SELECT expression1, expression2, ...
FROM source_table
WHERE conditions;

Parameters or Arguments

table is the table to insert the records into.

column1, column2 are the columns in the table to insert values.

expression1, expression2 are the values to assign to the columns in the table. So column1 would be assigned the value of expression1, column2 would be assigned the value of expression2, and so on.

source_table is the source table when inserting data from another table.

conditions are conditions that must be met for the records to be inserted.

Note

  • When inserting records into a table using the Oracle INSERT statement, you must provide a value for every NOT NULL column.
  • You can omit a column from the Oracle INSERT statement if the column allows NULL values.

Oracle/PLSQL: SELECT Statement

This Oracle tutorial explains how to use the Oracle SELECT statement with syntax, examples, and practice exercises.

Description

The Oracle SELECT statement is used to retrieve records from one or more tables in an Oracle database.

Syntax

The syntax for the Oracle SELECT statement is:

SELECT expressions
FROM tables
WHERE conditions;

Parameters or Arguments

expressions are the columns or calculations that you wish to retrieve.

tables are the tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause.

conditions are conditions that must be met for the records to be selected.

Example – Select all fields from one table

Let’s look at how to use an Oracle SELECT query to select all fields from a table.

SELECT *
FROM homes
WHERE bathrooms >= 2
ORDER BY home_type ASC;

In this Oracle SELECT statement example, we’ve used * to signify that we wish to select all fields from the homes table where the number of bathrooms is greater than or equal to 2. The result set is sorted by home_type in ascending order.

About Hafiz

Check Also

Oracle tutorial for beginners in telugu Part4

Oracle tutorial for beginners in telugu The Oracle Relational Database Management System (RDBMS) is an …

Leave a Reply

Your email address will not be published. Required fields are marked *

STATE BANK OF HYDERABAD, ***NAME:Hafiz SD, BRANCH:JALLARAM, ACCOUNT.NO:62041435239, IFSC CODE:SBHY0020609,****, ANDRA BANK*** NAME:SYED HAFEEZ BABA, BRANCH:8INCLINE COLONY, ACCOUNT.NO:116710100037533****SBI****NAME:SYED HAFEEZ BABA,ACCOUNT NO:35321924009,IFSC CODE:SBIN0013338,BRANCH:GODAVARIKHANI.,...