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

  Select statement without a from clause

Write a SELECT statement without a FROM clause that creates a row with these columns To calculate the fourth column, add the expressions you used for the first and third columns.

  Display the output of the sql statement

Write a procedure that takes a car registration and returns the most recent date of rental and the maximum rental period for that car.  The procedure had the following formal parameters

  Trigger named products_update

Create a trigger named Products_UPDATE. This trigger should insert the old data about the product into the ProductsAudit table after the row is updated. Then, test this trigger with an appropriate UPDATE statement.

  Write a xquery which returns all concert titles

Write a XQuery which returns all concert titles whose type is chamber orchestra where average ticket price is at least $50.

  Write sql statement-display major of student-no duplications

Write a SQL statement to display the Major of the student with no duplications. Write a SQL statement to display the First and Last name of students who live in the Zip code 88888.

  Write sql queries against the database schema

write SQL queries against the database schema - Some courses are popular among students just because students enrolled in those courses generally get good grades.

  Write a script that creates and calls a stored procedure

Write a script that creates and calls a stored procedure named spInsertProduct that inserts a row into the Products table. This stored procedure should accept five parameters.

  Review problem and run required statement to create table

Please note that for "Table Employees" due to length of the table description and page size limit, I have broken it into 2 parts for better visibility, please make sure to use all the given attributes from the table.

  Decomposition for r = (a,b,c,d,e )

Give a good decomposition for R = (A,B,C,D,E ) with the following functional dependencies:

  Create a comparison document

Create a Comparison Document

  Write an update statement that modifies the row

Write an UPDATE statement that modifies the row you just added to the Categories table. This statement should change the ProductName column to "Woodwinds", and it should use the CategoryID column to identify the row.

  Write sql create table statement to create pet table

Write an SQL CREATE TABLE statement to create the PET table without referential integrity constraint on OwnerID in PET.

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