dbms language database, Summaries of Database Programming

gives knowledge about different database languages

Typology: Summaries

2023/2024

Uploaded on 03/06/2024

saroj-giri
saroj-giri 🇳🇵

3 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1. Database Language is a special type of programming language used to define and manipulate a
database. These are four different types: DDL, DML, DCL, and TCL.
2. Data definition language (DDL) refers to the set of SQL commands that can create and manipulate the
structures of a database.
Common DDL statements include:
a) CREATE (generates a new table)
b) ALTER (alters table)
c) DROP (removes a table from the database)
a) The syntax for creating a table is this:
CREATE TABLE table name (field name data type);
For example this:
CREATE TABLE Artists (artistName, varchar);
b) the syntax for adding column in a table:
ALter table table_name
Add column_name datatype;
For example:
Alter table department
Add email varchar;
c) the syntax for removing a table:
pf3
pf4

Partial preview of the text

Download dbms language database and more Summaries Database Programming in PDF only on Docsity!

  1. Database Language is a special type of programming language used to define and manipulate a database. These are four different types: DDL, DML, DCL, and TCL.
  2. Data definition language (DDL) refers to the set of SQL commands that can create and manipulate the structures of a database. Common DDL statements include: a) CREATE (generates a new table) b) ALTER (alters table) c) DROP (removes a table from the database) a) The syntax for creating a table is this: CREATE TABLE table name (field name data type); For example this: CREATE TABLE Artists (artistName, varchar); b) the syntax for adding column in a table: ALter table table_name Add column_name datatype; For example: Alter table department Add email varchar; c) the syntax for removing a table:

Drop table table_name; for example: DROP table department;

  1. A DML (data manipulation language) refers to a computer programming language that allows you to add (insert), delete (delete), and alter (update) data in a database. The DML commands in SQL are as follows: a) INSERT syntax:INSERT INTO table_name (column_name1, column_name2, column_name3, ....) VALUES (value_1, value_2, value_3, ....); example:INSERT INTO Students (Roll_no,Name,Age,Address,Date_of_Birth) VALUES (2, 'Ajay', 15, 'Chennai', '2007/10/02'); b) UPDATE syntax: UPDATE table_name SET [column_name1= value_1, column_name2= value_2,...] WHERE CONDITION; example: UPDATE Students SET Address= 'damak' WHERE Address= 'ktm'; c) DELETE syntax: DELETE FROM table_Name WHERE condition; example: DELETE FROM Students WHERE Roll_no = 2;
  2. DCL commands are used to grant and take back authority from any database user.

Syntax: ROLLBACK; Example: DELETE FROM CUSTOMERS WHERE AGE = 25; ROLLBACK; c. SAVEPOINT: It is used to roll the transaction back to a certain point without rolling back the entire transaction. Syntax: SAVEPOINT SAVEPOINT_NAME;