DBMS 1
DBMS 1
EXERCISE 1
Date: 13/02/2024
DDL COMMANDS
DML COMMANDS
R Diagram:-
SQL QUERIES: -
1. Design and create database which consists of above seven tables.
create database company;
use company;
create table jobs (job_id varchar(10) primary key, job_title varchar(50), min_salary
double(10,2),max_salary double(10,2));
Table: regions
Table: countries
Table: locations
Table: jobs
Table: dependents
100,5), (126,'Irene','Mikkilineni','[email protected]','650.124.1224','1998-09-
28',18,2700.00,120,5), (145,'John','Russell','[email protected]',NULL,'1996-10-
01',15,14000.00,100,8), (146,'Karen','Partners','[email protected]',NULL,'1997-01-
05',15,13500.00,100,8), (176,'Jonathon','Taylor','[email protected]',NULL,'1998-03-
24',16,8600.00,100,8), (177,'Jack','Livingston','[email protected]',NULL,'1998-04-
23',16,8400.00,100,8), (178,'Kimberely','Grant','[email protected]',NULL,'1999-05-
24',16,7000.00,100,8), (179,'Charles','Johnson','[email protected]',NULL,'2000-01-
04',16,6200.00,100,8), (192,'Sarah','Bell','[email protected]','650.501.1876','1996-02-
04',17,4000.00,123,5), (193,'Britney','Everett','[email protected]','650.501.2876','1997-
03-03',17,3900.00,123,5), (200,'Jennifer','Whalen','[email protected]',
'515.123.4444','1987-09-17',3,4400.00,101,1), (201,'Michael','Hartstein',
'[email protected]','515.123.5555','1996-02-17',10,13000.00,100,2),
(202,'Pat','Fay','[email protected]','603.123.6666','1997-08-17',11,6000.00,201,2),
(203,'Susan','Mavris','[email protected]','515.123.7777','1994-06-07',8,6500.00,101,4),
(204,'Hermann','Baer','[email protected]','515.123.8888','1994-06-07',12,10000.00,
101,7), (205,'Shelley','Higgins','[email protected]','515.123.8080','1994-06-07',2,
12000.00,101,11), (206,'William','Gietz','[email protected]','515.123.8181','1994-06-
07',1,8300.00,205,11);
Data for dependents:-
INSERT INTO dependents(dependent_i,first_name,last_name,relationship,employee_id) VALUES
(1,'Penelope','Gietz','Child',206), (2,'Nick','Higgins','Child',205), (3,'Ed','Whalen','Child',200),
(4,'Jennifer','King','Child',100), (5,'Johnny','Kochhar','Child',101), (6,'Bette','De Haan','Child',102),
(7,'Grace','Faviet','Child',109), (8,'Matthew','Chen','Child',110), (9,'Joe','Sciarra','Child',111),
(10,'Christian','Urman','Child',112), (11,'Zero','Popp','Child',113), (12,'Karl','Greenberg','Child',108),
(13,'Uma','Mavris','Child',203), (14,'Vivien','Hunold','Child',103), (15,'Cuba','Ernst','Child',104),
(16,'Fred','Austin','Child',105), (17,'Helen','Pataballa','Child',106), (18,'Dan','Lorentz','Child',107),
(19,'Bob','Hartstein','Child',201), (20,'Lucille','Fay','Child',202), (21,'Kirsten','Baer','Child',204),
(22,'Elvis','Khoo','Child',115), (23,'Sandra','Baida','Child',116), (24,'Cameron','Tobias','Child',117),
(25,'Kevin','Himuro','Child',118), (26,'Rip','Colmenares','Child',119), (27,'Julia','Raphaely',
'Child',114), (28,'Woody','Russell','Child',145), (29,'Alec','Partners','Child',146), (30,'Sandra','Taylor'
,'Child',176);
Table: departments
Table: employees