d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Sql Ddl Statements > Howdy
Add Reply New Topic New Poll
Member
Posts: 833
Joined: Mar 5 2016
Gold: Locked
Mar 6 2016 01:07pm
I was browsing this site since I am a new member and found this sub-section.

Could anyone help me with my SQL DDL Statements using Oracle?

I am a little confused on how to create the syntax.

Any help would be greatly appreciated!

Thanks guys!
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 6 2016 01:35pm
anything in particular? here are some basic CRUD:

insert into some_table (my_column) values ('bunnies');
select * from some_table;
update some_table set my_column = "yawn";
delete from some_table;


a few general tips:

select always has to pull from a table, unlike sql-server/sqlite. there is a special table 'dual' you can use if you just wanna hard code a result with 1 row. for example, this is not correct: [select 'boo'] where this is correct [select 'boo' from dual]

you can't use the sql-server syntax for updating with joins

Member
Posts: 833
Joined: Mar 5 2016
Gold: Locked
Mar 6 2016 02:07pm
Quote (carteblanche @ Mar 6 2016 02:35pm)
anything in particular? here are some basic CRUD:

insert into some_table (my_column) values ('bunnies');
select * from some_table;
update some_table set my_column = "yawn";
delete from some_table;


a few general tips:

select always has to pull from a table, unlike sql-server/sqlite. there is a special table 'dual' you can use if you just wanna hard code a result with 1 row. for example, this is not correct: [select 'boo'] where this is correct [select 'boo' from dual]

you can't use the sql-server syntax for updating with joins



We are supposed to create relational databases on the ORACLE Platform
example:

R1: (First_name, Mid_init, Last_Name, SSNo, Bdate, Gender, Address, Salary, Supssno, Dno)

Employee.[Supssno] must be Employee[Sssno]
Employee.[Dno] must be Department[Dept_no]

I understand how to create the table and add in the attributes and the primary key but I am a little confused on how to deal with the constraints.

Let me know if this makes any sense!
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 6 2016 04:36pm
The constraints, if I understand you correctly, are just foreign keys. Google for Oracle foreign key and you'll find them. If you can't figure it out, post here and I'll write it out tomorrow when I'm at a computer
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll