0% found this document useful (0 votes)
75 views14 pages

DBMS Anjali

This document contains 25 SQL programs describing database operations like creating and modifying tables, inserting and retrieving data, filtering and sorting queries, aggregate functions, joins and more. Each program is numbered and includes the date, a brief description of the operation, and the SQL syntax used. The programs were submitted as part of a database management systems practical file for a course.

Uploaded by

Áryâñ Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views14 pages

DBMS Anjali

This document contains 25 SQL programs describing database operations like creating and modifying tables, inserting and retrieving data, filtering and sorting queries, aggregate functions, joins and more. Each program is numbered and includes the date, a brief description of the operation, and the SQL syntax used. The programs were submitted as part of a database management systems practical file for a course.

Uploaded by

Áryâñ Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

MAHARISHI DAYANAND

UNIVERSITY

DELHI GLOBAL INSTITUTE OF


TECHNOLOGY

DBMS
PRACTICAL FILE
SUBJECT CODE: PCC-CSE-201G

Submitted By: ANJALI MUDHAL


Enrolment No: 02
SR.NO PROGRAM PAGE DATE
NUMBER

1. WAP TO CREATE A TABLE. 1 4/9/20

2. WAP TO INSERT VALUES IN CREATED TABLE 1 5/9/20

3. WAP TO DISPLAY ALL VALUES IN TABLE 2 11/9/20

4. WAP TO DELETE VALUES FROM THE TABLE 2 12/9/20

5. WAP TO MODIFY AND ADD A NEW COLUMN IN 3 18/9/20


TABLE

6. WAP TO DROP A COLUMN IN TABLE 3 22/9/20

7. WAP TO UPDATE VALUES IN TABLE 4 25/9/20

8. WAP TO ARRANGE VALUES IN DESCENDING ORDER 4 29/9/20

9. WAP TO ARRANGE VALUES IN ASCENDING ORDER 5 2/10/20

10. WAP TO CALCULATE AVERAGE VALUE IN TABLE 5 5/10/20

11. WAP TO USE GROUP IN A COLUMN 6 9/10/20

12. WAP TO USE HAVING FUNCTION 6 12/10/20

13. WAP TO CREATE A NEW TABLE AND A NEW 7-8 19/10/20


DATABASE

14. WAP TO CREATE A SELECTED VIEW 8 23/10/20

15. WAP TO PERFORM UNION OPERATION BY JOINING 9 26/10/20


TWO TABLES

16. WAP TO DISPLAY VALUES IN A GIVEN RANGE 10 30/10/20


17. WAP TO CALCULATE LENGTH OF A STRING 11 17/11/20

18 WAP TO USE OR OPERATOR 12 20/11/20

19. WAP TO USE AND OPERATOR 12 24/11/20

20. WAP TO DISPLAY SET OF DATA LINKED TO GIVEN 13 27/11/20


MULTIPLE VALUES

21. WAP TO USE LIKE OPERATOR 13 1/12/20

22. WAP TO DISPLAY MAXIMUM VALUE IN A TABLE 14 4/12/20

23. WAP TO DISPLAY MINIMUM VALUE IN A TABLE 14 8/12/20

24. WAP TO COUNT TOTAL NUMBER OF ROWS 14 11/12/20

25. WAP TO USE NATURAL JOINS IN TWO TABLES 15 15/11/20


DBMS FILE
PROGRAM 1
Write a program to create a table .

Syntax : create table <table name>(column_name1 datatype(size),column_name2 datatype size()......);

PROGRAM 2
Create a program to insert the values in the table.

Syntax : insert into <table_name> values (value 1,value


2,....,value n);

PROGRAM 3
Create a program to display all the values in the table.

Syntax : select *from <table name>;


PROGRAM 4
Create a program to delete the value in the table.

Syntax : delete from <table_name>


where <Condition> ;

PROGRAM 5
Create a program to modify in the table by adding the new
column in the above table.

Syntax : alter table <table_name> add(column_name1


datatype(size), column_name2 datatype(size),.....
column_name n datatype(size));

PROGRAM 6
Create a program to drop a column in the table.

Syntax : alter table <table_name> drop column


<column_name>;

PROGRAM 7
Create a program to update the values of in the table.

Syntax : update <table_name> set column 1=expression where


<condition>;

PROGRAM 8
Create a program to arrange the values in the descending
order.

Syntax : select <column name > from < table_name > order by
< column name > desc ;
PROGRAM 9
Create a program to arrange the values in the ascending order.

Syntax : select < column name > from < table name > order by
< column name > asc ;

PROGRAM 10
Create a program to calculate the average value.

Syntax : select AVG( column name )


from <table name>;

PROGRAM 11
Create a program to group the result- set by one column.
Syntax : select <column name> from <table name> where
<condition> group by <column name

PROGRAM 12
Create a program using HAVING .

Syntax : select <column name> from <table name>


group by <column name>
having <conditions> ;

PROGRAM 13
Creating a New Table :

Inserting The Values IN The Table

Displaying the values :


PROGRAM 14
Create a view to display details of employees working in more
than one project and in one project.

Syntax : create view view_name AS


select column1, column2, ...
from table_name
where condition;

PROGRAM 15
Create a program to perform the union operations by joining
the two tables.
Syntax : select
table_name1.column_name,table_name2.column_name
from table_name1,table_name2
where condition ;

Table 1 -

Table 2 -

After joining the two tables -

PROGRAM 16
Create a program to display the values between the given
range.

Syntax : select column_name from table_name


where column_name BETWEEN value1 AND value2;

PROGRAM 17 :
Create a program to calculate a length of the string.

Syntax : select LENGTH(column_name) from table_name


where condition ;

PROGRAM 18
Create a program to display the record using OR operator.

Syntax : select from table_name where condition 1 OR


condition2 OR ...condition n;

PROGRAM 19
Create a program to display the record using AND operation.
Syntax : select from table_name where condition1 AND
condition2 AND .... condition n ;

PROGRAM 20
Create a program to display the multiple values .

Syntax : select from table_name where column_name


IN(value 1,value 2,..., value n);

PROGRAM 21
Create a program using LIKE operator to display a specified
pattern .

Syntax : select from table_name where column_name LIKE


pattern ;
PROGRAM 22
Create a program to display the maximum values in the table.

Syntax : select MAX(column_name) from table_name ;

PROGRAM 23
Create a program to display the minimum values in the table .

Syntax : select MIN(column_name) from table_name ;

PROGRAM 24
Create a program to count the total number of rows in the
table.
Syntax : select COUNT(column_name) from table_name ;

PROGRAM 25
Create a program using NATURAL JOIN

Syntax : select from table_name1 NATURAL JOIN table_name2


;

You might also like