0% found this document useful (0 votes)
108 views8 pages

Dbms Lab

Part 3 dbms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
108 views8 pages

Dbms Lab

Part 3 dbms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
Adv: Need Exper; “Xperimey 1. Write a p nts (Optional to imp bet PRE IH a language ( plement) een pairs of re (CC 2. Write PaiLS OF WWo attributes in 1 Gs Java, ete, 7 @ program in a lang, the given table, pendency (ake any wag antes fC ) 10 identify functional dependencies Java, ete.) a A ele.) 10 test whethe attributes in the table) evste eget hhether @ functional 3. Using a programming language (C, C++, Java, etc), implement the algonthm for computing im by taking F as a set of nay (WO EDs {vom the table of closure of F, ic., F. Test the algorit previous experiment. 4 szorithm for conipating closure of aiibute sets Implement al; yrether an attribute is extraneous ih a given functional algorithm for testing WI Implement an < holding on a relation schema R. dependency under a set of F) Implement an algorithm for computing eanonical cover. relation, ete, Inchude experiments later on Testing lossless decomposition, decomposition of (10 be done by skj) Experiment No.-09 Create a relational database schema for a Company, described by the following relations and Inse tuples. ame, L-name, Emp-id, Bdate, Address, Gender, Salary, Super ployee ( id, D-no) D-no, D-Mgr-id, Mgr-start-date ) ame, Department (D- Dept-Location(D-no, D-location ) Project (P-name, P-number, P-location, D-ne } Works-on (Emp-id, P-no, Hours ) Dependent (Emp-id. Depend ne, Gender, Bdate, Relationship) cuPLovee eur 3201-09789 Fondon Hs 1968-12-08 [638 ors fousan TX, be [Rowen ]"K frome! tone | B18 $921 Gata Ser 1x | F | 1821.06.70 /28t y tr 1978 Ot Ta Eecloh [apa [intowr WORKS on Een 723456780, [rasasnas Bugae5558 [easessees DereNoenr re | Ravasee Vaseissees [oy te Spo | [ervereer [90] 8@ | f wareseaar | ar Tt 1982 0326 Srome | orae7007 Specify the following queries in SQL. on the databas schema Company (1). Company decided to give a raiseon sal ProductX” project by 10 percent aries of every employee, working on the (2). Find the names and addiess ofall employees who work on same (9). Retiieve the name & eomployee no of employees, whose salary is between $30,000 and $49,000, department (Find the names ofall employees ‘who are directly supervised by “Franklin ©) List the name and addvess of al employees who work for the ‘Research’ department, (6). 1) (8). 9). List the names of employees who works on all project controlled by departmey, mumber 5 List the names of all employees who have a dependent with the same first name as themselves, Retrieve the names of all employees in department 5 who work more than 10 hours per week on XYZ Project. Retrieve a list of employees and the projects they are working on, ordered by department and, within each department, ordered alphabetically by last name, then first name, ‘SE Supervisor city name start name “NEW”, (5). Retrieve the project name, ‘whose location pin code consists first 3 digits are “111° (6). Retrieve the employee name, Employee id, dept no, project no, whose were born during 1980 and working in a project located at “INDIA (7). Retrieve the tora! number of Employees in organization (8). Count the number of distinct salary values in the Company (9). Retrieve the total number of Supervisor in organization (10), Retrieve the total no of Female Employee in organization, whose salary is more than 25000. (11). Retrieve the total number projects currently in company, (12), Find the sum of the salaries of all employees, the maximum salary, the minimum salary, and the average salary. (13). Retrieve the average salary of all female employees, (14). Retrieve the Employee id & no of projects, employee is working on. (15), Retrieve employee id, employee name, total no of hours he works on project Experiment No-l0 Specify the followhny queries In SQL on the database selves Company periment na, U8) (1). Retrieve the total nn mule & feanale employes in the Organiza al no of emplayes working, for each of (2), Retrieve the tol the department marae and the # (3). For each department, retri employees workin, in that department the project nan (4). For each project, retvieve the project nur employees who work en nat project ours per week, May #6 (5). For each project, list the project mame and total no of hours Ber MOS WG employees) spent an the project. ch least number of ern) (6). Retrieve the Project name & no of employee,invihi working. No, number of (7). Retrieve the name of department name & department are controlling highest no of projects. (8), For each project on which more than two employees work, 7 number, the project name, and the number of employees who vi (9). For each project, retrieve the project number, the project name, employees from department | who work on the project, (10). For each departnent that hues more than five employees, number and the nusnber of its employees who are making nore 1 (J), Retrieve the names of the »ployee who do not have supervisors. (12), Retrieve the + of employees who work on all projects contr No 05, (13), Find the name ofall (14), Make a ist of pro ployves who earn more than a crage § vunihers for projects that involve an emp name is Smith’, vithe: wiker or ay a manager of the de the projet Experiment No.-11 Specify the followi i y SOWIE queries in SQL on the database schema Comps (Experiment no. 08) _ a). Retrieve the na iev mes of all employees who work on every project 2). List the last name of ro ler Q). he last name of all department managers who have no dependent (3). List the names of managers who have at least one dependent (4). Rete (5). (6). ve the names of employees who do not work on any project Retrieve the names of employees who work on all projects. Retrieve the name of department name & department No, number of employees, Number of projects, who is controlling highest no of projects (1). List the name of cach employee who works on some project controtied by department number (8). Retrieve the name of department name & department No, number of employees, Number of projects, who is controlling highest no of projects (9). A view that has the department name, manager name and manager salary for every department, (10). A view that has the project name, controlling department, number of employees, and total hours worked per week for each project. (11). A view that has the project name, controlling department name, number of employees, total hours per week on the project for each project with more than one employee working on it. nment = DB Design MWe A, kof the teats and janie oF Hapaels ei A database is being eonstineted to keep elt ge, HAs deine team has a number of players, aot all of whom participate ine keep track of the players participating in eachgame for each fem, the positions they played in that game, and the result ofthe game, Design an ER selena dium far this favourite sport (ei. KOEGED, sumptions you make, Choose you application, baseball. football. stating any (1). Find the name of Team, who won the maximum number of matches {unis (2). Retrieve the name of players of each participating teuna, whe played hijhest niuibes of games (for a team). (3). Revieve the name of players of each (eam, who played on every mutch in whielt the team is winning team, Atel, (4). Retrieve the name of venues in which each team won at Least a pained (5). Find the name of players for each team in toumament that played at least in tice for each team different positions on diffevent games/matches (6). Retrieve the Team Name, Player Name, opponent team, pliyer position for all ing sido. matches where team is Lo

You might also like