Solved

What is DDL and DML? Why Do We Need Them? SQL - Relational Database Managment System

Posted on 2009-05-14
6
1,148 Views
Last Modified: 2012-05-07
I'm new to SQL RDBMS, so this question might sound cheesy. Why do we need DDL and DML! Do they always come together? Can't i use DDL without DML and vice versa? Why? Are they two different set of languages?
0
Comment
Question by:F-J-K
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 400 total points
ID: 24392330
DDL = data definition language -   the set of commands for creating, altering and dropping tables, indexes, views, triggers, etc.  The language of the "structure" of a database
DML= data manipulation language - the set of command for manipulating the data.  insert, select, update, delete, etc.  The language of the "actions" on a database.

So...
 yes, you need both.  Can't run DML unless you have tables,  and tables that never have DML against them are useless.
Yes they always come together.

They are two pieces of the same language of for each db vendor/version.

You could also have a theoretical debate about DML not "strictly" being SQL  since it's structural and not data related.
But I'll leave that debate to others as it's not really all that interesting on either side of the argument
0
 
LVL 3

Expert Comment

by:csenasa
ID: 24392517
0
 
LVL 7

Expert Comment

by:meispisces
ID: 24393589
Refer below link

http://cs.scu.edu.cn/~zuojie/oracle/appdev.101/b10795/adfns_dy.htm

The examples used in the link are quite tough for you to understand, but it would definitely make your SQL concepts very clear

these commands work in: SQL Server & even Oracle database

Also Refer http://searchoracle.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid41_gci1235584,00.html

Hope it helped you!

Still any doubts let me know

thanks
 
0
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

 
LVL 22

Assisted Solution

by:dportas
dportas earned 100 total points
ID: 24395908
DDL (Data Definition Language) and DML (Data Manipulation Language) refer to different parts of the SQL language. Both are part of the ISO SQL standard for the SQL language.

Since you are new to SQL you may be surprised to learn that SQL is not really a relational language and SQL DBMSs are not true RDBMSs even though the term "relational" is often used loosely to refer to both SQL concepts and relational concepts. SQL DDL is what is used to create tables and views. If you are familiar with the relational model you can think of SQL tables and views as the approximate equivalent of relation variables and DML as the approximate equivalent of the relational algebra and calculus. As with other languages, it's hard to do anything very useful without creating a variable. So the answer to your question is that you generally will need both DML and DDL.
0
 
LVL 1

Author Closing Comment

by:F-J-K
ID: 31581796
It Helped
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 24402260
glad we could help
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question