Computer Science
What are DDL and DML?
SQL Queries
1 Like
Answer
The Data Definition Language (DDL) part of SQL permits the creation or deletion of database tables. It also defines indices (keys), specifies links between tables, and imposes constraints on tables. DDL contains necessary statements for creating, manipulating, altering, and deleting tables.
Data Manipulation Language (DML) is a part of SQL that helps users manipulate data. It contains necessary statements for inserting, updating, and deleting data.
Answered By
3 Likes
Related Questions
Write SQL commands for (i) to (vi) and write output for (vii) on the basis of PRODUCTS relation given below:
Table: PRODUCTS
PCODE PNAME COMPANY PRICE STOCK MANUFACTURE WARRANTY P001 TV BPL 10000 200 2018-01-12 3 P002 TV SONY 12000 150 2017-03-23 4 P003 PC LENOVO 39000 100 2018-04-09 2 P004 PC COMPAQ 38000 120 2019-06-20 2 P005 HANDYCAM SONY 18000 250 2017-03-23 3 (i) To show details of all PCs with stock more than 110.
(ii) To list the company which gives warranty of more than 2 years.
(iii) To find stock value of the BPL company where stock value is the sum of the products of price and stock.
(iv) To show number of products from each company.
(v) To count the number of PRODUCTS which shall be out of warranty on 20-NOV-2020.
(vi) To show the PRODUCT name of the products which are within warranty as on date.
(vii) Give the output of the following statements:
(a) SELECT COUNT(DISTINCT COMPANY) FROM PRODUCTS;
(b) SELECT MAX(PRICE) FROM PRODUCTS WHERE WARRANTY <= 3;
Write SQL commands for (i) to (vi) on the basis of relations given below:
Table: BOOKS
Book_ID Book_name Author_name Publishers Price Type qty K0001 Let us C Y. Kanetkar EPB 450 Prog 15 P0001 Computer Networks B. Agarwal FIRST PUBL 755 Comp 24 M0001 Mastering C++ K.R. Venugopal EPB 165 Prog 60 N0002 VC++ advance P. Purohit TDH 250 Prog 45 K0002 Programming with Python Sanjeev FIRST PUBL 350 Prog 30 L02 Computer Science with Python Sumita Arora Dhanpat rai 655 Prog 16 L04 Computer Science with Python Preeti Arora Sultan chand 550 Prog 20 L05 Concise Mathematics R.K.Bansal Selina 600 Maths 10 Table: ISSUED
Book_ID Qty_Issued L02 13 L04 5 L05 21 (i) To show the books of "FIRST PUBL" Publishers written by P.Purohit.
(ii) To display cost of all the books published for FIRST PUBL.
(iii) Depreciate the price of all books of EPB publishers by 5%.
(iv) To display the bookname and price of the books, more than 3 copies of which have been issued.
(v) To show total cost of books of each type.
(vi) To show the details of the costliest book.
Differentiate between primary key and candidate key in a relation.
What do you understand by the terms Cardinality and Degree of a relation in relational database?