Create tables with appropriate primary keys and foreign keys

Assignment Help PL-SQL Programming
Reference no: EM13826524

Problem 1. Consider the employee database with the following list of tables. Please create these tables with appropriate primary keys & foreign keys.

The list of tables is:

Company(cid, company_name, city, state) /* city is the company's location */

Employee(eid, ename, street, city, state, salary, cid) /* city is where the employee lives*/

Manages(eid, mid) /* mid is manager's ID*/

Problem 2. Insert at least three rows of data to each table. Make sure you keep the primary key and foreign key constraints.

Problem 3. Please write ONE SQL statement for each of the following tasks using tables created in Problem 1.

Task 1: Return the names of employees who lives in Baltimore. If you do not have Baltimore as a city name in Employee table, use any city name you have (e.g., New York).

Task 2: Return the names of all employees whose company is in Baltimore. If your Company table does not have companies located at Baltimore, use any city name in your Company table (e.g., New York).

Task 3: Return the number of companies located in each city.

Task 4: Return the names of cities with at least two companies located.

Task 5: Return the names of companies and the number of employees working at each company.

Task 6: Return the names of employees of Verizon who are managers. Hint: managers are also employees but their eid appears as mid in manages table. If you do not have Verizon as a company name, use any company name in your company table (e.g., ATT).

Reference no: EM13826524

Questions Cloud

Important for effective supply chain management : Why is demand forecasting important for effective supply chain management - what are three measures of forecasting accuracy?
Evaluation plan for bayer south africa : Develop Marketing And Evaluation Plan For Bayer South Africa
Assessing default risk of larger companies : Suggest four different accounting ratios that might be used by commercial banks and credit rating agencies to assess the default risk of larger companies. What other information, other than accounting statements, can be used to assess corporate cr..
Problem regarding credit scoring model : What is a "credit scoring" model and how can it be used by lenders in making decisions about personal and small corporate lending?
Create tables with appropriate primary keys and foreign keys : Return the names of all employees whose company is in Baltimore - Return the names of employees of Verizon who are managers.
Private sector credit references agencies : Explain, briefly, the job undertaken by private sector credit reference agencies, such as Experian, in the market for personal household credit in the UK and US.
Write a brief essay on the macroeconomic analysis of kuwait : This problem related to Economics, mainly Macroeconomics. The problem is clarify the economic condition of Kuwait. Kuwait is one of the world's richest countries
Default on mortgage lending : In a severe housing market recession, why would loss given default on mortgage lending be higher than loss given default in normal years?
Consumer decision making model : Consumer Decision Making Model And Positioning Strategy Of Competing Products

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Write programme in oracle to make employee table

List the employee_id and employee_name of the employees form the l_employees table with the top 4 credit limits.

  Display the customerid from the orders table

Display the CustomerID from the Orders table and the sum of the associated ItemPrice multiplied by Quantity using Gross Sales (with a space) as the column name from the OrderItems table.

  Attempt the following1 run the lab0301sql script in the

attempt the following1. run the lab0301.sql script in the attached file to create the salhistory table. 2. display the

  Create account, email confirmation, and account activation

Chosen User Identifier for the account - System must ensure the user id is at least 5 characters, and no existing accounts with the same user id- If same user id exists, System must require User to choose another user id

  Write command to list all the employees in year

Write the command to list all the employees hired in 2003 and 2004. Sort the rows by the hire_date column in descending order.

  Write a query that will list the part number

Write a query that will list the part number, part description, and on-hand value (units on hand * unit price) for each part in item class AP. Give the expression an alias of "On Hand Value".

  Analyse er diagram and database schema

Display the structure details for which the smallest total billable activity (time) has been performed in the last month - Display details of all employees (number, name) for whom billingrecords have been created when they are not identified as havi..

  Application which tests the random number generation

Write a Java application that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers.

  Write sql statement to display first-last name of students

Write a SQL statement to display the First and Last name of students who have the Status greater than 1 and less than 10. Use BETWEEN.

  Create a pl-sql block using the hr schema

Create a PL/SQL block to achieve the following using the HR schema and select the name, salary, and department of the employee with the maximum salary.

  Write a select statement that returns two columns

Write a SELECT statement that returns these two columns - CategoryName The CategoryName column from the Categories table

  Write a plsq block to do the followingselect the average

write a plsq block to do the followingselect the average salary of all employees in department number 20.if the average

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd