Question

Q1) Connect to HR database and write the queries to answer the following questions. Provide your...

Q1) Connect to HR database and write the queries to answer the following questions. Provide your queries text and result in a .txt file: a) How many employees you can find in the Employees table b) How many departments are there in this database c) How many employees work for sales department d) What is the average salary of department 50 e) Copy Countries table from HR database into Section 24 using Select Into clause. f) Write a query to select the 5 least paid employees hired before June 1st, 2008 Q2) Submit a script to do the following: Create a student table (Using Create Table) with the following fields. (to name fields in sql scripts replace spaces with underscores). Choose Appropriate data types: student id first name last name email address date of birth program name current semester Add five student records (Using Insert). Choose your examples but have two from Computer Eng program, two of Computer Technician and one in System Analysis Program Delete the System Analysis record (Using Delete statement with Where clause). Update the Computer Technician semester setting it to one (Using Update Statement). Keep the table into your Section 24 database. (In your submission provide your user Id).

Homework Answers

Answer #1
  1. SELECT COUNT(*) FROM emp_details ;
  2. SELECT COUNT(*) FROM department;
  3. SELECT COUNT(*) FROM employees WHERE dep_id IN (SELECT dep_id FROM department WHERE dep_name = 'Sales');
  4. SELECT avg(salary)FROM employees where department_id= 50;
  5. SELECT country FROM employees.
  6. CREATE TABLE Student ( StudentID int, first_name char(20) , last_name char(20) , email varchar(15) , DOB DATE, program _name char(20), current_sem int,PRIMARY KEY(StudentID));
  7. INSERT INTO Student (StudentID , first_name , last_name , email , DOB , program_name ,current_sem)

VALUES ( (124, john , smith , [email protected] , 1990-3-4, CS , 5),

(125, sam , Curran , [email protected] , 1990-5-3, CS , 6) ,

(126, tom , wiley , [email protected] , 1990-6-4, EC , 5),

(127, john , son , [email protected] , 1990-3-7, EC , 6),

(128 , will , taylor, [email protected], 1990-4-6, EC, 5) );

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Perform SQL queries in the given data structure. write an SQL query that gives the number...
Perform SQL queries in the given data structure. write an SQL query that gives the number of courses taken for every student in the student table. For each instructor, show the instructor name and the number of sections that have been taught by that instructor. You do not need to include instructors who have never taught a section. List in order of decreasing the number of sections taught. Give the number of semester/year combinations in which sections have been offered....
Specify the following queries in SQL on the COMPANY database. Show the result of each query....
Specify the following queries in SQL on the COMPANY database. Show the result of each query. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ‘ProductX’ project. List the names of all employees who have a dependent with the same first name as themselves. Find the names of all employees who are directly supervised by ‘Franklin Wong’. Specify the following updates using the SQL update commands. Show the state of...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make the files to create and populate the Company database available on Isadore shortly): List the last name and address of managers who have a dependent with the same first name as themselves. Retrieve the names of all employees who are directly supervised by ‘Franklin Wong’. Retrieve the names of employees in the Research department who work more than 20 hours per week on the...
Make Java program with the following tasks: 1. Create a new database called DTCC 2. Create...
Make Java program with the following tasks: 1. Create a new database called DTCC 2. Create a table called Students in the DTCC database with the following fields:     Student_ID    CHAR (10) ** make sure to set this field as the primary key     LastName      CHAR(20)     FirstName     CHAR(15)     PlanOfStudy CHAR(25)     GPA               Double 3. Insert 5 records into Students table: 899090111    Rothlisberger   Ben          CIT                                       3.7 129020202    Manning          Peyton     Computer Programming       3.8 890101030    Brady               Tom         Accounting                           3.4 980191919    Rodgers           Aaron       Networking                          3.2...
home / study / engineering / computer science / computer science questions and answers / consider...
home / study / engineering / computer science / computer science questions and answers / consider the following set of requirements for a university database that is used to keep track ... Question: Consider the following set of requirements for a UNIVERSITY database that is used to keep track o... Consider the following set of requirements for a UNIVERSITY database that is used to keep track of students' transcripts. (a) The university keeps track of each student's name, student number,...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write the following queries in MYSQL: 1) Find all the Comments created by “Mike_34” with a score bigger than 80 2) Find the Film title from all the movies with an actor with first name “TOM”. 3) Find the full name of all the actors in the movies with at least a comment with a score equal to 100. Schema: Consider a movie relational database...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write the following queries in MYSQL: 1) Find the actors that have movies in all the categories. 2) Movies have a length in minutes. Show a list with all the lengths ordered from shorter to longer, and the number of movies for each of the lengths. 3) Show the 10 first results with the first name, last name and average length of the movies for...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write the following queries in MYSQL: 1) Find the actors that have movies in all the categories. 2) Movies have a length in minutes. Show a list with all the lengths ordered from shorter to longer, and the number of movies for each of the lengths. 3) Show the 10 first results with the first name, last name and average length of the movies for...
Consider Sakila Database. Write a query in mySQL workbench to answer each of following questions. Q1)...
Consider Sakila Database. Write a query in mySQL workbench to answer each of following questions. Q1) By looking at city table. Write a query that identify the in how many cities the company has branches. Rename the column name to TotalNumberOfCities. You have to look at city table and write a query to count number of rows. Q2) By looking at film table. How many films we have that its description contains the word "Robot". Count number of films and...
Using Visio Pre-PatriotWeb, the University needed a Course Registration Database. You have been tasked with this...
Using Visio Pre-PatriotWeb, the University needed a Course Registration Database. You have been tasked with this task and the following business rules have been given to you: Students need to be tracked with the following information: Name First Enrolled Semester First Enrolled Year Major GPA Student Status (Full or Part) Courses need to be tracked with the following information (think Course Catalog): Course Number Course Name Course Description Credits Course Coordinator The courses being offered per semester needs to be...