
Concept explainers
MySQL:
Will you write the code in MySQL using the instructions I provided?
Create a table named cityState with the following attributes, data types, and constraints: a. city, variable character, 90 characters, not null b. state, character, 2 characters, not null c. zipCode, character, 5 characters, not null, unique d. primary key is the zipCode field |
Insert into table cityState data from file cityState.sql |
Alter table employee so that column zipCode is a foreign key to table cityState, column zipCode |
Alter table customer so that column zipCode is a foreign key to table cityState, column zipCode |
Create view customerView with a join query to join tables customer and cityState to do the following: a. Select column firstName from table customer b. Select column lastname from table customer c. Select column address from table customer d. Select column city from table cityState e. Select column state from table cityState f. Select column zipCode from table customer g. Select column phone from table customer h. Select column email from table customer |
Create view employeeView with a join query to join tables employee and cityState to do the following: a. Select column firstName from table employee b. Select column lastname from table employee c. Select column address from table employee d. Select column city from table cityState e. Select column state from table cityState f. Select column zipCode from table employee g. Select column phone from table employee h. Select column email from table employee |
Create a table named sale with the following attributes, data types, and constraints: a. employeeId, int, not null b. customerId, int, not null c. vehicleId, int, not null d. salePrice, decimal, 8 characters total, 2 characters to the right of the decimal point, not null e. primary key is fields employeeId, customerId, and vehicleId f. foreign key on field employeeId, references table employee, column id g. foreign key on field customerId, references table customer, column id h. foreign key on field vehicleId, references table vehicle, column id |
I will rate the work if all my questions are answered. Thanks!

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- a. Normalize the Bank Accounts Table to 1NF by increasing the records in the existing table. b. Normalize the Bank Accounts Table to 1NF by creating a new separate table in addition to the existing table.arrow_forwardTask 6: The Car Maintenance team considered that the available maintenance tasks should also have the price information in the database. Alter the MAINTENANCE_TYPES table to include a new column named MAINTENANCE_PRICE of type FLOAT. ANSWER IN MYSQL PLEASEarrow_forwardThe MongoDB shell is an interactive ______interface to MongoDB. You can use the mongo shell to query and update data as well as perform administrative operations. A. NodeJS B. JavaScript C. C D. SQLarrow_forward
- table not copiedarrow_forwardTask 4: The Driver Relationship team wants to have quick search options for the active drivers. The team specifically mentioned that they are using first name, last name and driving license ID to search the drivers. Create an index called NameSearch on the ACTIVE_DRIVERS table created in task 3. ASNWER IN MYSQL PLEASEarrow_forwardHow do you index a CLOB datatype for faster search operations?arrow_forward
- Hive table’s column, PERSON has an array value, [“jihee”, “jong”,“hemo”]. What function generate three records from the array value,[“jihee”, “jong”, “hemo”]?a. RECORDS(PERSON)b. EXPLODE(PERSON)c. LINES(PERSON)d. ROWS(PERSON)arrow_forward12. List the isbn and name of the book, the id and firstname of the editors. Make sure to include all books in the book table. Order alphabetically by book name.arrow_forwardCreate a VIEW named MAJOR_CUSTOMER. It consists of the customer ID, first name, last name, balance, credit limit, and rep ID for every customer whose credit limit is $500 or less.arrow_forward
- Having this information. StudentsAttribute Name Data TypeStudentID char(11)FirstName varchar(20)LastName varchar(20)Gender char(1)DateofBirth date CoursesAttribute Name Data TypeCourseCode varchar(6)CourseName varchar(70)Level char(2)Credits int RegistrationAttribute Name Data TypeStudentID char(11)CourseCode varchar(6)Grade decimal(2, 1) Write SQL code to: 1. What are the student ID, the names, and birthday of the female students who were born before the last day of 1992? 2. How many students are registered in the course “PHY210”? 3. How many courses are offered by the department of Computer Science (i.e. course codes CS***)? 4. Which course(s) (couseCode and courseName) of level G1 give 5 credits?arrow_forwardindividual characters using their 0-based index. Hint: You will need to do this for checking all the rules. However, when you access a character .arrow_forwardYou have a table that contains the following fields: Last Name, First Name, Street, City, State, and Postal Code. There are 50,000 records in the table. What indexes would you create for the table? You have a table that contains the following fields: Book ISBN Number, Book Title, Author Last Name, Author First Name, Publication Year, and Publisher Name. There are 75,000 records in the table. What indexes would you create for the table?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





