Solved

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

Posted on 2009-05-14
6
1,157 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 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

707 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