create table oracle

Solutions on MaxInterview for create table oracle by the best coders in the world

showing results for - "create table oracle"
Chloé
06 Nov 2016
1CREATE TABLE ot.persons(
2    person_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
3    first_name VARCHAR2(50) NOT NULL,
4    last_name VARCHAR2(50) NOT NULL,
5    PRIMARY KEY(person_id)
6);
Alma
23 Feb 2017
1/*Deleting whole table with data */
2DROP TABLE vehicles;
3DROP TABLE owners;
4
5/*First create only this table */
6CREATE TABLE owners (
7    owner_id NUMBER,
8    first_name VARCHAR2(50 CHAR) NOT NULL,
9    
10    CONSTRAINT owners_pk PRIMARY KEY(owner_id)
11);
12
13/* One owner got many vehicles, one to many relation
14	or one vehicle got many owners */
15CREATE TABLE vehicles (
16    vehicle_id NUMBER,
17    vehicle_name VARCHAR2(50 CHAR) NOT NULL,
18    
19  	/* CONSTRAINT vehicle_pk PRIMARY KEY(vehicle_id) --If we had made PRIMARY KEY here it will be one to one relation */
20    CONSTRAINT vehicle_owner_fk FOREIGN KEY(vehicle_id) REFERENCES owners(owner_id) ON DELETE SET NULL
21);
22
23
24INSERT INTO owners VALUES(1, 'Abbi');
25INSERT INTO owners VALUES(2, 'Beatrix');
26INSERT INTO owners VALUES(3, 'Caila');
27INSERT INTO owners VALUES(4, 'Dea');
28INSERT INTO owners VALUES(5, 'Elise');
29
30INSERT INTO vehicles VALUES(1, 'car');
31INSERT INTO vehicles VALUES(2, 'motorcycle');
32INSERT INTO vehicles VALUES(3, 'airplane1');
33INSERT INTO vehicles VALUES(4, 'airplane1');
34INSERT INTO vehicles VALUES(4, 'steamer');
35INSERT INTO vehicles VALUES(4, 'submarine');
36COMMIT;
37
38DELETE FROM projects WHERE vehicle_id = 4 AND vehicle_name = 'submarine';
39
40/*
41Sometimes Oracle SQL Dev don't like this sign ';', 
42Primary Key is always NOT NULL UNIQUE,
43single PK PRIMARY KEY(user_id), allowed combination:
44(1,1) for example (user_id, project_id)
45(2,1)
46(3,1)
47(4,2)
48
49*/  
50-- one line comment
51
52
queries leading to this page
oracle sql server create table syntaxhow to create a table in sql pluscrete a table sql oracleoracle sql create tablespacehow to create table in oracle sql command linecreate table with oraclehow to create a table in oracle sql developeroracle declare tableoracle sql create tableoracle sql plus create tablehow to create and work table in oraclecreate tablespace oraclecreate a table oraclecreating and working with tables database oraclecreate table with varchar 2oracle dbms create table commandcreate a table from a table in oracleoracle create table with valuesmake oracle tables onlinecreate table oracle commandoracle create table withcreate table from another table oracleoracle sql how to create tablecreate table in sql oracleexample create table in oraclecreate table with oracle sql developersql oracle create table commandoracle sql create table statementcreate table sql varchar sample pl sqlcreating table in oracle sqlcreate table in schema oracle examplecreate table in oracle 10oracle sql create tables with twofkoracle syntax create tablecreate table oracle exemplocreate table in oracle sql developerhow to add tables to a database in oracle sqlcreate a db table from scratch in oraclecreate table references oracleoracle create tablespaceoracle show create tableoracle create table valueshow to create a table in oracle sql sql oracle create new tablecreate table examples oraclecreate table example oracleoracle sql table creationcreate tables in oracle sql developercreate a table in oracle sql developertable creation in oraclecreate table sql varchar example pl sqloracle sql create table with datacreate sql tableshow to create on the way table in oraclecreate table orac 3beoracle table creation syntaxcreate tablein oracleoracle table creationoracle making tableoracle create table scriptcreate table script in oraclesql command to create new table in oraclehow to create table function in oracle sqloracle create new databaseoracle can we create a table without columnsoracle creating tablecreate database oracle syntaxhow to create table in oracle sqlcreate table command in oracleoracle define tableshow create table in oraclecreating table in sql oracleoracle create table with descriptionoracle create table sqlcreate tables in oraclecreate table syntax oraclewith create table oracleoracle sql create table queryoracle create table commandoracle create table as selectcreate table oracle tsqloracle create table using listhow to create a new table in oracle databaseoracle add tablecreate table with select in oraclecreate oracle tablesql oracle table createcreate table function oracleoracle create table clausecreate tabl as oraclecreate table select oraclecreate table oracledboracle create tableoracle create table syntaxsql oracle create table from tablecreate empty table oracle sqlpl 2fsql create tablecreate table varchar2create table in oracleoracle create table in declareoracle how to create tablespaceoracle sql create table with clausetablespace create in oracleoracle create new tablehow to create table in sql command line in oracle 11ghow to create table in oracle sql developer using queryoracle table testcreate table in oracle using selectcreate table in sqlplussql plus table create queryoracle sql create table as selectcreating table oraclecreate table from table oraclehow to create table in sql oraclesql oracle tablecreate table oracle scriptcreate table in tablespace oraclesql create table oraclecreate table from oracle sqlcreate new table query oraclehow to create table in oracle databasecreating a table oracleoracle sql create table syntaxcretae table in sql oraclecreating a user table oraclescript to create table in oracleoracle create tabecreating a table in oracle sql developercreate table in schema oracleoracle sql create a tablecreate table select 2a from oraclecreate a simle table oracleoracle create table using selectoracle create a tablespacecreate table query oracleoracle slq create tablecr c3 a9ation table sql oraclequery to create a table in oraclehow to create a table in dbms oraclesample create table query in oraclecreating table in oracle syntaxcreate table script for oraclecreate table on oraclecreate table in oracle 12ccreate table in oracle sql examplecreating a table in sql oraclecreate a db table from scratch in oracle sqlpluscreate table in oracle in a particular ownersample table creation in oracle sql with datasql oracle create tablecreate table javacreate a table in oracle andcreate table using select in oracleoracle query create tablehow to create table in oracle sql syntax examplehow to create table oraclehow to create table in oracle 11gtable create in nosql oracleoracle careate tablesql to create table in oraclehow to get created table in oraclesqlplus create tableoracle sql create table as with datacreate table syntax in oraclecreate table oracle sqloracle create tabelcreate table oracle databasecreate table oracle db syntaxcreate very simple table in oraclenew table oraclequery to create table oraclecreate command in oracleoracle sql table scriptcreate tbale oracleoracle db create tablecreate a test table in oraclehow to create tables in oracle sql developercreate a table sql oraclecreate table queries in oraclecreae table in oracle sqlhow to create table with date datatype in oracleoracle create table for userhwo to create tabel in oracleuser table in oracle exampleoracle query to create tablecreate table customer oracleoracle how to create tablecreate table with integer in oraclehow to write syntax to create table in oraclealter table in oraclecreate table as select oracleoracle create table using sql developerbetween oracle sql creating table create table sql oracleoracle sql generate create table scriptoracle test tablecreate database and table oraclehow to create table in oracle sql developersql create a table oraclecreate table oralcehow to create a table in oraclemake table sqlplus commandoracle sql developer create tablecreate table in sql 2apluscreate table sql oracle examplecreate tabel in oracleorcalce sql create tablecreate table in oracle sqlcreate a table in oracleoracle create table extends tablecreate table in oracle as selectcreate table query in oracleoracle sql createdatabase oracle create tablemssql create table query to oracleoracle create tableoracle create table in tablespacecreate table command oracle sqlhow to createa table in oracleoracle queries for table generationoracel new table queryoracle table createcrfeate table oraclecreate in oraclecreate new table in oraclecreate table syntax in oracle sql developeroracle create table examplecreate table oracle docsoracle database create tableoracle sql create queryoracle create table statementoracle create table in my schemahow to get create table statement in oracleoracle create table queryhow to create a table oracle sqlhow to create table in oraclecreate table in a schema oraclecreating tables in oracleoracle sql how to create table jdbccreate table oraclesql oracle syntax of create tablecreate table online sql oraclecreat table oraclesqlplus command line create tablesqldeveloper create tablecreating table in oracle sql developercreating table in oraclecreating a column with table name oracleoracle create create a table in oracle sqlhow to create a table in oracle sql developer graphicallycreate a table pl 2fsqloracle create db with one tablecreation table oraclecreate table oracle sql developeroracle database table creationoracle cteate tablecreate table in oracle examplecreate table oracle examplecreate table oracle with constraintscreate table oracle querycreating tables in oracle sqloracle create table column integercommand to create table in oraclecreate table in oracle commandoracle create table referencecreate table oracle