
Concept explainers
Create another application/class named EmployeeDatabase that allows you to store an
array that acts as a
decides to continue, offer three options: to add a record to the database, to delete a record
from the database, or to change a record in the database. Then proceed as follows:
If the user selects the add option, issue an error message if the database is full.
Otherwise, prompt the user for an Id. If the Id already exists in the database, issue
an error message. Otherwise, prompt the user for rest of the inputs and add the new
record to the database.
If the user selects the delete option, issue an error message if the database is empty.
Otherwise, prompt the user for an Id. If the Id does not exist, issue an error message.
Otherwise, delete the record.
If the user selects the change option, issue an error message if the database is empty.
Otherwise, prompt the user for an Id. If the requested record does not exist, issue
an error message. Otherwise, prompt the user for a new salary value and change the
salary value for the record.
After each option executes, display the updated database in ascending order by
Employee Id and prompt the user to select the next action.
Part e should be done using an array but not ArrayList.
Sample output for Part e
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> A
Enter Employee ID >> 500
Get user input here………………………………
Current database:
ID 500
SSN: 999-23-1234
first name: Mehwish
last name: B.
address: Burnaby
dept: HR
annual salary: 89000.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> A
Enter Employee ID >> 600
Get user input here………………………………
3
Current database:
ID 500
SSN: 999-23-1234
first name: Mehwish
last name: B.
address: Burnaby
dept: HR
annual salary: 89000.0
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 45678.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> D
Enter ID to delete >> 500
Current database:
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 45678.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> C
Enter ID to change >> 34
Sorry - ID number #34 does not exist in the database
Current database:
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 45678.0
4
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> C
Enter ID to change >> 600
Enter salary >> 56000
Current database:
ID 600
SSN: 123-12-1234
first name: Sarah
last name: T
address: Vancouver
dept: MARKTING
annual salary: 56000.0
Do you want to (A)dd, (D)elete, or (C)hange a record or (Q)uit >> Q
Good bye!!

Step by stepSolved in 2 steps

- Access Assignment Problem: JMS TechWizards is a local company that provides technical services to several small businesses in the area. The company currently keeps its technicians and clients’ records on papers. The manager requests you to create a database to store the technician and clients’ information. The following table contains the clients’ information. Client Number Client Name Street City State Postal Code Telephone Number Billed Paid Technician Number AM53 Ashton-Mills 216 Rivard Anderson TX 78077 512-555-4070 $315.50 $255.00 22 AR76 The Artshop 722 Fisher Liberty Corner TX 78080 254-555-0200 $535.00 $565.00 23 BE29 Bert's Supply 5752 Maumee Liberty Corner TX 78080 254-555-2024 $229.50 $0.00 23 DE76 D & E Grocery 464 Linnell Anderson TX 78077 512-555-6050 $485.70…arrow_forwardSBN Title Author 12345678 The Hobbit J.R.R. Tolkien 45678912 DaVinci Code Dan Brown Your student ID DBS311 Your Name use the following statement to Write the MongoDB Shell code to completely delete the entire database, including all collections and documentsarrow_forwardUntil a file signature analysis is run, EnCase relies on the ______ to determine its file type. header extension database acquisition hash libraryarrow_forward
- Chapter 17 How to manage database security Exercises using the My Guitar Shop Database Use Microsoft SQL Server Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. 2.Write a script that (1) creates a login ID named “RobertHalliday” with the password “HelloBob”; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named “RobertHalliday” for the login; and (4) assigns the user to the OrderEntry role you created in exercise 1.arrow_forwardCreate an application which can access a database. Create a database with an application user, user specific for your application to use, and 1 table of a couple of fields properly indexed. Grant permissions for the user to access the table. (submit .SQL file) Create a simple application, language of your choice, (BE languages only, no JS or Node) which can do the following operations: (submit source code file): Connect using the application user created above. Insert into the table, and select from the table using a WHERE clause, where all fields are parameterized. Display results of the select. Use a simple web server API interface for data input and output, which can be accessed via local browser or curl.arrow_forwardCreate a user Nurse. (Screenshot 1) Create a database Hospital. (Screenshot 2) Grant Nurse privileges to Hospital (Screenshot 3) As Nurse, create a table Patients with the following structure. (Screenshot 4) PatientID RoomNo FirstName LastName Admission Temperature double(10,2) int(8) Primary Key and not null int(4) varchar(14) not null varchar(14) not null datetime Use a command to describe the table(Screenshot 5) Insert 2 patients randomly to the above table(Screenshot 6) Show all the contents of the table. (Screenshot 7)arrow_forward
- EXAMINE THE TRIGGER BELOW IS IT CORRECT? IF NOT MODIFY Create test to show that the triggers are correctly implemented, do the following: Truncate the Transaction table Reset the Tx_Nbr sequence back to 1 Update the Account table, setting the Balance back to zero Re-run the INSERT statements for the transactions Use simple queries to demonstrate that the results in the Transaction and Account tables are as expected GIVEN THE TRIGGER BELOW: Trigger to enforce the referential integrity for the Transaction Ref_Nbr: Deposit or Withdrawal transaction to Bank Branch Bill Payment, Debit Purchase, or Return transaction to Merchant CREATE TRIGGER Transaction_RefNbr_Check BEFORE INSERT OR UPDATE ON Transactions FOR EACH ROW DECLARE TxRefNbr_count INTEGER; BEGIN IF:NEW.TxTypeCode = ‘D’ OR :NEW.TxTypeCode = ‘W’ THEN SELECT COUNT(*)INTO TxRefNbr_count FROM BRANCH WHERE BranchNbr=:NEW.RefNbr; IF TxRefNbr_count = 0 THEN…arrow_forwardimport sqlite3 from sqlite3 import Error # Creates connection to sqlite in-memory database def create_connection(): """ Create a connection to in-memory database :return: Connection object """ try: conn = sqlite3.connect(":memory:") return conn except Error as e: print(e) # YOUR CODE HERE # Use sqlite3.connect(":memory:") to create connection object return conn # query to create the table table_sql = """ CREATE TABLE Horses ( id integer PRIMARY KEY NOT NULL, name text, breed text, height real, birthday text ); """ # query to insert data into the table ins_sql = """INSERT INTO Horses VALUES(1,'Babe','Quarter Horse',15.3,'2015-02-10'); """ # query to fetch all data from the table fetch_sql = """SELECT * FROM Horses;""" # creating db connection conn = create_connection() # fetching a cursor from the connection c = conn.cursor() # executing statement to create table c.execute(table_sql) # executing statement to…arrow_forwardHow can you create a form that shows the columns of only a single row of a database in an application?arrow_forward
- Will be using code Lginter! Registration First Name Last Name Email Address Password Confirm Password Require to have validation of user input Valid email address Make sure the email address does not exist in the database before doing insert into the database Password and Confirm Password are matching Password need to hash before doing insert into database ("password_hash" is a PHP build in function which can be used)arrow_forwardTask 3: The Marketing team wants to collect emails of the users on InstantStay. However, the team needs a SQL statement to execute inside their programming environment. You need to create a statement that they can easily run the EXECUTE command to return a single column table containing the USER_EMAIL addresses. Task: Create a prepared statement for use with the EXECUTE command.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





