Solved

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

Posted on 2009-05-14
6
1,135 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
6 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 400 total points
Comment Utility
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
Comment Utility
0
 
LVL 7

Expert Comment

by:meispisces
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 22

Assisted Solution

by:dportas
dportas earned 100 total points
Comment Utility
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
Comment Utility
It Helped
0
 
LVL 73

Expert Comment

by:sdstuber
Comment Utility
glad we could help
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Creating and Managing Databases with phpMyAdmin in cPanel.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now