Question

Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accounting,Instructions and Specifications For this assignment, you will do your work in Codio in the Personal Playground unit. If the tTable Name: flight_reservation Field Notes Туре int(8) flight_id Primary key Required Primary key Required int(8) customer idTask Four: Insert Records to Customer Table Construct the SQL statement to insert five new records in the customer table. M

Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accounting, and employee data, and these different data sets must all be efficiently managed in order to make the data accessible. Companies rely on database engineers to ensure that their records are accurate, updated, and tracked in real time. This course covers structured query language (SQL) and how it can be used to manage database schemas, manipulate data, and analyze data. For your final project, you will apply the skills you learned in order to demonstrate your mastery of the key concepts necessary for effective database management. These are skills you will be able to apply to your future courses as well as your career in managing information systems Prompt: The second milestone assignment builds upon the concepts that you have learned thus far. In the first milestone assign ment, you created a database from scratch. In this assignment, you start with an existing database, and you must make the necessary modifications to it and manipulate the data within the database. Like the first assignment, you are using MySQL in the Codio learning environment. You will write a series of SQL statements to alter a table in the database, insert records, update records, and delete records. You will provide a written report explaining your work. Directions: Your first project at SNHU Airlines was a success. You were able to implement the database for the company's human resources system. You have now been assigned to work on the database for the flight reservation system. Unlike the human resources system, the flight reservation system does not need to be completely rebuilt. Only a few modifications are needed to the flight reservation database. This database is used to keep track of customers, flights, flight status and which customers are on which flights. Refer to the Database Schema section for details on the database. oon Database Schema Ra Toe he Tepe Piay Rare stea ch wteri atvired d de os seL Baly asen
Instructions and Specifications For this assignment, you will do your work in Codio in the Personal Playground unit. If the terminal does not appear in the Personal Playground, select Tools and then Terminal. Once you are in the terminal, type "mysql" to start the MySQL Command line interface. You will need to provide all of the SQL commands that you created and executed to complete the assignment. You can do this by copying and saving your SQL commands to a .sql file or .txt file using a plain-text editor like NotePad or Sublime Text. Refer to the Frequently Asked Questions document for details on how to create this file. Alternatively, you can create the SQL the plain-text editor first and then copy and paste the SQL statements into the MySQL command line interface. statements Task List The following tables have already been created for you. Each table is already populated with some records. Table Name: customer Field Туре Notes int(8) customer id Primary key Auto-increment value Required Required Required varchar(25) first name varchar(25) last name Table Name: flight status Field Туре int(8) Notes status_id Primary key Auto-increment value Required Required varchar(25) status Table Name: flight Field Туре int(8) Notes flight_id Primary key Auto-increment value Required varchar(25) varchar(25) from_city Required to city Required Required departure_date_time datetime arrival date time datetime Required status id int(8) Required
Table Name: flight_reservation Field Notes Туре int(8) flight_id Primary key Required Primary key Required int(8) customer id To use the "flight_reservation" database, use the following command: # Use the "flight_reservation" database use flight_reservation; Task One: Alter the Customer Table Construct the SQL statement to alter the table named "customer." The columns, column data types, and column notes are provided in the previous section. You need to alter the table to include an additional column of your choice. This column should represent some property of a person. You can choose the data type for the column and any constraints on the column. Table Name: customer Field Туре int(8) Notes customer_id Primary key Auto-increment value Required first_name last_name varchar(25) Required Required Your Choice . varchar(25) Custom Column Your Choice Task Two: Update Records in the Customer Table Construct the SQL statement to update the existing records in the "customer" table to use the new column that you created. Update the first five records in the table with a value for the new column that you create. ... Task Three: Update Remaining Records in the Customer Table Construct the SQL statement to update the remaining existing records in the "customer" table to use the new column that you created. Update the last five records in the table with a value for the new column that you create.
Task Four: Insert Records to Customer Table Construct the SQL statement to insert five new records in the "customer" table. Make sure that you use the new column that you created in the previous step. Note: You are required to add yourself as a new record in the "customer" table. Use your first name and last name for one of the new records that you insert. Task 5: Insert Records to Flight Table Construct the SQL statement to insert two new records in the "flight" table. Task 6: Insert Records to Flight Reservation Table Construct the SQL statement to insert four new records in the "flight_reservation" table. Note: You are required to add at least one record in which you are the customer on a flight. The customer_id in the "customer" table for the record with your name must have a "reservation" on a flight in the "flight" table. Task 7: Delete Records From Flight Table Construct the SQL statement to delete the records from the "flight" table in which the flight is from Seattle to Las Vegas Verification Verify the results of your SQL statements. Refer to the Frequently Asked Questions document for instructions on how to list the tables in the database and to describe the details for each table. Specifically, the following critical elements must be addressed: Insert new records into tables using appropriate SQL statements. Update existing records using appropriate SQL statements. Delete existing records using appropriate SQL statements.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Task 1 : ALTER customer ADD( city varchar(15) NOT NULL);

Task 2 : UPDATE TOP(5) customer SET city='Delhi'

ORDER BY customer_id;   //For top 5 rows

Task 3 : UPDATE TOP(5) customer SET city='Mumbai'

ORDER BY customer_id DESC; //For bottom 5 rows

Task 4 :-> INSERT INTO customer

VALUES(11223344,'Rohan','Malik','Amritsar');

-> INSERT INTO customer

VALUES(11223346,'Rishi','Verma','Delhi');

-> INSERT INTO customer

VALUES(11223348,'Vishwas','Rana','Mumbai');

-> INSERT INTO customer

VALUES(11223350,'Lalit','Kumar','Kolkata');

-> INSERT INTO customer

VALUES(11223352,'Naman','Adab','Pune');

Task 5 : INSERT INTO flight

VALUES(40221211,'Delhi','Amritsar','2019-07-14 10:23:00','2019-07-14 12:40:00',16644551);

-> INSERT INTO flight

VALUES(40221212,'Delhi','Mumbai','2019-07-16 11:25:00','2019-07-16 14:40:00',16644555);

Task 6 : INSERT INTO flight_reservation

VALUES(40221211,11223344);

-> INSERT INTO flight_reservation

VALUES(40221212,11223348);

Task 7 : DELETE FROM flight WHERE from_city='Seattle' AND to_city='Las Vegas' ;

Add a comment
Know the answer?
Add Answer to:
Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accoun...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Help In Database: Next comes the data entry: Make up data for your database, or find...

    Help In Database: Next comes the data entry: Make up data for your database, or find real data. You can enter the data with INSERT statements, but it is much easier to use PhpAdmin. It has a form where you can type the data directly. Alternatively, you can use PhpAdmin to import CSV data (comma-separated values), which you can export from Excel. Include at least 3 rows in each of the entity relations, and as many rows as you need...

  • Database Management 6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL,...

    Database Management 6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL, address VARCHAR(60), UNIQUE (cust name, address)); A. Run the following inserts and explain why both work and how will you prevent it INSERT INTO customer VALUES ('Alex Doe', NULL); INSERT INTO customer VALUES ('Alex Doe', NULL); 7. [5] Modify the following table definition to ensure that all employees have a minimum wage of $10 CREATE TABLE employee ( empId INT PRIMARY KEY, empName VARCHAR(40)...

  • use workbench please Task 1: Create a database and name it practical2DB. (2 marks) Task 2:...

    use workbench please Task 1: Create a database and name it practical2DB. (2 marks) Task 2: Create all the four tables according to the relational scheme in Figure 1. (8 marks) Task 3: Insert 5 records to into each table. (5 marks) Task 4: Write a query to list alphabetically ordered names, addresses, and IDs of all the customers whose postcode is in (40150, 40400, 47500). (10 marks) Task 5: Delete 1 record from Products table using their primary keys....

  • Create a table tHW2_1_xxxx with the following fields and their data types (id:int, auto increment, Name:...

    Create a table tHW2_1_xxxx with the following fields and their data types (id:int, auto increment, Name: varchar(10), birthday: date, annual_salary: float, bno: varchar(8)), where id is primary key and bno is a foreign key to the branchno column of Branch table in the dreamhome database. All fields cannot be null. then insert five records into your tHW2_1_xxxx table. All the name, birthday, should be different.

  • Someone Please Help Me modify this in PHP I'm in desperate need I cant figure this out ... Make t...

    Someone Please Help Me modify this in PHP I'm in desperate need I cant figure this out ... Make the following modifications: For the vendors table: Comment out the table-level primary key Change the VendorIDcolumn to be a column-level primary key Add a VendorEmail column to the bottom of the table definition (define the data type for the column as variable character and set it to not exceed 45 characters) After the lineItems table, add code to create a table...

  • Using MySQL commands answer the questions listed below using the Premier Products Company schema. 1.Using Views...

    Using MySQL commands answer the questions listed below using the Premier Products Company schema. 1.Using Views a) Create a view called part_location that has the following attributes: part_num, part_description, part_quantity, warehouse_name, warehouse_address. This data comes from the part and warehouse entities. b) Write a query using the view that shows the total number of parts ordered from each warehouse. The output should look like this: 2. Using Triggers a) Execute the following SQL to create the customer_audit table in the...

  • 1. Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database....

    1. 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. 3) Write a script that uses dynamic SQL and a cursor to loop through each row of the Administrators table and (1) create a login ID for each row in that consists of the administrator�s first and last name with no space...

  • For this hands-on project, you will use the SQL Server named instance SQLSERVERHOA, and the HandsOnOne...

    For this hands-on project, you will use the SQL Server named instance SQLSERVERHOA, and the HandsOnOne database and tables you created in previous chapters. The objective of this activity is to practice generating keys and encrypting/decrypting data. Document each step by taking a screen shot of the Query Editor window after successfully executing each SQL query. 1.In SQL Server Management Studio, open a new Query Editor window, which you will use for completing all steps in this activity. 2.Create a...

  • Using the MySQL Workbench create a new database using your design specifications Add at least 10...

    Using the MySQL Workbench create a new database using your design specifications Add at least 10 records to your tables. Note: Certain tables may not require 10 records and that is ok as long as your main tables have 10 or more Create MySQL statements that will retrieve all records or rows from the tables in your database Create 10 MySQL statements that will retrieve specified records or rows from one table in your database Create 10 MySQL statements that...

  • Using Oracle database Need help getting the JAVA code for the queries and the rest of...

    Using Oracle database Need help getting the JAVA code for the queries and the rest of the instructions. Need the table provided converted and fulfil  the requirements. . For this project - you will be writing a program (you may choose whatever programming language you want) to read in your database tables from Lab 5, and then print out the contents of each of the tables. Additionally, you must print at least one query each with the following clauses: *JOIN (any...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT