1 / 8

SQL DDL and Oracle utilities

SQL DDL and Oracle utilities. Datatypes in SQL. INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME. SQL DDL. DDL = Data Definition Language

rosalvaa
Download Presentation

SQL DDL and Oracle utilities

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL DDL and Oracle utilities Murali Mani

  2. Datatypes in SQL • INT (or) INTEGER • FLOAT (or) REAL • DECIMAL (n, m) • CHAR (n) • VARCHAR (n) • DATE, TIME Murali Mani

  3. SQL DDL • DDL = Data Definition Language • Create tables, columns of tables, types of columns, primary key constraints, unique constraints, foreign key constraints • Drop tables, add/drop columns, add/drop constraints – primary key, unique, foreign key Murali Mani

  4. Creating Tables CREATE TABLE <tableName> ( <col> <type>, <col> <type>, … <col> <type>, [CONSTRAINT <cName>] PRIMARY KEY (…), [CONSTRAINT <cName>] UNIQUE (…), [CONSTRAINT <cName>] FOREIGN KEY (…) REFERENCES <tableName> (…) ); Murali Mani

  5. Dropping tables DROP TABLE <tableName> Murali Mani

  6. Adding/Dropping Columns ALTER TABLE <tableName> ADD <col> <type>; ALTER TABLE <tableName> DROP COLUMN <col>; Murali Mani

  7. Adding/Dropping Constraints ALTER TABLE <tableName> ADD [CONSTRAINT <cName>] … ALTER TABLE <tableName> DROP CONSTRAINT <cName> Murali Mani

  8. SQL DML: Basic • DML = Data Manipulation Language • Consists of Queries and Modification • Modification: Inserting/Deleting values from table • Insert a value into a table INSERT INTO <tableName> VALUES (…) eg: INSERT INTO Student VALUES (1, ‘Dave’); • Delete all values from a table DELETE FROM <tableName> Murali Mani

More Related