Database name: Ch03_VendingCo Table name: BOOTH Table name: MACHINE BOOTH PRODUCT Chips BOOTH PRICE MACHINE_PRODUCT MACHINE PRICE Chips 1.5 1.25 1.25 2 Cola Chocolate Bar 1 Energy Drink Energy Drink d) Create the table that results from applying a UNION relational operator to the tables shown above. e) Create the table that results from applying an INTERSECT relational operator to the tables shown above. ) Create the table that results from MACHINE DIFFERENCE BOOTH.
Q: create table patients ( patient_id VARCHAR(255), name VARCHAR(255), insurance DECIMAL(15,2),…
A: [A] CREATE PACKAGE Package_FinalB ASPROCEDURE Procedure_P(i_patient_id IN number)FUNCTION…
Q: Task3: Write SQL Queries • At least 2 queries involving GROUP BY, HAVING, and aggregate operators. •…
A: Please check the solution below
Q: Write SQL statements that will 1. create a table named Flavors with columns itemcode(int),…
A: The solution for the above-given question is given below:
Q: Consider the following relational schema Student (StudentID, SName, Major, level, age) Class…
A: Find the required queries given as below : As per the company guidelines we are supposed to answer…
Q: create table patients ( patient_id VARCHAR(255), name VARCHAR(255), insurance DECIMAL(15,2),…
A: Step 1Since you have asked multiple questions, according to the company's policy we will solve the…
Q: The relational schema shown below is part of a hospital database. The primary and foreign keys are…
A: Here we will use to_char() function which converts date format into string and then we will apply…
Q: 4) Write a PL / SQL block to display the details of clients who have made a loan with an amount more…
A: Please find answer to the above question below:
Q: Wrrite a query to display all departments no, which have more-than 2 instructors without using Join…
A: Since you have not provided the database name to write the code so I am using the MySQL database to…
Q: Write a SELECT statement to create a lesson schedule with the lesson date/time, horse ID, and the…
A: Q: Write required SQL statement for give problem
Q: a. Write a query to find the salesperson and customers who belongs to same city. b. Write a query to…
A: As per our company guidelines, we are not supposed to answer more than three parts per post and…
Q: Create a trigger named trg_char_hours that automatically updates the AIRCRAFT table when a new…
A:
Q: ber(11) ID P DISCOUNT JO na veDISCOUNT_ID Write a to display user name and password. Password should…
A: The Answer is in below Steps
Q: Write the SQL command to change the price code for all Action movies to price code 3. Write the SQL…
A: The Answer is as follow:
Q: 4. In a company, employees involved in many projects, and each project may have many employees…
A: Please refer below for your reference:
Q: MYASQL 7. Create Avgoffreight() stored procedure to retrieve the average of freight from Orders…
A:
Q: CREATE TABLE DONORS ( donor_id INT NOT NULL, donor_name varchar(255) NOT NULL, donor_age int,…
A: INSERT INTO DONORS VALUES(1,'SAI',20); INSERT INTO DONORS VALUES(2,'PAVAN',21); INSERT INTO DONORS…
Q: Create a SQL statement to Add a CHECK constraint on the ROOM_STATUS column in the ROOMS table. It…
A: In step 2, I will create the SQL statement to add a CHECK constraint on the ROOM_STATUS column in…
Q: Create a query for selecting Employee_Id , First_Name, Phone_Number where Department_ID is not in…
A: Create table and insert data into it CREATE TABLE EmpDetails( Employee_Id INT PRIMARY KEY ,…
Q: Code three tests: 1) for a student who has courses 2) for student who does not have courses 3) a…
A:
Q: Textbook: Digital Systems Chapter 8 Question/Problem 44 I'm not sure if I'm running the correct…
A: Actually, given information is "Create a trigger named trg_char_hours that automatically updates the…
Q: ) Write a query that uses NATURAL JOIN TO connect the EMPLOYEE and EMPPROJACT table. Include the…
A: Here, we have to write SQL queries for the given statements.
Q: you need to desgin a Simple Inline query to fetch all the child reocrds using the SOQL Inline query…
A: Below is the detailed and simplified solution to the above listed problem statement:
Q: (PL/SQL) the command need to work on Oracle. just post the command and I will check it in my Oracle.…
A: create or replace trigger salaryset before insert on MyEmployeesfor each rowbeginif :new.salary IS…
Q: 9. Which one of the following may be specified both in a WHERE Clause and a FROM Clause. a) a…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: lease implement the following using Oracle live/SQL Developer: 1- Create the DONORS table with the…
A: please do upvote for my efforts ! answer: 1) CREATE TABLE DONORS( donor_id int primary key,…
Q: GO CREATE TABLE dbo.product( product_id int not null, product_description varchar(30) not null ,…
A: The graphical version and the SQL codes both approaches are having its advantages and disadvantages.…
Q: address Write a query to display the guest names who are from Ooty. For instance, the guest name…
A: Required: We have to write a SQL query that displays the guest names who are from Ooty and the…
Q: Let R(A, B, C, D, E, F) be a relation with FD's: {D → CE, C → BDE, E → AD, AF → E, B → D Which of…
A: Candidate keys is {F} Here for X->Y, the relation will be in 3nf if X is a super key or Y is one…
Q: SOQL - salesforce object query language Why i am getting this error in the below query Here is the…
A: Required: ApexSOQL - salesforce object query language Why i am getting this error in the below…
Q: hospital.sql/hospital.rtf. 1. Use INSTR to find the position of character 'a' in the doctor's name.…
A: Note: As you have asked a multipart question, as per our policy, we will solve the first three parts…
Q: rite the syntax to insert into a relational table called students the address column references an…
A: Lets see the solution.
Q: Suppose you want to get all student names that start with letter ‘M’ and end on ‘D’. Write a regular…
A: Following is the query and code and output as per your requirement. I just create a table student…
Q: Order of execution is critical since some operations are only meaningful after some order (i.e.…
A: Solution : The above answer is True
Q: CREATE TABLE MEMBERSHIP ( MEM_NUM CHAR(3) CONSTRAINT MEMBER_MEM_NUM_PK PRIMARY KEY, MEM_FNAME…
A: A database management system (DBMS) is a software tool that makes it possible to organize data in a…
Q: In relational algebra, what does the operator P do? Select one: O a. Performs a join between two…
A: Functional dependency is the relation that exists between primary keys and non-key attributes…
Q: This clause in SQL join is based on all columns which have the same names, but the data types do not…
A: b. USING clause
Q: Create a query that SELECT all of the EMPLOYEES from the EMPLOYEE TABLE that are Mangers. Include…
A: SQL self join is used to join or compare a table to itself. SQL self joins are used to compare…
Q: es in relational algebra. Find the username of users who are from ‘Muscat’. Find the IDs of pictures…
A: 1. Find the username of users who are from ‘Muscat’ SELECT username FROM users where place='Muscat'…
Q: Write a SQL query that displays the number of customers who born on the 16th day of a month . Write…
A: here have to determine sql query of given question.
Q: Write the SQL command to change the movie year for movie number 1245 to 2014 Alter the PRICE table…
A: UPDATE QUERY: update query is used to update the column value using the setting the…
Q: SECTION - A Database Object design Column Name Data Type Constraint (Column Level) DoctorID…
A: Creating Database: use Database1; CREATE TABLE Doctors(DoctorID int not null UNIQUE,DoctorName…
Q: 1.Question Workspace Write an SQL query that displays the therapies and their unit of time for…
A: According to company policies I am compelled to solve only one question and that is the first…
Q: 5. Now compute Average GPA in each class. Display class_code, Class_GPA. Assume all courses are 3…
A: Now compute Average GPA in each class. Display class_code, Class_GPA. Assume all courses are 3…
Q: function findAllTransactions() { // write the code here that does the query to select all…
A: The ORDER BY clause is used to sort the result set in ascending or descending order. Actual query is…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- MySQL CREATE TABLE students ( id INT PRIMARY KEY, first_name VARCHAR(50), last_name VARCHAR(50), age INT, major VARCHAR(50), faculty VARCHAR(50)); CREATE TABLE location ( id INT PRIMARY KEY, name VARCHAR(50), rooms INT); CREATE TABLE faculty ( id INT PRIMARY KEY, name VARCHAR(50), department_id INT); 4. Find the number of employees in each department who get no commission or have salary less than5000.5. Find the maximum salary of employees in each department that the employee was hired 15 yearsbefore now. *hint: user TIMESTAMPDIFF(<unit type>,<Date_value 1>,<Date_value 2>), the unitcan be YEAR, MONTH, DAY, HOUR, etc...6. Find the last name of all employees that were not hired on Tuesday *hint: (UseDATE_FORMAT() function amd the format you need is %W, also use UPPER()7. Find the number of employees in each department who have a manager.8. Find the number of employees for each manager whose employees' minimum salary is greaterthan 5000.9. Find the number of…The table VideoVisitFact has a single primary key column of VideoVisitKey. The column is numeric. Which of the following returns the number of rows in the VideoVisitFact table? A. SELECT MAX (VideoVisitKey) FROM VideoVisitFact B. SELECT COUNT (*) FROM VideoVisitFact C. SELECT (*) FROM VideoVisitFact D. SELECT SUM(VideoVisitKey) FROM VideoVisitFactA new table has been requested to support tracking automated emails sent to customers. Create the table and add data as described below. Tablename: email_log Columns: emailid (numeric), emaildate (datetime), customer# (numeric) Primary key: emailid column, define as an Identity Column Add the following data rows and display resulting rows (if any errors occur, explain why the error is expected) Emaildate = current date, customer# = 1007 Emailid = specify to use the column default value, emaildate = current date, customer# = 1008 Emailid = 25, emaildate = current date, customer# = 1009
- Create a new table containing these four columns: Emp#, Lastname, Firstname, and Job_class. The table name should be EMPLOYEES. The Job_class column should be able to store character strings up to a maximum length of four, but the column values shouldn’t be padded if the value has less than four characters. The Emp# column contains a numeric ID and should allow a five-digit number. Use column sizes you consider suitable for the Firstname and Lastname columns.CREATE TABLE Users( C_Id varchar(8) NOT NULL, LastName Varchar(255) NOT NULL, FirstName varchar(255) NOT NULL, ema il varchar(255), Phone int, PRIMARY KÉY (C_Id) CREATE TABLE Restaurants( R_Id varchar(255) NOT NULL, Rname varchar(255) NOT NULL, Type varchar(255), Raddress varchar(255), Rphone int, Remail varchar(255), PRIMARY KEY(R_Id) ); CREATE TABLE RDate( T_num int NOT NULL, Bdate DATE, Rdate DATE, T_start varchar(255), E_start varchar(255), PRIMARY KEY(T_num) ); CREATE TABLE Book ingInfo( C_Id varchar(8) NOT NULL, R_Id int NOT NÚLL, PRIMARY KEY(C_Id, R_Id), FOREIGN KEY (C_Ià) REFERENCES Users(C Id), FOREIGN KEY (R_Id) REFERENCES Restaurant(R_Id) ); CREATE TABLE Rating( R_Id varchar(255) NÓT NULL, Rating Id varchar(255) NOT NULL, Rate varchar(255) CHECK (Rate>11), Comment LONG, PRIMARY KEY(Rating Id), FOREIGN KEY (R_Id) REFERENCES Restaurants(R_Id) ); Create 1 procedure Create 1 function Create 1 database trigger |A new table has been requested to support tracking automated emails sent to customers.Create the table and add data as described below Tablename: email_logColumns: emailid (numeric), emaildate (datetime), customer# (numeric)Primary key: emailid column, define as an Identity Column Add the following data rows and display resulting rows (if any errors occur, explain why theerror is expected)
- Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string Student with columns: ID - integer, primary key FirstName - variable-length string LastName - variable-length string Create the LessonSchedule table with columns: HorseID - integer with range 0 to 65 thousand, not NULL, foreign key references Horse(ID) StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID) LessonDateTime - date/time, not NULL Primary key is (HorseID, LessonDateTime) If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically. If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically. Notes: Table and column names are case sensitive in the auto-grader. Your SQL code does not display any results in Develop mode. Use Submit mode to test your code.Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string Student with columns: ID - integer, primary key FirstName - variable-length string LastName - variable-length string Create the LessonSchedule table with columns: HorseID - integer with range 0 to 65 thousand, not NULL, foreign key references Horse(ID) StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID) LessonDateTime - date/time, not NULL Primary key is (HorseID, LessonDateTime) If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically. If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically.SQL: Dog DataIn each question below, you will define a new table based on the following tables.CREATE TABLE parents ASSELECT "abraham" AS parent, "barack" AS child UNIONSELECT "abraham" , "clinton" UNIONSELECT "delano" , "herbert" UNIONSELECT "fillmore" , "abraham" UNIONSELECT "fillmore" , "delano" UNIONSELECT "fillmore" , "grover" UNIONSELECT "eisenhower" , "fillmore";CREATE TABLE dogs ASSELECT "abraham" AS name, "long" AS fur, 26 AS height UNIONSELECT "barack" , "short" , 52 UNIONSELECT "clinton" , "long" , 47 UNIONSELECT "delano" , "long" , 46 UNIONSELECT "eisenhower" , "short" , 35 UNIONSELECT "fillmore" , "curly" , 32 UNIONSELECT "grover" , "short" , 28 UNIONSELECT "herbert" , "curly" , 31;CREATE TABLE sizes ASSELECT "toy" AS size, 24 AS min, 28 AS max UNIONSELECT "mini" , 28 , 35 UNIONSELECT "medium" , 35 , 45 UNIONSELECT "standard" , 45 , 60; Q3: SentencesThere are two pairs of siblings that have the same size. Create a table that contains a row with a string foreach of…
- create table students ( student_id serial primary key, citizen_number char(11) unique not null, first_name varchar(100) not null, middle_name varchar(100), last_name varchar(100) not null, birth_date date not null, address varchar(1024) not null ); create table lectures ( lecture_code char(7) primary key, name varchar(100) not null, credits int ); create table grades ( grade_id serial primary key, description char(2) not null, value double precision not null ); insert into grades (description, value) values ('AA', 4.0), ('BA', 3.5), ('BB', 3.0), ('CB', 2.5), ('CC', 2.0), ('DC', 1.5), ('DD', 1.0), ('FD', 0.5), ('FF', 0.0), ('NA', -1), ('P', -1); create table enrolls ( enroll_id serial primary key, student_id int references students(student_id) not null, lecture_code char(7) references lectures(lecture_code) not null, grade_id int references grades(grade_id) ) 2. Create a dummy data. You can use…SQL: Dog DataIn each question below, you will define a new table based on the following tables.CREATE TABLE parents ASSELECT "abraham" AS parent, "barack" AS child UNIONSELECT "abraham" , "clinton" UNIONSELECT "delano" , "herbert" UNIONSELECT "fillmore" , "abraham" UNIONSELECT "fillmore" , "delano" UNIONSELECT "fillmore" , "grover" UNIONSELECT "eisenhower" , "fillmore";CREATE TABLE dogs ASSELECT "abraham" AS name, "long" AS fur, 26 AS height UNIONSELECT "barack" , "short" , 52 UNIONSELECT "clinton" , "long" , 47 UNIONSELECT "delano" , "long" , 46 UNIONSELECT "eisenhower" , "short" , 35 UNIONSELECT "fillmore" , "curly" , 32 UNIONSELECT "grover" , "short" , 28 UNIONSELECT "herbert" , "curly" , 31;CREATE TABLE sizes ASSELECT "toy" AS size, 24 AS min, 28 AS max UNIONSELECT "mini" , 28 , 35 UNIONSELECT "medium" , 35 , 45 UNIONSELECT "standard" , 45 , 60; Q2: By Parent HeightCreate a table by_parent_height that has a column of the names of all dogs that have a parent,ordered by the height…Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string Student with columns: ID - integer, primary key FirstName - variable-length string LastName - variable-length string Create the LessonSchedule table with columns: HorseID - integer with range 0 to 65 thousand, not NULL, partial primary key, foreign key references Horse(ID) StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID) LessonDateTime - date/time, not NULL, partial primary key If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically. If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically.