Like ❤ comment 💬 share ➡️
& Subscribe 👉 @rejawebs 👈
►Title:
Oracle - Creating Table | SELECT| INSERT | UPDARE | DELETE | TRUNCATE | DROP | ALTER TABLE ADD COLUMN | ALTER TABLE MODIFY COLUMN
how to create table in oracle 19c
oracle 19c create table example
oracle 19c create table
oracle 19c create table tablespace
oracle 19c create table as select
can oracle 19c client connect to 10g database
create table 19c
oracle 19 create table
oracle 19c create table syntax
oracle how to create tablespace
oracle 19 create tablespace
how to create table in oracle database 10g express edition
how to create tables in oracle sql developer
►Content:
--01. Create table
--To create a new table in Oracle Database, you use the CREATE TABLE statement.
--The following illustrates the basic syntax of the CREATE TABLE statement:
create table Customer
(
Id number,
CustomerName varchar2(50),
CustomerEmail varchar2(50),
CustomerPhone varchar2(15),
Salary number(18,2),
JoiningDate date,
CreatedByUser varchar2(50) default user,
CreatedDate timestamp default sysdate
)
--TABLE DESCRIPTION
DESC Customer
--02. Insert Data
insert into Customer
(
Id,
CustomerName,
CustomerEmail ,
CustomerPhone ,
Salary,
JoiningDate
)
values
(
1,
'Kamal',
'[email protected]',
'01472584445455',
150000,
'15-Jun-2018'
);
insert into Customer
(
Id,
CustomerName,
CustomerEmail ,
CustomerPhone ,
Salary,
JoiningDate
)
values
(
2,
'Jamal',
'[email protected]',
'01472445455',
1450000,
'15-Jun-2019'
);
insert into Customer
(
Id,
CustomerName,
CustomerEmail ,
CustomerPhone ,
Salary,
JoiningDate
)
values
(
3,
'Sumon',
'[email protected]',
'01475d2445455',
1350000,
'15-Jun-2015'
);
insert into Customer
(
Id,
CustomerName,
CustomerEmail ,
CustomerPhone ,
Salary,
JoiningDate
)
values
(
4,
'Sumdddfdfon',
'[email protected]',
'015d2445455',
1350000,
'15-Jun-2000'
);
--CHECK DATA FROM Customer TABLE
SELECT *
FROM Customer;
--03. Update Data
update Customer
set CustomerName='Mamun',
CustomerEmail='[email protected]',
CustomerPhone='0147524154',
Salary=125000,
JoiningDate='25-May-2014'
where id=4;
--CHECK DATA FROM Customer TABLE
SELECT *
FROM Customer;
--04. Delete Data
Delete
FROM Customer
where id=4
--CHECK DATA FROM Customer TABLE
SELECT *
FROM Customer;
--05. Truncate Table
Truncate table Customer
--CHECK DATA FROM Customer TABLE
SELECT *
FROM Customer;
--06. DROP TABLE
DROP table Customer
--TABLE DESCRIPTION
DESC Customer
--CHECK DATA FROM Customer TABLE
SELECT *
FROM Customer;
-- "table or view does not exist"
--
--Oracle identity column examples
--
--01. Let’s take some examples of using the Oracle identity columns.
--The following statement creates a table named identity_demo that consists of an identity column:
CREATE TABLE identity_demo (
id NUMBER GENERATED ALWAYS AS IDENTITY,
description VARCHAR2(100) NOT NULL
);
DESC IDENTITY_DEMO;
--02. The following statement inserts a new row into the identity_demo table:
INSERT INTO identity_demo(description)
VALUES('Oracle identity column demo with GENERATED ALWAYS2');
SELECT *
FROM IDENTITY_DEMO;
--03. Because we did not specify a value for the id column,
--Oracle automatically generated a sequential value starting from 1.
SELECT
*
FROM
identity_demo;
--########################################
--Oracle ALTER TABLE ADD
--##########################################
--01. Oracle ALTER TABLE ADD column examples
--To add a new column to a table, you use the following syntax:
ALTER TABLE table_name
ADD column_name type constraint;
--Let’s create a table named members for the demonstration.
CREATE TABLE members(
member_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
first_name VARCHAR2(50),
last_name VARCHAR2(50),
PRIMARY KEY(member_id)
);
ALTER TABLE members
ADD birth_date DATE NOT NULL;
DESC members;
--##############################################
--Oracle ALTER TABLE MODIFY
--#############################################
--01. Oracle ALTER TABLE MODIFY column examples
--To modify the attributes of a column, you use the following syntax:
ALTER TABLE table_name
MODIFY column_name type constraint;
--02. The following statement changes the last_name column to accept non-null values:
ALTER TABLE members
MODIFY last_name VARCHAR2(100) NOT NULL;
#OracleDatabase
#OracleSQL
#OracleCloud
#OracleDBA
#OraclePLSQL
#oraclecertification
#OracleMiddleware
#OracleDeveloper
#OracleDatabaseAdministration
#OraclePerformanceTuning
#OracleDatabaseDevelopment
#OracleDatabaseBackup
#OracleExadata
#OracleWebLogic
#OracleForms
#OracleReports
#OracleDatabase12c
DESC members;
FINISHING:
In this tutorial, you have learned how to use the Oracle CREATE TABLE statement to create a new table.
Hope you enjoy this tutorial,
Thanks you guys
Watch video How to create table in oracle 11g and 19c || SELECT | INSERT | UPDARE | DELETE | TRUNCATE online without registration, duration hours minute second in high quality. This video was added by user rejawebs 10 June 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 85 once and liked it 1 people.