Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write the SQL code that will restore the data to its original status: that is, the table should contain the data that existed before you made the changes in Problems 5 and 6.arrow_forwardCreate a Pl SQL package named EMP_PKG which will have the above three functions and procedures as follows: CALC_TAX - private CHECK_FNAME - Public AVG_SAL - Publicarrow_forwardI need this answer in SQL. . SQL please if your going to answer it Populate fields into your tables. Create original and expected items for each field. Do not use generic fillers. Side: 7 rowsEntree: 5 rowsMenu: 4 rows (seasonal)Zip: 4 rows (local)Address: 10 rowsMenu_Dish: 5 rowsSide_List: 8 rows (matching menu dishes with sides)Dish_Build: 16 rows (matching menu with menu dishes)Event_Menu: 4 rowsMember: 12 rows Add rows of inserts that simulates the invitation process. Write the insert statements for 100% invitations for one event. Then, add rows of inserts that simulate the return of only 10 RSVPs. You can decide which 10 people RSVP. Of those 10 RSVPs, two are not attending. Of those attending, 50% will have guests. Also, write the inserts for those attending and their dish selection. Finally, complete this query at the bottom of your database script: Write a SQL statement that gives you all the names of the people that attended one of your seasonal events and specify if…arrow_forward
- how to create a metadeta fore this SQL script: -- creating the clinic DataBase CREATE DATABASE clinic; USE clinic; -- creating the doctor table with the doctor _id as a primary key CREATE TABLE doctor( doctor_id INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(15), specilization VARCHAR(15), phone VARCHAR(10), gender VARCHAR(10), PRIMARY KEY (doctor_id) ); -- creating the patient table with the patient_id as a primary key CREATE TABLE patient( patient_id INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(15), age INT, gender VARCHAR(10), weight INT, cinic VARCHAR(10), PRIMARY KEY (patient_id) ); -- creating the apointment table with the id int as a primary key CREATE TABLE appointments( id INT NOT NULL AUTO_INCREMENT, patient_id INT NOT NULL, doctor_id INT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (patient_id) REFERENCES patient(patient_id), FOREIGN KEY (doctor_id) REFERENCES doctor(doctor_id) ); -- creating the tests…arrow_forwardWhat results will the SQL queries below return? If there are errors in the queries, indicate what updates you would make so that the query could run successfully. Query 1:Select*FromWhere Department.id = 1 Query 2:Select Member.name, Member.insuranceid, Benefitplan.name From Member,BenefitplanWhereMember.insuranceid = Benefitplan.insuranceid Query 3:SelectMember.name, Member.insuranceid, Claim.membercostshare From Claim Left join MemberWhereMember.insuranceid = Claim.insuranceidarrow_forwardDatabse SQL Queries. Need to write the SQL code for pulling the total cost of our inventory. We have the following 2 tables. The Parts table, which has the cost of each part, and the inventory table, which has the quantity. We need to find the total cost of our inventory. Here are pictures for reference. There are a total of 35 PartID's. Thanks!arrow_forward
- Solve C I. This Project asks you to submit a SQL text file (e.g. project2.sql) with all your answers to all the questions listed in this assignment. Your answers will be written in SQL format. All SQL statements will be tested in a MySQL database including: CREATE TABLE, ALTER TABLE, INSERT and SELECT. You must use the following table structures for your MySQL DDL and DML commands: STUDENT(StudentID, LastName, FirstName, Address, City, State, Zip, Phone) StudentID will be automatically increased integer identifier Choose VARCHAR or CHAR based on your personal understanding of the fields for the rest part of the relation/table STUDENT_TEXTBOOK(StudentID, TextbookID, Class, Semester, Year) Semester would be CHAR Year would be integer TEXTBOOK(TextbookID, Description, Price, Location, BookstoreID) TextbookID will be automatically increased integer identifier Price is a decimal with 2 decimal places after zero Description and Location can be VARCHAR or CHAR based on your personal…arrow_forwardHow can I create SQL command for the belows problems? The table below is the instance of the databasearrow_forwardЕMP EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO Dept DEPTNO DNAME LOC - MGR field is foreign key references empno - DEPTNO in emp table is foreign key references deptno in dept table. - Using your Apex account (http://apex.oracle.com), upload the script file (scott.sql) that creates emp-dept tables and try to do the following: 1. Insert a new employee info into emp table with the following info: o empno:4000. o name: Your name o hiredate: today date o deptno:null 2. Give for the employees who work as CLERK a commission equals 5% of their salary. 3. Retrieve the names of employees who don't take commission and hired before 1985. 4. Retrieve the names of employees, and their hiredates ordered from the newest hired employee to the oldest hired one. Notes: • Write the question number for each answer. • Save your answers on notepad as .sql file and upload it on “Assignment3_Upload" link.arrow_forward
- You are working with a database table that contains employee data. The table includes columns about employee location such as city, state, country, and postal_code. You want to retrieve the first 3 characters of each postal code. You decide to use the SUBSTR function to retrieve the first 3 characters of each postal code, and use the AS command to store the result in a new column called new_postal_code. You write the SQL query below. Add a statement to your SQL query that will retrieve the first 3 characters of each postal code and store the result in a new column as new_postal_code. NOTE: The three dots (...) indicate where to add the statement. 1 2 3 4 5 6 7 SELECT employee_id, ... FROM employee ORDER BY postal_code RunReset What employee ID number appears in row 5 of your query result?arrow_forwardQuestion 5 You are working with a database table that contains customer data. The table includes columns about customer location such as city, state, country, and postal_code. You want to check for postal codes that are greater than 7 characters long. You write the SQL query below. Add a LENGTH function that will return any postal codes that are greater than 7 characters long. 1 2 3 4 5 SELECT * FROM customer WHERE RunReset What is the last name of the customer that appears in row 10 of your query result? 1 pointarrow_forwardWrite all the sql code (including create, insert and select)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning