SlideShare a Scribd company logo
1 of 38
Creating and Managing Tables
Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Database Objects Object Description Table Basic unit of storage; composed of rows  and columns View  Logically represents subsets of data from  one or more tables Sequence  Numeric value generator Index Improves the performance of some queries Synonym  Gives alternative names to objects
Naming Rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  CREATE TABLE  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],CREATE TABLE [ schema .] table   ( column   datatype  [DEFAULT  expr ][, ...]);
Referencing Another User’s Tables ,[object Object],[object Object]
The  DEFAULT  Option ,[object Object],[object Object],[object Object],[object Object],... hire_date DATE DEFAULT SYSDATE, ...
[object Object],[object Object],Creating Tables DESCRIBE dept CREATE TABLE dept (deptno  NUMBER(2), dname  VARCHAR2(14), loc  VARCHAR2(13)); Table created.
Tables in the Oracle Database ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Querying the Data Dictionary SELECT table_name  FROM   user_tables ; SELECT *  FROM   user_catalog ; ,[object Object],[object Object],SELECT DISTINCT object_type  FROM    user_objects ; ,[object Object]
Data Types Data Type Description VARCHAR2( size ) Variable-length character data CHAR( size )  Fixed-length character data NUMBER( p , s)   Variable-length numeric data DATE  Date and time values LONG  Variable-length character data  up to 2 gigabytes CLOB Character data up to 4 gigabytes RAW and LONG RAW   Raw binary data BLOB Binary data up to 4 gigabytes BFILE Binary data stored in an external  file; up to 4 gigabytes ROWID A 64 base number system representing  the unique address of a row in its table.
 
DateTime Data Types ,[object Object],[object Object],[object Object],[object Object],Data Type   Description TIMESTAMP Date with fractional seconds INTERVAL YEAR TO MONTH Stored as an interval of years  and months INTERVAL DAY TO SECOND Stored as an interval of days to hours minutes and seconds
DateTime Data Types ,[object Object],[object Object],[object Object],TIMESTAMP[(fractional_seconds_precision)]
TIMESTAMP   WITH   TIME   ZONE  Data Type ,[object Object],[object Object],TIMESTAMP[(fractional_seconds_precision)] WITH TIME ZONE
TIMESTAMP   WITH   LOCAL   TIME  Data Type ,[object Object],[object Object],[object Object],[object Object],TIMESTAMP[(fractional_seconds_precision)] WITH LOCAL TIME ZONE
INTERVAL   YEAR   TO   MONTH  Data Type ,[object Object],INTERVAL YEAR [(year_precision)] TO MONTH INTERVAL '123-2' YEAR(3) TO MONTH Indicates an interval of 123 years, 2 months. INTERVAL '123' YEAR(3) Indicates an interval of 123 years 0 months. INTERVAL '300' MONTH(3) Indicates an interval of 300 months. INTERVAL '123' YEAR Returns an error, because the default precision is 2,  and '123' has 3 digits.
INTERVAL   DAY   TO   SECOND  Data Type ,[object Object],INTERVAL DAY [(day_precision)]  TO SECOND [(fractional_seconds_precision)] INTERVAL '4 5:12:10.222' DAY TO SECOND(3) Indicates 4 days, 5 hours, 12 minutes, 10 seconds,  and 222 thousandths of a second.INTERVAL '123' YEAR(3). INTERVAL '7' DAY Indicates 7 days. INTERVAL '180' DAY(3)  Indicates 180 days.
INTERVAL   DAY   TO   SECOND  Data Type ,[object Object],INTERVAL '4 5:12:10.222' DAY TO SECOND(3) Indicates 4 days, 5 hours, 12 minutes, 10 seconds,  and 222 thousandths of a second. INTERVAL '4 5:12' DAY TO MINUTE Indicates 4 days, 5 hours and 12 minutes. INTERVAL '400 5' DAY(3) TO HOUR Indicates 400 days 5 hours. INTERVAL '11:12:10.2222222' HOUR TO SECOND(7) indicates 11 hours, 12 minutes, and 10.2222222 seconds.
Creating a Table  by Using a Subquery Syntax ,[object Object],[object Object],[object Object],CREATE TABLE  table   [( column ,  column ...)] AS  subquery;
Creating a Table by Using a Subquery DESCRIBE dept80 CREATE TABLE  dept80 AS    SELECT  employee_id, last_name,  salary*12 ANNSAL,  hire_date   FROM  employees   WHERE  department_id = 80; Table created.
The  ALTER   TABLE  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object]
The  ALTER   TABLE  Statement ,[object Object],[object Object],ALTER TABLE  table ADD   ( column datatype  [DEFAULT  expr ]   [,  column datatype ]...); ALTER TABLE  table MODIFY   ( column datatype  [DEFAULT  expr ]   [,  column datatype ]...); ALTER TABLE  table DROP   ( column );
Adding a Column DEPT80 “ Add a new column to the  DEPT80  table.” DEPT80 New column
Adding a Column ,[object Object],[object Object],ALTER TABLE dept80 ADD   (job_id VARCHAR2(9)); Table altered.
Modifying a Column ,[object Object],[object Object],ALTER TABLE dept80 MODIFY (last_name VARCHAR2(30)); Table altered.
Dropping a Column ,[object Object],[object Object],ALTER TABLE  dept80 DROP COLUMN  job_id;  Table altered.
The  SET   UNUSED  Option ,[object Object],[object Object],ALTER TABLE   table SET  UNUSED ( column ); ALTER TABLE  table SET  UNUSED COLUMN  column; OR ALTER TABLE  table DROP  UNUSED COLUMNS;
Dropping a Table ,[object Object],[object Object],[object Object],[object Object],DROP TABLE dept80; Table dropped.
Changing the Name of an Object ,[object Object],[object Object],RENAME dept TO detail_dept; Table renamed.
Truncating a Table ,[object Object],[object Object],[object Object],[object Object],[object Object],TRUNCATE TABLE detail_dept; Table truncated.
Adding Comments to a Table ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],COMMENT ON TABLE employees IS 'Employee Information'; Comment created.
Summary Statement  Description CREATE TABLE   Creates a table  ALTER TABLE   Modifies table structures  DROP TABLE   Removes the rows and table structure RENAME   Changes the name of a table, view,  sequence, or synonym TRUNCATE  Removes all rows from a table and  releases the storage space COMMENT  Adds comments to a table or view In this lesson, you should have learned how to use DDL statements to create, alter, drop, and rename tables.
Practice 9 Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
 
 
 

More Related Content

What's hot (20)

SQL
SQLSQL
SQL
 
ADBMS Unit-II c
ADBMS Unit-II cADBMS Unit-II c
ADBMS Unit-II c
 
Les10
Les10Les10
Les10
 
Appendix A Tables
Appendix A   TablesAppendix A   Tables
Appendix A Tables
 
DML Commands
DML CommandsDML Commands
DML Commands
 
Dbms record
Dbms recordDbms record
Dbms record
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7
 
DDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and JoinsDDL,DML,SQL Functions and Joins
DDL,DML,SQL Functions and Joins
 
Sql commands
Sql commandsSql commands
Sql commands
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
Database Management - Lecture 2 - SQL select, insert, update and delete
Database Management - Lecture 2 - SQL select, insert, update and deleteDatabase Management - Lecture 2 - SQL select, insert, update and delete
Database Management - Lecture 2 - SQL select, insert, update and delete
 
Exploring collections with example
Exploring collections with exampleExploring collections with example
Exploring collections with example
 
Lab
LabLab
Lab
 
Varraysandnestedtables
VarraysandnestedtablesVarraysandnestedtables
Varraysandnestedtables
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
 
Stata Cheat Sheets (all)
Stata Cheat Sheets (all)Stata Cheat Sheets (all)
Stata Cheat Sheets (all)
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
R gráfico
R gráficoR gráfico
R gráfico
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 

Similar to Les09

e computer notes - Creating and managing tables
e computer notes -  Creating and managing tablese computer notes -  Creating and managing tables
e computer notes - Creating and managing tablesecomputernotes
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Achmad Solichin
 
Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base Salman Memon
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...SakkaravarthiS1
 
