You are on page 1of 9

http://wellington.pm.org/archive/200505/dbi-pres/slide012.html http://aspspider.wordpress.

com/2007/09/10/sql-joins-with-examples/

DDL vs DML
DDL means "Data Definition Language". SELECT, UPDATE, INSERT belong to DML, which is "Data Modification Language". DDL is all the other commands -- for example, CREATE TABLE. This is quite easily dealt with; through do(). For example:

DDL
Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:

o o o o o o

CREATE - to create objects in the database ALTER - alters the structure of the database DROP - delete objects from the database TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed COMMENT - add comments to the data dictionary RENAME - rename an object

DML
Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:

o o

SELECT - retrieve data from the a database INSERT - insert data into a table

o o o o o o

UPDATE - updates existing data within a table DELETE - deletes all records from a table, the space for the records remain MERGE - UPSERT operation (insert or update) CALL - call a PL/SQL or Java subprogram EXPLAIN PLAN - explain access path to data LOCK TABLE - control concurrency

DCL
Data Control Language (DCL) statements. Some examples:

o o

GRANT - gives user's access privileges to database REVOKE - withdraw access privileges given with the GRANT command

TCL
Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.

o o o o

COMMIT - save work done SAVEPOINT - identify a point in a transaction to which you can later roll back ROLLBACK - restore database to original since the last COMMIT SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use SQLupDifference between TRUNCATE, DELETE and DROP commands

Login to post comments

Submitted by madhuker (not verified) on Wed, 2005-04-06 03:20.

DML statements can be rollbacked where DDL are autocommit.

Login to post comments

DML commands can't be


Submitted by ramakrishna (not verified) on Thu, 2006-01-05 09:35.

DML commands can't be rollback when a DDL command is executed immediately after a DML. DDL after DML means "auto commit". The changes will return on disk not on the buffer. If the changes return on the buffer it is possible to rollback not from the disk.

Login to post comments

Submitted by R. SATISH KUMAR (not verified) on Wed, 2005-04-13 03:09.

DEAR SIR,

Let me tell you the difference between DDL,DML,TCL and DCL: DDL COMMANDS: CREATE,ALTER,DROP AND TRUNCATE ARE CALLED DDL COMMANDS. They are called Data Definition since they are used for defining the data. That is the structure of the data is known through these DDL commands. DML COMMANDS: DML commands are used for data manipulation. Some of the DML commands insert,select,update,delete etc. Even though select is not exactly a DML language command oracle still recommends you to consider SELECT as an DML command. TCL: For revoking the transactions and to make the data commit to the database we use TCL. Some of the TCL commands are: 1. ROLLBACK 2. COMMIT ROLLBACK is used for revoking the transactions until last commit. COMMIT is used for commiting the transactions to the database. Once we commit we cannot rollback. Once we rollback we cannot commit. Commit and Rollback are generally used to commit or revoke the transactions that are with regard to DML commands. DCL: Data Control Language is used for the control of data. That is a user can access any data based on the priveleges given to him. This is done through DATA CONTROL LANGUAGE. Some of the DCL Commands are: 1. GRANT 2. REVOKE. "THESE ARE REFERRED FROM THE BOOK 'ORACLE 9i complete Reference' written by Kooch and George. This is an Oracle Press Release." If you want further details about this topic I can give you. Since I don't know your e-mail address I am not able to send you the complete information. I will give my e-mail address. That is, satish_sathya1983@yahoo.co.in . You can send your email address to my email and i will discuss about this topic with you. If you can send me your email address I can send you an complete attachment of this topic. Thanking you, SATISH KUMAR.

Login to post comments

Submitted by Marcel van Oosterhout (not verified) on Wed, 2005-10-12 03:13.

SQL statements are often divided into three categories: DML (Data Manipulation Language). These SQL statements are used to retrieve and manipulate data. This category encompasses the most fundamental commands including DELETE, INSERT, SELECT, and UPDATE. DML SQL statements have only minor differences between SQL variations. DML SQL commands include the following:

o o o o

DELETE to remove rows. INSERT to add a row. SELECT to retrieve row. UPDATE to change data in specified columns.

DDL (Data Definition Language). These SQL statements define the structure of a database, including rows, columns, tables, indexes, and database specifics such as file locations. DDL SQL statements are more part of the DBMS and have large differences between the SQL variations. DML SQL commands include the following:

o o o

CREATE to make a new database, table, index, or stored query. DROP to destroy an existing database, table, index, or view. DBCC (Database Console Commands) statements check the physical and logical consistency of a database.

DCL (Data Control Language). These SQL statements control the security and permissions of the objects or parts of the database(s). DCL SQL statements are also more part of the DBMS and have large differences between the SQL variations. DML SQL commands include the following:

o o o

GRANT to allow specified users to perform specified tasks. DENY to disallow specified users from performing specified tasks. REVOKE to cancel previously granted or denied permissions.

Login to post comments

http://aspspider.wordpress.com/2007/09/10/sql-joins-with-examples/Introducing the Exception object 7m 28s

Sql Joins With Examples


