0% found this document useful (0 votes)
8 views

CSE3001 Database exp 2

The document outlines a laboratory experiment for creating Sailor Information using DDL and DML in a database management system. It includes a series of SQL queries aimed at retrieving and manipulating data related to sailors and boats, along with their expected outputs. The experiment was successful, as all SQL queries executed correctly, yielding accurate results.

Uploaded by

satyamdyi5678
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

CSE3001 Database exp 2

The document outlines a laboratory experiment for creating Sailor Information using DDL and DML in a database management system. It includes a series of SQL queries aimed at retrieving and manipulating data related to sailors and boats, along with their expected outputs. The experiment was successful, as all SQL queries executed correctly, yielding accurate results.

Uploaded by

satyamdyi5678
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

VIT BHOPAL UNIVERSITY

Bhopal-Indore Highway, Kothrikalan, Sehore


Madhya Pradesh - 466114

CSE3001 – Database Management Systems

REG.NO :_Pavnesh yadav______


NAME :__23BSA1032______
BRANCH :__BTech Cse (cloud Computing)____
SEMESTER:__2024-25________
INDEX

Ex.NO DATE EXPERIMENT NAME PAGE NO.

Create Airline Flight Information System using


1.
DDL & DML

2. 16/02/25 Create Sailor Information using DDL & DML 2-9

Design the data base for a wholesale furniture


3.
company
Implement PL/SQL program uses implicit
4.
cursor

5. Create a transparent audit system using Trigger

Write a cursor program for supplier and parts


6.
database

7. Display an exception for patient Database

8. PL/SQL block function

9. PL/SQL block procedure

10. Triggers

11. Join Queries


EXP.NO: 02
Create Sailor Information using DDL & DML
DATE:17/02

Aim : To Create Sailor Information using DDL & DML.

Query
SAILORS
(SID:INTEGER, SNAME:STRING, RATING:INTEGER, AGE:REAL) BOATS (BID:INTEGER,
BNAME:STRING, COLOR:STRING)

RESERVES(SID:INTEGER,
BID:INTEGER, DAY:DATE)

1. Display names & ages of all sailors.


2. Find all sailors with a rating above 7.
3. Display all the names & colors of the boat.
4. Find all the boats with Red color.
5. Find the names of sailors who have reserved boat number 123.
6. Find SIDs of sailors who havereserved Pink Boat;
7. Find the color of the boats eserved by Rajesh.
8. Find names of the sailors who have reserved at least one boat.
9. Find the names of sailors who have reserved a red or a green.
10. Find the names of sailors who
11. Find the names of sailors who
12. Find sailors whose rating is better than some sailor called Rajesh.
13. Find the sailor's with th highest rating using ALL.
14. To count number SIDs of ailors in Sailors table
15. To count numbers of boats
16. To count number of Boats in boats table.
17. To find age of Oldest Sailor.
18. To find age of Youngest Sailor.
19. Find the average age of sailors with a rating of 10.
20. Count the number of different
21. Find the name and age of the
22. Count the number of Sailors.
23. Find the names of sailors who are older than the oldest sailor with a rating of 10.
24. Display all the sailors according to their ages.
25. To display names of sailors according to alphabetical order.

Output :
1.
 SNAM
 AGE
E
 ----- -- ------
 Rajes
h 35
 Alic
e 42
 Bob
28
 Charli
e 25
 Davi
d 50
 Emm
a 22

2.
SNAME
----------
Rajesh
Bob
David

3.
BNAME COLOR
----------- ----------------
 BoatA  Red
 BoatB  Green
 BoatC  Blue
 BoatD  Yellow
 BoatE  Pink
 BoatF  Red

4.
BNAME
---------
BoatA
BoatF

5.empty
6.
SID
------
105

7.
COLOR
--------
Red

8.
SNAME
---------
Rajesh
Alice
Bob
Charlie
David
Emma

9.
SNAME
---------
Rajesh
Alice
David
Emma

10.
SNAME
---------
Bob

11.
SNAME
----------
Rajesh
Alice
Charlie
David
Emma

12.
SNAME
---------
Bob
David

13.
SNAME
----------
David

14.
COUNT(SID)
-------------
6

15.
COUNT(DISTINCT BID)
----------------------------
6

16.
COUNT(BID)
---------------
6

17.
MAX(AGE)
---------------
50

18.
MIN(AGE)
------------
22

19.
AVG(AGE)
-------------
50

20.
COUNT(DISTINCT SNAME)
------------------------------
6

21.
SNAME AGE

David 50

22.
COUNT(*)
-------------
6

23.
SNAME
------------
Rajesh
Alice
Bob
Charlie
Emma

24.
 SNAME  AGE
 -----------  --------
 Emma 22
 Charlie 25
 Bob 28
 Rajesh 35
 Alice 42
 David 50

25.
SNAME
----------
Alice
Bob
Charlie
David
Emma
Rajesh

Result : This experiment was successful as all the SQL queries were
executed on the sample database, providing accurate and meaningful
results.

You might also like