week-4
week-4
ARTIFICIAL INTELLIGENCE
DATABASE MANAGEMENT SYSTEMS
Week-4 Assignment
Name : M.Aravind
Hall ticket no : 2203A51020
Section : A
Batch - 1
------------------------------------------------------------------------------------------------------------
Create table
1. sailor (sl_id, slname, ratings, age)
2. boats(bt_id, btname, quantity, colour)
3. reserves(sl_id, bt_id, day)
Command: create table sailor1020(sl_id int primary key,sname char(10) not null,
age int not null, Rating int check(Rating >=1 And Rating <=10));
The average age of all the sailors who have reserved a red boat
Command: select avg(s.age) from sailor1020 s, reserve1020 r,boat1020 b where
s.sl_id = r.sl_id and b.bt_id = r.bt_id and b.b_color = 'red';
A boat 501 has been cancelled on a particular date and hence the
enterprise has decided to cancel all the reservations for that
particular boat on that day. Help Sandeep find out if there are sailors
who have reserved that boat on ’03-MAR-2024’,
Mr. Sandeep wants to know how many sailors have reserved the
boats in the last week on each day from 06th Feb to 12th Feb 2024