Joins: 1)These are used to retrieve the data from more than one table. 2)To retrieve the data from more than one table the datatypes of fields which related to different tables need not be same while using the joins Types of joins: 1):Inner Join 2):Cross Join 3)OuterJoin a)Left Outer Join b)Right Outer Join c)Full Outer Join 4)Natural Join 5)Equi Join Examples and Description: 1:Emp EmployeeID 1 2 3 4 EmployeeName Ramesh Sukumar Ravi Kalyani

2.Products: ProductID 11 12 12 13 EmployeeID 2 3 3 6 Productname Pen Pencil Eraser Book

1):Inner Join:This join returns all the rows from the both the tables where there is a match.The result set consists of only matched rows. Syntax: select E. Employeeid,E.EmployeeName,P.ProductName from Employees E inner join Products on E.EmployeeID=P.EmployeeID Result: 1) EmployeeID EmployeeName 2 Sukumar 3 Ravi 3 Ravi Productname Pen Pencil Eraser

2)Cross Join:Cross join is nothing but retrieving the data from more than one table with out using the condition. Here two cases are there: a)select E.EmployeeID,E.EmployeeName,P.Productname from Employees E,Products P Note:(here we are using the cross join defaultly.Means we have not mentioned the any condition here.) b)select E.EmployeeID,E.EmployeeName,P.Productname from Employees E cross join Products P Note:this is the syantax of cross join..both queries(a &b)returns the same result) only the difference is Synatx but the o/p is same. 3)Outer Join:In outer join the resulting table may have empty columns. a)Left Outer Join:Here left means first table.it reurns all the rows from the first table even though it does not have the matchs in Second table.But it returns only the matched rows from the second table. Syntax: select E. Employeeid,E.EmployeeName,P.ProductName from Employees E left join Products on E.EmployeeID=P.EmployeeID Result: 1) EmployeeID EmployeeName 2 Sukumar 3 Ravi 3 Ravi 1 4 Ramesh Kalyani Productname Pen Pencil Eraser null null

a)Right Outer Join:Here Right means Second table.it returns all the rows from the second table even though it does not have the matchs in First table.But it returns only the matched rows from the First table. Syntax: select E. Employeeid,E.EmployeeName,P.ProductName from Employees E right join Products on E.EmployeeID=P.EmployeeID Result: 1) EmployeeID EmployeeName 2 Sukumar 3 Ravi 3 Ravi 6 null Productname Pen Pencil Eraser Book

5)Natural JOIN:it eliminates the duplicate values from the output. 6)Equi JOIN:An inner join is called equi-join when all the columns are selected with a *, or natural join otherwise

Creating your own exceptions 7m 37s

Re-throwing exceptions 4m 57s

9. File Management 33m 59s

Introducing streams and files 5m 10s

Working with existing files 6m 49s

Working with directory and disk information 6m 15s

Using the Path class 6m 41s

Reading and writing files 9m 4s

10. Some Advanced C# 40m 49s

Using variable parameter lists 5m 10s

Using function parameter modifiers 5m 41s

Using optional and named function parameters 7m 58s

Using the C# preprocessor 7m 10s

Working with delegates 6m 57s

Handling events 7m 53s

11. Garbage Collection 9m 5s

How garbage collection works 4m 38s

The Garbage Collector object 4m 27s

12. Debugging 32m 11s

Common compilation issues 11m 55s

Setting breakpoints and examining code 11m 4s

Using the Debug class 9m 12s

Conclusion 1m 11s

Goodbye 1m 11s

Share on facebookShare on email

Search the closed captioning text for this course by entering the keyword youd like to search, or browse the closed captioning text by selecting the chapter name below and choosing the movie title youd like to review.
Search this

submit clear search results

http://sqlservercodebook.blogspot.in/2008/03/how-many-types-of-joins.html http://www.dotnetfunda.com/articles/article1208-different-types-of-join-in-sql-server.aspx

http://www.codeproject.com/Articles/102805/SQL-Joins http://www.codeproject.com/Articles/102805/SQL-Joins http://www.gplivna.eu/papers/sql_join_types.htm http://www.gplivna.eu/papers/sql_join_types.htm

http://www.w3schools.com/SQl/sql_join.asp http://sqlserverplanet.com/query-optimizer/sql-server-join-algorithms http://www.sqlserver2005tutorial.com/Tutorial-learning-course-Join-Types.html http://beginner-sql-tutorial.com/sql-joins.htm http://vyaskn.tripod.com/iq.htm http://www.datamartist.com/sql-inner-join-left-outer-join-full-outer-join-examples-with-syntax-for-sqlserver http://www.careerride.com/joins-and-its-types.aspx http://www.w3schools.com/sql/sql_join.asp http://www.tizag.com/sqlTutorial/sqljoin.php http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins http://www.w3schools.com/sql/sql_join_inner.asp

http://sql-plsql.blogspot.in/2011/05/examples-of-joins.html http://www.tutorialspoint.com/mysql/mysql-using-joins.htm http://www.w3resource.com/sql/joins/perform-a-full-outer-join.php http://www.virtualdotnet.com/SQLServer/virtual%20dotnet%20code%20sampl es/CodeSample.aspx?CodeID=85

date function

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html http://www.tutorialspoint.com/mysql/mysql-date-time-functions.htm

http://www.java2s.com/Tutorial/MySQL/0280__Date-TimeFunctions/Catalog0280__Date-Time-Functions.htm

You might also like