Suppose that a database had an employee table and a jobs table. The employee table has a column named JobTitle and the jobs table has a column named JobName. We have defined a relationship between the tables saying that there is a one-to-many relationship between the JobName in the jobs table and the JobTitle in the employee table. What would happen if we added a new employee with a JobTitle which could not be found among the JobName values in the jobs table? How could this problem be fixed?
if relation ship exists :
if we added a new employee in employee table whose JobTitle does not exists in jobs table then insertion anomaly error occurs , means that corresponding employee doesn't add in the employee table until that job added in the jobs table.
to fix that problem we use nornal froms like first , second , third normal form and BCNF. By using normal forms we can divide tables according to that form and we can fix anomalies.
Suppose that a database had an employee table and a jobs table. The employee table has...
An Employees table was added to the JustLee Books database to track employee information. Display a list of each employee's name, job title, and manager's name. Use column aliases to clearly identify employee and manager name values. Include all employees in the list and sort by manager name.
The database(or the tables) are follow: CREATE TABLE employees ( id SERIAL NOT NULL PRIMARY KEY, name TEXT NOT NULL, salary REAL NOT NULL DEFAULT 25000.0 ); CREATE TABLE employee_audit_log ( employee_id INTEGER NOT NULL, occurred_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); INSERT INTO employees(name, salary) VALUES ('Arnold Schwarznegger', 35000), ('Yuri Gargarin', 27000), ('Anakin Skywalker', 450000), ('Said Faroghi', 15000), ('Zino Holwerda', 8500); 1. Create a trigger for the employees table so that a new row is inserted in employee audit_log...
For this set of Review Questions, we will create and use a database for the Wedgewood Pacific Corporation (WPC) that is similar to the Microsoft Access database we created and used in Chapters 1 and 2. Founded in 1957 in Seattle, Washington, WPC has grown into an internationally recognized organization. The company is located in two buildings. One building houses the Administration, Accounting, Finance, and Human Resources departments, and the second houses the Production, Marketing, and Information Systems departments. The...
The owner of a small chain of appliance stores wants to build a database to help track data about its regions, stores, employees and jobs. The chain has divided the map of where its stores exists into various regions. Each region has a description (of boundaries). Each store is named, has an average market size (expressed in dollars) and belongs to s specific region. Each store also has an address, city, state, and zip. The database should...
QUESTION 1 What is the most common relationship within a relational database? Select the best answer from the following. One-To-One relationship. o One-To-Many relationship. Many-To-Many relationship. Zero-To-Zero relationship. QUESTION 2 What is an "entity'? Select the best answer from the following. An entity, for our purposes, is the same as a table in the database. An entity represents one of the columns in an individual table. There are no entities in a relational database. Entities are only part of NoSQL...
Garden Glory Project Questions The following Garden Glory database design is used in Chapter 3: OWNER (OwnerID, OwnerName, OwnerEmail, OwnerType) PROPERTY (PropertyID, PropertyName, Street, City, State, Zip, OwnerID) EMPLOYEE (EmployeeID, LastName, FirstName, CellPhone, ExperienceLevel) SERVICE (PropertyID, EmployeeID, SeviceDate, HoursWorked) The referential integrity constraints are: OwnerID in PROPERTY must exist in OwnerID in OWNER PropertyID in SERVICE must exist in PropertyID in PROPERTY EmployeeID in SERVICE must exist in EmployeeID in EMPLOYEE Garden Glory has modified the EMPLOYEE table by adding...
Assume that The Queen Anne Curiosity Shop designs a database with the following tables. CUSTOMER (CustomerID, LastName, FirstName, EmailAddress, EncyptedPassword, City, State, ZIP, Phone, ReferredBy) EMPLOYEE (EmployeeID, LastName, FirstName, Position, Supervisor, OfficePhone, EmailAddress) VENDOR (VendorID, CompanyName, ContactLastName, ContactFirstName, Address, City, State, ZIP, Phone, Fax, EmailAddress) ITEM (ItemID, ItemDescription, PurchaseDate, ItemCost, ItemPrice, VendorID) SALE (SaleID, CustomerID, EmployeeID, SaleDate, SubTotal, Tax, Total) SALE_ITEM (SaleID, SaleItemID, ItemID, ItemPrice) The referential integrity constraints are: ReferredBy in CUSTOMER must exist in CustomerID in CUSTOMER Supervisor...
The employee is table, the best candidate for primary key is Select one: a. Department ID b. Employee hiredate c. Employee ID d. Employee salary Question 2 A primary key can be composed of more than one attribute. Select one: True False Question 3 A foreign key allows you to join two tables. Select one: True False Question 4 Given two tables, department (dept_id, dept_location, dept_name) and EMPLOYEE(emp_id, emp_name, emp_dept_id, emp_name, emp_salary), which attribute (column) is the foreign key? Select...
I need help with the following SQL query for a company database (script given below). The name of the Department. The number of employees working in that department. The number of different projects controlled by this department. The name of the project controlled by this department that has the maximum number of employees of the company working on it. The number of the above project. The cumulative sum of the number of employees of the company working on the projects...
C++ program.A shoe company where there are departments, employee,manager and database manager. The company has three sizes of shoes ;small,medium and large and there are three colors of shoes;yellow,brown and white associated with different sizes.The company sells the shoes online and so it keeps a track of how many different size of shoe with different colors are available and it changes as per the specific item sold.Also,it keeps the data of how many shoes are sold of each size of...