DDL. data defination language for creating database
DDL. data defination language for creating databaseDDL. data defination language for creating database
DDL. data defination language for creating databaseSHAKIR325211
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL CommandsShrija Madhu
 
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB plc
 
SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10Umair Amjad
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commandsBelle Wx
 
What's New in MariaDB Server 10.3
What's New in MariaDB Server 10.3What's New in MariaDB Server 10.3
What's New in MariaDB Server 10.3MariaDB plc
 
Introduction to Oracle Database.pptx
Introduction to Oracle Database.pptxIntroduction to Oracle Database.pptx
Introduction to Oracle Database.pptxSiddhantBhardwaj26
 

Similar to Les09 (20)

e computer notes - Creating and managing tables
e computer notes -  Creating and managing tablese computer notes -  Creating and managing tables
e computer notes - Creating and managing tables
 
Les09
Les09Les09
Les09
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Less08 Schema
Less08 SchemaLess08 Schema
Less08 Schema
 
Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base Creating and Managing Tables -Oracle Data base
Creating and Managing Tables -Oracle Data base
 
Les09.ppt
Les09.pptLes09.ppt
Les09.ppt
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
Module 3
Module 3Module 3
Module 3
 
DDL. data defination language for creating database
DDL. data defination language for creating databaseDDL. data defination language for creating database
DDL. data defination language for creating database
 
Database
Database Database
Database
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
 
SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10
 
unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
What's New in MariaDB Server 10.3
What's New in MariaDB Server 10.3What's New in MariaDB Server 10.3
What's New in MariaDB Server 10.3
 
Introduction to Oracle Database.pptx
Introduction to Oracle Database.pptxIntroduction to Oracle Database.pptx
Introduction to Oracle Database.pptx
 

More from Vijay Kumar (18)

Les20
Les20Les20
Les20
 
Les19
Les19Les19
Les19
 
Les18
Les18Les18
Les18
 
Les17
Les17Les17
Les17
 
Les15
Les15Les15
Les15
 
Les16
Les16Les16
Les16
 
Les14
Les14Les14
Les14
 
Les13
Les13Les13
Les13
 
Les12
Les12Les12
Les12
 
Les10
Les10Les10
Les10
 
Les11
Les11Les11
Les11
 
Les07
Les07Les07
Les07
 
Les08
Les08Les08
Les08
 
Les06
Les06Les06
Les06
 
Les05
Les05Les05
Les05
 
Les04
Les04Les04
Les04
 
Les03
Les03Les03
Les03
 
Les02
Les02Les02
Les02
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Les09

  • 2.
  • 3. Database Objects Object Description Table Basic unit of storage; composed of rows and columns View Logically represents subsets of data from one or more tables Sequence Numeric value generator Index Improves the performance of some queries Synonym Gives alternative names to objects
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Data Types Data Type Description VARCHAR2( size ) Variable-length character data CHAR( size ) Fixed-length character data NUMBER( p , s) Variable-length numeric data DATE Date and time values LONG Variable-length character data up to 2 gigabytes CLOB Character data up to 4 gigabytes RAW and LONG RAW Raw binary data BLOB Binary data up to 4 gigabytes BFILE Binary data stored in an external file; up to 4 gigabytes ROWID A 64 base number system representing the unique address of a row in its table.
  • 12.  
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Creating a Table by Using a Subquery DESCRIBE dept80 CREATE TABLE dept80 AS SELECT employee_id, last_name, salary*12 ANNSAL, hire_date FROM employees WHERE department_id = 80; Table created.
  • 22.
  • 23.
  • 24. Adding a Column DEPT80 “ Add a new column to the DEPT80 table.” DEPT80 New column
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. Summary Statement Description CREATE TABLE Creates a table ALTER TABLE Modifies table structures DROP TABLE Removes the rows and table structure RENAME Changes the name of a table, view, sequence, or synonym TRUNCATE Removes all rows from a table and releases the storage space COMMENT Adds comments to a table or view In this lesson, you should have learned how to use DDL statements to create, alter, drop, and rename tables.
  • 34.
  • 35.  
  • 36.  
  • 37.  
  • 38.  

Editor's Notes

  1. Schedule: Timing Topic 30 minutes Lecture 20 minutes Practice 50 minutes Total