Question

In: Computer Science

Subject :Introduction to Database SQL Q 1: List the emp who are working for the Deptno...

Subject :Introduction to Database

SQL

Q 1: List the emp who are working for the Deptno 10 or 20.

Q 2: List the Empno, Ename, Sal, Dname of all the ‘MGRS’ and ‘ANALYST’ working in New
York or Dallas with an salary 3000, 2450 or 2850.

Q 3. List the daily salaries (Salary per day) of employees?

Q 4: Display ename ,sal , and increment of in 100 in annual sal from employee Table?

Solutions

Expert Solution

Consider employee as table name.

Q 1: select * from employee where Deptno in (10,20); // This will select all employees present in department number 10 or 20

Q 2: select e.Empno,e.Ename,e.Sal,d.Dname from employee e, dept d where e.deptno=d.deptno and e.job in ('MGRS','ANALYST') and d.loc in ('New York','Dallas') and e.Sal in (3000,2450,2850);// let us consider dept table has deptno and loc as attributes... so the common attribute between employee and dept is depno... we will join two tables based on that condition and MGRS and ANALYST are the employee jobs

Q 3: select sal/30 from employee; // consider sal attribute has monthly salary ... so if we want to get daily salary we need to divide sal with no.of days (30)

Q 4: select ename ,sal ,(sal*12)+100 from employee; // annual salary means yearly salary so (sal*12) because year has 12 months and increment of 100 in annual salary means 100 is added to annual salary, therefore it becomes (sal*12)+100.


Related Solutions

Create the following SQL queries using the lyrics database below 1. List the first name, last...
Create the following SQL queries using the lyrics database below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in seconds 4....
1. A transaction is sequence of database operations that access the database. list and explain the...
1. A transaction is sequence of database operations that access the database. list and explain the six states in which a transaction can exit. 2. Explain the techniques that transaction recovery procedures follow.
USE ORACLE - SQL List the name and salary of employees who work for division 3....
USE ORACLE - SQL List the name and salary of employees who work for division 3. List the name of project whose budget is between 5000-7000 List the total number of employee whose initial of name is 's'. (hint, using LIKE operator and wildcard character) List the total number of employee whose initial of name is NOT 's' for each division, including division ID List the total project budget for each division, including division ID. List the ID of the...
Need answers for Normalization, Physical Design, Sql, And Security exam. 1. The database you're creating will...
Need answers for Normalization, Physical Design, Sql, And Security exam. 1. The database you're creating will be installed on a group of three servers. What feature of an enterprise RDBMS will allow one server to pick up the processing work if the main server becomes nonoperational? A. Failover B. Business intelligence C. Data warehouse D. Load balancing 2. What type of clause must you always use with DELETE or UPDATE to avoid inadvertently changing data elsewhere in the database? A....
Please write the SQL statement for the following. I am using the Adventurework2014 database. 1. Create...
Please write the SQL statement for the following. I am using the Adventurework2014 database. 1. Create a login for AdventureWorks employees. An employee login should be composed of the first letter of a person's first name combined with their last name. In addition, the login should be all lower case characters. All the required information is located in Person.Person table. Employees can be identified by "EM" value in the PersonType field. The output should include BusinessEntityID, first name (FirstName), last...
SUBJECT: PROGRAMMING IN SQL 1. Create a view named vDepartmentInstructors that returns these columns: the DepartmentName...
SUBJECT: PROGRAMMING IN SQL 1. Create a view named vDepartmentInstructors that returns these columns: the DepartmentName column from the Departments table the LastName, FirstName, Status, and AnnualSalary columns from the Instructors table. 2. Write a SELECT statement that returns all the columns from the vDepartmentInstructors view that you created in question 1. Return one row for each fulltime instructor in the English department. 3. Write an UPDATE statement that updates the vDepartmentInstructors view you created in question 1 so it...
In SQL we are working with functions 1. Write a SELECT statement that returns these columns...
In SQL we are working with functions 1. Write a SELECT statement that returns these columns from the Instructors table: a. The AnnualSalary column b. A column named MonthlySalary that is the result of dividing the AnnualSalary column by 12 c. A column named MonthlySalaryRounded that calculates the monthly salary and then uses the ROUND function to round the result to 2 decimal places 2. Write a SELECT statement that returns these columns from the Students table: a. The EnrollmentDate...
Please, No handwriting COURSE; introduction to database Define and explain the following with example: 1. Outer...
Please, No handwriting COURSE; introduction to database Define and explain the following with example: 1. Outer Joins 2. Views 3. Transactions 4. Audit Trails
SUBJECT: DATABASE SYSTEMS !!! Please answer the question as early as possible !!! Question 1 You...
SUBJECT: DATABASE SYSTEMS !!! Please answer the question as early as possible !!! Question 1 You are required to draw a complete Crow’s Foot ERD that includes the following entity relationship components based on the below descriptions: i) Identify all of the entities and its attributes. ii) Identify all possible relationships and its connectivity. iii) Identify the primary key and foreign key for each entity. iv) Identify the participation constraint and cardinality for each relationship. A Super5 company contains many...
1. Write a query in SQL to find the full name of the “Actors” who appeared...
1. Write a query in SQL to find the full name of the “Actors” who appeared in the movie titled Star Wars (using JOIN ). 2.Write a SQL query to find the movie Title that has received Lowest rating from reviewers, but whose actors have received an award for their contribution in movie. (Expected Output: Fantastic Beasts and Where to Find Them) 3.Write a SQL query that display the list of genres, Number of movies in that genre grouped by...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT