Given the SQL tables Supplier(name, location), Part(part#, type, color, location), Project(name, location), and Interaction(supplier, part, project) given an SQL statement which finds all projects supplied entirely by one supplier.
Select supplier from Interaction where count(supplier) from (Select supplier from Interaction Group by Project) is 1.
Given the SQL tables Supplier(name, location), Part(part#, type, color, location), Project(name, location), and Interaction(supplier, part, project)...
Using MySQL Workbench:
Submit the printouts of your interaction with the DBMS. ID name ID delivery_timestamp supplier supplied item city name quantity 1. [30-point] Create an SQL database of the above ER-diagram using "create table” statements. The type of attribute "quantity" is integer, "delivery_timestamp" is timestamp, and, for all the others, the type is varchar (up to 100 chars). 2. [10-point] Insert 4 records into supplier, 4 records into item, and 10 records into supplied. 3. [60-points] Perform the following...
2. Part 2 Given a set of tables with their content (tuples/rows), show what would be retrieved if the given SQL queries were issued Consider tables, of a Supplier-Parts DB, shown in Figure 2. Names of tables, columns and identification of primary foreign keys are shown. Questions in this part ask you to show what would be displayed by the following SQL queries should they be executed against the tables having content (tuples/rows) shown in Figure 2. In each answer...
Write SQL Queries Given the following
tables
(7pts) Retrieve the names of employees and their
project name. If the employee never worked on a project, show the
names only the name, not the project name.
(7pts) Retrieve the names of employees who have worked
on the same project at a different location.
(7pts) Retrieve the names of employees who have worked
on more than two different projects.
(7pts) Retrieve the names of employees who manage more
than two employees.
CREATE...
You may use the SQL Handout given out in class. The database is called the suppliers-parts-projects database. S, P, J, and SPJ are the 4 tables. S is the Suppliers table P is the Parts table Jis the Projects table and SPJ is where a specified supplier supplies the specified part to the specified project in the specified quantity. NOTE: The database is on the last page of this test, you may detach this from the rest of the test.
database and sql problme
THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...
Please finish all 6 parts with indexing SQL. Don't need to do
the measure time things, but you can do it if you wanna do it.
Thanks!
Write the following SQL queries and measure their execution time both with and without using indexes 1. Count how many parts in NYC have more than 70 parts on hand 2. Count how many total parts on hand, in both NYC and SFO, are Red 3. List all the suppliers that have more...
Based on the schemas given below, give the appropriate “SQL” and “Relational algebra” statements for the given queries Marking scheme: 1 mark for each correct syntax for SQL and Relational Algebra Employee (fname, Iname, ssn, sex, salary, dno) Department (dname, dno, managersn, dlocation) Project (pname, pno, plocation, dno) a) Find out which department “Evelyn" is working in. b) Retrieve the names of all the projects which are located in “Isa Town". c) Count the number of employees who receive a...
This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the following attributes: MPROPERTY (Property_ID, Owner_ID, Owner_Name, Owner_email, Owner_type) Property_ID is the id of property owned by an owner (assume one property can be owned by one owner only) Owner_ID is the ID of Owner Owner_name is name of the owner Owner_email is the e-mail of the owner Owner_type is type of owner (individual, corporate or Partnership) MEMPLOYEE (Employee_ID, Last_name, First_Name, CellPhone, ExperienceLevel) EMPLOYEE_ID is...
SQL QUERIES
1) Using the Product and PC relations, create both tables in
your database and insert all the data. Show the SQL statements to
create each table and show a representative SQL insert statement
for the data in each table (i.e. you do not need to show insert
statements for all the data).
– For the remaining questions, assume that your SQL is part of
a program function and the function provides the input needed for
your SQL query....
rider_student Column Data Type Description student_id integer the primary key first_name varchar(25) student first name last_name varchar(25) student last name major_id integer the ID of the student's major; a foreign key for the major_id in the rider_major table rider_major Column Data Type Description major_id integer the primary key major_name varchar(50) student first name major_description varchar(100) student last name Use the Tables above to answer the questions. Questions: 1. Write a SQL statement to add a student record to the rider_student...