Skip to main content

INF503 WEEK-3 LESSON (7,8&9) LAB


LESSON-7

Q1)Which of the following joins is the default type of join in a joined table, where a tuple is included in the result only if a matching tuple exists in the other relation?




                                                                                A)Inner






Q2).  Which of the following functions returns the number of tuples or values as specified in a query?

A)Count

                 Q3)  Which of the following strategies updates a view when needed by a view query?


                                                                          A)Lazy Update
LESSON 8 


Q1) Which of the following symbols denotes the SELECT operator?

A) sigma





Q2) Which of the following operations combines the results of two or more SELECT statements without including duplicates?


A) Union

Q3) Which of the following operations combines the result of two SELECT statements and returns only those results which belong to the first set of result?

A)SET DIFFERENCE


LESSON 9

Q1) What is the first step of an algorithm for ER-to-relational mapping?

A). Mapping of regular entity types


Q2) Which step of an algorithm for ER-to-relational mapping involves the following approaches:

A) Mapping of binary 1:1 relationship types



Q3) Which of the following approaches is mostly preferred, as it reduces the number of tables?

A) Foreign key


LAB



LAB-7

1.

SELECT DISTINCT Pnumber, Pname
FROM PROJECT
WHERE  Pnumber IN
(SELECT Pnumber
FROM PROJECT, EMPLOYEE_DEPARTMENT, EMPLOYEE_REC
WHERE Dnum = Dnumber AND
Mgr_ssn = Super_ssn AND Lname = 'Zelaya')
OR
Pnumber IN
(SELECT Pno
FROM WORKS_ON, EMPLOYEE_REC
WHERE Essn = Ssn AND Lname = 'Smith');


2.

SELECT Lname, Fname
FROM EMPLOYEE_REC
WHERE Salary > (SELECT MAX (Salary)
FROM EMPLOYEE_REC
WHERE Dno = 5);


3.

SELECT E.Lname AS Employee_name,
S.Lname AS Supervisor_name
FROM (EMPLOYEE_REC AS E LEFT OUTER JOIN EMPLOYEE_REC AS S
ON E.Super_ssn = S.Ssn);


4.

SELECT SUM (Salary), MAX (Salary), MIN (Salary), AVG (Salary)
FROM (EMPLOYEE_REC JOIN EMPLOYEE_DEPARTMENT ON Dno = Dnumber)
WHERE Dname = 'Research';


5.

SELECT COUNT (*)
FROM EMPLOYEE_REC;

6.

SELECT Pnumber, Pname, COUNT (*)
FROM PROJECT, WORKS_ON
WHERE Pnumber = Pno
GROUP BY Pnumber, Pname
HAVING COUNT (*) > 1;


7.

UPDATE EMPLOYEE_REC
SET Salary =
CASE WHEN Dno = 5 THEN Salary + 2000
WHEN Dno = 4 THEN Salary + 1500
WHEN Dno = 1 THEN Salary + 3000
ELSE Salary + 0;


8.

CREATE ASSERTION SALARY_CONSTRAINT
CHECK (EXISTS (SELECT *
FROM EMPLOYEE_REC E,
EMPLOYEE_DEPARTMENT D
WHERE E.Salary > 25000
AND E.Dno = D.Dnumber
AND D.Mgr_ssn = E.Ssn));


9.

CREATE VIEW WORKS_ON1
AS SELECT Fname, Lname, Pname, Hours
FROM EMPLOYEE_REC, PROJECT, WORKS_ON
WHERE Ssn = Essn AND Pno = Pnumber;


10.

ALTER TABLE COMPANY.EMPLOYEE_REC ADD COLUMN Job VARCHAR(12);



LAB-8


1.

SELECT DISTINCT Sex, Salary
FROM EMPLOYEE_REC;


2.

SELECT City FROM EMP_CUSTOMERS
UNION
SELECT City FROM EMP_SUPPLIERS
ORDER BY City;


3.

SELECT *
FROM EMPLOYEE_REC
WHERE Dno = 4 AND Salary > 25000;


4.






















































































































Comments

Popular posts from this blog

IS5213 Data Science and Big Data Solutions

WEEK- 2 code  install.packages("dplyr") library(dplyr) Rajeshdf = read.csv('c:\\Insurance.csv') str(Rajeshdf)                        str(Rajeshdf) summary(Rajeshdf) agg_tbl <- Rajeshdf %>% group_by(Rajeshdf$JOB) %>%    summarise(total_count=n(),             .groups = 'drop') agg_tbl a = aggregate( x=Rajeshdf$HOME_VAL, by=list( Rajeshdf$CAR_TYPE), FUN=median, na.rm=TRUE ) a QUIZ 2. What famous literary detective solved a crime because a dog did not bark at the criminal? A). Sherlock Holmes 1.  In the Insurance data set, how many Lawyers are there? A).  1031 3. What two prefixes does the instructor use for variables when fixing the missing values? Select all that apply. A). IMP_ M_ 4. What is the median Home Value of a person who drives a Van? A).  204139 5. In the insurance data set, how many missing (NA) values does the variable AGE have? A) 7   1. What...

GE5103-2 Project Management [Aug 23 Syllabus]

    Some of the advantages of using time boxes and cycles in project coordination efforts include creating urgency, measuring progress, and allowing for predictable measurements. A)        True 2.    Even though most project managers are not contract specialists, they need to understand the process well enough to coordinate with the team. For the current assignment, you are looking at a short-term and small effort with a contractor of just a few hours without significant clarity. Which of the following would be the most applicable contract to use in this situation? A)        Time and materials 3. The project you are working on has had modifications to the plan from the start and even how the project is run. Project governance covers all of the 3 following except: A)        Naming The project manager 4. Of the following, which is most likely a trigger condition defined early in t...

GE5093 Design Thinking All Quizzes

  GE---5093-1D2-FA-2021 - Design Thinking Home My courses 2021-FA GE---5093-1D2-FA-2021 Week 1 Reading Quiz 1 Started on Sunday, October 31, 2021, 2:04 PM State Finished Completed on Sunday, October 31, 2021, 2:30 PM Time taken 25 mins 58 secs Grade 8.00  out of 10.00 ( 80 %) Top of Form Question  1 Correct 1.00 points out of 1.00 Flag question Question text A critical finding of Edward Lorenz related to Design Thinking was: Select one: a. An application of the caterpillar effect b. The idea of deterministic chaos or the "Butterfly Effect" c. Business leaders enjoy chaos d. Statistical modeling of weather was fairly accurate in the long term Feedback Your answer is correct. The correct answer is: The idea of deterministic chaos or the "Butterfly Effect" Question  2 Incorrect 0.00 point...